From a6ee365156c517d47d99666782c24e18127b4691 Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Fri, 25 Oct 2024 20:11:49 +0300 Subject: [PATCH 1/3] Update find_ellipses.cpp --- modules/ximgproc/src/find_ellipses.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ximgproc/src/find_ellipses.cpp b/modules/ximgproc/src/find_ellipses.cpp index de73f833b47..b5ab61e7930 100644 --- a/modules/ximgproc/src/find_ellipses.cpp +++ b/modules/ximgproc/src/find_ellipses.cpp @@ -1218,9 +1218,10 @@ void EllipseDetectorImpl::getTriplets413(VVP &pi, VVP &pj, VVP &pk, } } -void EllipseDetectorImpl::preProcessing(Mat1b &image, Mat1b &dp, Mat1b &dn) { +void EllipseDetectorImpl::preProcessing(Mat1b &src, Mat1b &dp, Mat1b &dn) { // smooth image - GaussianBlur(image, image, _kernelSize, _sigma); + Mat image; + GaussianBlur(src, image, _kernelSize, _sigma); // temp variables Mat1b edges;// edge mask From 3f268172cf242d14347f6e4d092428cb57138f89 Mon Sep 17 00:00:00 2001 From: cudawarped <12133430+cudawarped@users.noreply.github.com> Date: Sat, 23 Nov 2024 08:30:50 +0200 Subject: [PATCH 2/3] cudaimgproc: remove incorrectly added NppStreamHandler from cv::cuda::evenLevels --- modules/cudaimgproc/src/histogram.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/modules/cudaimgproc/src/histogram.cpp b/modules/cudaimgproc/src/histogram.cpp index f6cb35546ed..9652bed00b5 100644 --- a/modules/cudaimgproc/src/histogram.cpp +++ b/modules/cudaimgproc/src/histogram.cpp @@ -553,24 +553,6 @@ namespace }; } -class OldNppStreamHandlerForEvenLevels -{ -public: - explicit OldNppStreamHandlerForEvenLevels(Stream& newStream) - { - oldStream = nppGetStream(); - nppSafeSetStream(oldStream, StreamAccessor::getStream(newStream)); - } - - ~OldNppStreamHandlerForEvenLevels() - { - nppSafeSetStream(nppGetStream(), oldStream); - } - -private: - cudaStream_t oldStream; -}; - void cv::cuda::evenLevels(OutputArray _levels, int nLevels, int lowerLevel, int upperLevel, Stream& stream) { const int kind = _levels.kind(); @@ -583,9 +565,6 @@ void cv::cuda::evenLevels(OutputArray _levels, int nLevels, int lowerLevel, int else host_levels = _levels.getMat(); - // Update to use NppStreamHandler when nppiEvenLevelsHost_32s_Ctx is included in nppist.lib and libnppist.so - OldNppStreamHandlerForEvenLevels h(stream); - nppSafeCall( nppiEvenLevelsHost_32s(host_levels.ptr(), nLevels, lowerLevel, upperLevel) ); if (kind == _InputArray::CUDA_GPU_MAT) From ec5e4c3e856861bee405e80d0807d9a9b8a3e4dc Mon Sep 17 00:00:00 2001 From: Abbas Elmas Date: Tue, 26 Nov 2024 10:47:06 +0300 Subject: [PATCH 3/3] Merge pull request #3829 from abbaselmas:patch-1 getDefaultName() added #3829 all other contrib feature detectors have this function but TBMR --- modules/xfeatures2d/include/opencv2/xfeatures2d.hpp | 2 ++ modules/xfeatures2d/src/tbmr.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp b/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp index 3793541c238..44f1af92452 100644 --- a/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp +++ b/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp @@ -1209,6 +1209,8 @@ class CV_EXPORTS_W TBMR : public AffineFeature2D CV_WRAP virtual float getScaleFactor() const = 0; CV_WRAP virtual void setNScales(int n_scales) = 0; CV_WRAP virtual int getNScales() const = 0; + + CV_WRAP String getDefaultName() const CV_OVERRIDE; }; /** @brief Estimates cornerness for prespecified KeyPoints using the FAST algorithm diff --git a/modules/xfeatures2d/src/tbmr.cpp b/modules/xfeatures2d/src/tbmr.cpp index 36a0a538b7e..b3b4f08ff26 100644 --- a/modules/xfeatures2d/src/tbmr.cpp +++ b/modules/xfeatures2d/src/tbmr.cpp @@ -573,6 +573,11 @@ void TBMR_Impl::detectAndCompute( useProvidedKeypoints); } +String TBMR::getDefaultName() const +{ + return (Feature2D::getDefaultName() + ".TBMR"); +} + Ptr TBMR::create(int _min_area, float _max_area_relative, float _scale, int _n_scale) { @@ -581,4 +586,4 @@ Ptr TBMR::create(int _min_area, float _max_area_relative, float _scale, } } // namespace xfeatures2d -} // namespace cv \ No newline at end of file +} // namespace cv