Skip to content

Commit 3a72729

Browse files
committed
Merge branch 4.x
2 parents 1d306fc + 6a0c82a commit 3a72729

File tree

7 files changed

+33
-18
lines changed

7 files changed

+33
-18
lines changed

modules/cudafilters/include/opencv2/cudafilters.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,18 @@ CV_EXPORTS_W Ptr<Filter> createColumnSumFilter(int srcType, int dstType, int ksi
359359

360360
/** @brief Performs median filtering for each point of the source image.
361361
362-
@param srcType type of of source image. Only CV_8UC1 images are supported for now.
362+
@param srcType type of of source image. Only CV_8UC1 if CUDA_VERSION < 11. CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3 or CV_32FC4 if CUDA_VERSION >= 11.
363363
@param windowSize Size of the kernerl used for the filtering. Uses a (windowSize x windowSize) filter.
364-
@param partition Specifies the parallel granularity of the workload. This parameter should be used GPU experts when optimizing performance.
364+
@param partition Specifies the parallel granularity of the workload. Only used if CUDA_VERSION < 11.
365365
366366
Outputs an image that has been filtered using a median-filtering formulation.
367367
368-
Details on this algorithm can be found in:
368+
If compiled with CUDA 11 or greater, a wavelet based algorithm is used as described at:
369+
https://cgenglab.github.io/en/publication/sigga22_wmatrix_median/
370+
Yuji Moroto, Nobuyuki Umetani, 2022, "Constant Time Median Filter Using 2D Wavelet Matrix",
371+
ACM Transactions on Graphics, Volume 41, Issue 6.
372+
373+
For earlier versions of CUDA, details on the algorithm used can be found in:
369374
Green, O., 2017. "Efficient scalable median filtering using histogram-based operations",
370375
IEEE Transactions on Image Processing, 27(5), pp.2217-2228.
371376

modules/cudaimgproc/doc/cudaimgproc.bib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@ @article{Allegretti2019
88
year={2019},
99
publisher={IEEE}
1010
}
11+
12+
@article{BT.709,
13+
title={Recommendation ITU-R BT.709-6},
14+
author={ITU},
15+
pages={3},
16+
year={2015},
17+
publisher={ITU}
18+
url={https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-6-201506-I!!PDF-E.pdf}
19+
}
20.9 KB
Loading

modules/cudaimgproc/include/opencv2/cudaimgproc.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,19 @@ CV_EXPORTS void swapChannels(InputOutputArray image, const int dstOrder[4], Stre
154154
@param dst Destination image.
155155
@param forward true for forward gamma correction or false for inverse gamma correction.
156156
@param stream Stream for the asynchronous version.
157+
158+
Gamma correction is conformant to BT.709 @cite BT.709 with &gamma;=0.45.
159+
160+
For the forward transform, RGB values are normalised to fit in the range L=[0..1], then:
161+
- For L < 0.018
162+
+ V = 4.5*L
163+
- For L >= 0.018
164+
+ V = 1.099 * L^0.45 - 0.099
165+
166+
With V then being scaled back to [0..255].
167+
168+
![image](pics/gammacorrection.png)
169+
157170
*/
158171
CV_EXPORTS_W void gammaCorrection(InputArray src, OutputArray dst, bool forward = true, Stream& stream = Stream::Null());
159172

modules/saliency/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ endif()
44

55
set(the_description "Saliency API")
66

7-
ocv_define_module(saliency opencv_imgproc opencv_features WRAP python)
7+
ocv_define_module(saliency opencv_imgproc opencv_features WRAP python java)
88

99
ocv_warnings_disable(CMAKE_CXX_FLAGS -Woverloaded-virtual)

modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class CV_EXPORTS_W StaticSaliencySpectralResidual : public StaticSaliency
8787
}
8888

8989
CV_WRAP void read( const FileNode& fn ) CV_OVERRIDE;
90-
void write( FileStorage& fs ) const CV_OVERRIDE;
90+
CV_WRAP void write( FileStorage& fs ) const CV_OVERRIDE;
9191

9292
CV_WRAP int getImageWidth() const
9393
{
@@ -308,9 +308,6 @@ class CV_EXPORTS_W ObjectnessBING : public Objectness
308308
return computeSaliencyImpl( image, saliencyMap );
309309
}
310310

311-
CV_WRAP void read();
312-
CV_WRAP void write() const;
313-
314311
/** @brief Return the list of the rectangles' objectness value,
315312
316313
in the same order as the *vector\<Vec4i\> objectnessBoundingBox* returned by the algorithm (in

modules/saliency/src/BING/objectnessBING.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -448,21 +448,12 @@ bool ObjectnessBING::matRead( const std::string& filename, Mat& _M )
448448
M.copyTo( _M );
449449
return true;
450450
}
451+
451452
std::vector<float> ObjectnessBING::getobjectnessValues()
452453
{
453454
return objectnessValues;
454455
}
455456

456-
void ObjectnessBING::read()
457-
{
458-
459-
}
460-
461-
void ObjectnessBING::write() const
462-
{
463-
464-
}
465-
466457
bool ObjectnessBING::computeSaliencyImpl( InputArray image, OutputArray objectnessBoundingBox )
467458
{
468459
ValStructVec<float, Vec4i> finalBoxes;

0 commit comments

Comments
 (0)