From 39f6e0d5e41b6e427e1a18db1190ad616599f033 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 8 Mar 2024 01:40:35 +0300 Subject: [PATCH] refactoring --- modules/cudaimgproc/include/opencv2/cudaimgproc.hpp | 10 +++++++++- modules/cudaimgproc/src/histogram.cpp | 2 +- modules/cudaimgproc/test/test_histogram.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/cudaimgproc/include/opencv2/cudaimgproc.hpp b/modules/cudaimgproc/include/opencv2/cudaimgproc.hpp index 3d08f6590b4..c14468e65f6 100644 --- a/modules/cudaimgproc/include/opencv2/cudaimgproc.hpp +++ b/modules/cudaimgproc/include/opencv2/cudaimgproc.hpp @@ -148,7 +148,15 @@ The methods support arbitrary permutations of the original channels, including r */ CV_EXPORTS void swapChannels(InputOutputArray image, const int dstOrder[4], Stream& stream = Stream::Null()); -CV_EXPORTS_W void infer(InputArray src, Mat ccm, OutputArray dst, Stream& stream = Stream::Null()); + +/** @brief calibrate input CV_8UC3 image (GpuMat, BGR format) and return new CV_8UC3 image (GpuMat, BGR format) + +@param src - input GpuMat with type CV_8UC3, BGR format +@param ccm - input CCM with type CV_64F and size 3x3 +@param src - output GpuMat with type CV_8UC3, BGR format +The methods support arbitrary permutations of the original channels, including replication. + */ +CV_EXPORTS_W void calibrateImageF32C3(InputArray src, Mat ccm, OutputArray dst, Stream& stream = Stream::Null()); /** @brief Routines for correcting image color gamma. diff --git a/modules/cudaimgproc/src/histogram.cpp b/modules/cudaimgproc/src/histogram.cpp index be015877a05..c779ed7586f 100644 --- a/modules/cudaimgproc/src/histogram.cpp +++ b/modules/cudaimgproc/src/histogram.cpp @@ -78,7 +78,7 @@ void cv::cuda::calcHist(InputArray _src, OutputArray _hist, Stream& stream) calcHist(_src, cv::cuda::GpuMat(), _hist, stream); } -void cv::cuda::infer(InputArray _src, Mat ccm, OutputArray _dst, Stream& _stream) { +void cv::cuda::calibrateImageF32C3(InputArray _src, Mat ccm, OutputArray _dst, Stream& _stream) { GpuMat src = _src.getGpuMat(); CV_Assert(src.type() == CV_8UC3); CV_Assert(ccm.type() == CV_64F && ccm.rows == 3 && ccm.cols == 3); diff --git a/modules/cudaimgproc/test/test_histogram.cpp b/modules/cudaimgproc/test/test_histogram.cpp index a94abd38150..c40147b0994 100644 --- a/modules/cudaimgproc/test/test_histogram.cpp +++ b/modules/cudaimgproc/test/test_histogram.cpp @@ -283,7 +283,7 @@ TEST(EqualizeHist, infer) const double phi = 12.923210180787855; cv::cuda::GpuMat dst; - cv::cuda::infer(loadMat(src), ccm, dst); + cv::cuda::calibrateImageF32C3(loadMat(src), ccm, dst); Mat tmp; dst.download(tmp);