Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrPanov committed Mar 7, 2024
1 parent 9ce2cfa commit 39f6e0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion modules/cudaimgproc/include/opencv2/cudaimgproc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion modules/cudaimgproc/src/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion modules/cudaimgproc/test/test_histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 39f6e0d

Please sign in to comment.