From a007c7b980b2e4ab154d7e94d12e85eba99d90c1 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Tue, 13 Aug 2013 18:15:02 +0400 Subject: [PATCH] Boring changes - gpuimgproc. --- modules/gpuimgproc/src/canny.cpp | 2 +- modules/gpuimgproc/src/corners.cpp | 4 ++-- modules/gpuimgproc/src/generalized_hough.cpp | 4 ++-- modules/gpuimgproc/src/gftt.cpp | 3 ++- modules/gpuimgproc/src/histogram.cpp | 2 +- modules/gpuimgproc/src/hough_circles.cpp | 2 +- modules/gpuimgproc/src/hough_lines.cpp | 2 +- modules/gpuimgproc/src/hough_segments.cpp | 2 +- modules/gpuimgproc/src/match_template.cpp | 16 ++++++++-------- 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/modules/gpuimgproc/src/canny.cpp b/modules/gpuimgproc/src/canny.cpp index d6f5e6b03..17f03950f 100644 --- a/modules/gpuimgproc/src/canny.cpp +++ b/modules/gpuimgproc/src/canny.cpp @@ -228,7 +228,7 @@ namespace Ptr cv::gpu::createCannyEdgeDetector(double low_thresh, double high_thresh, int apperture_size, bool L2gradient) { - return new CannyImpl(low_thresh, high_thresh, apperture_size, L2gradient); + return makePtr(low_thresh, high_thresh, apperture_size, L2gradient); } #endif /* !defined (HAVE_CUDA) */ diff --git a/modules/gpuimgproc/src/corners.cpp b/modules/gpuimgproc/src/corners.cpp index 5df506327..6b53e6f85 100644 --- a/modules/gpuimgproc/src/corners.cpp +++ b/modules/gpuimgproc/src/corners.cpp @@ -178,12 +178,12 @@ namespace Ptr cv::gpu::createHarrisCorner(int srcType, int blockSize, int ksize, double k, int borderType) { - return new Harris(srcType, blockSize, ksize, k, borderType); + return makePtr(srcType, blockSize, ksize, k, borderType); } Ptr cv::gpu::createMinEigenValCorner(int srcType, int blockSize, int ksize, int borderType) { - return new MinEigenVal(srcType, blockSize, ksize, borderType); + return makePtr(srcType, blockSize, ksize, borderType); } #endif /* !defined (HAVE_CUDA) */ diff --git a/modules/gpuimgproc/src/generalized_hough.cpp b/modules/gpuimgproc/src/generalized_hough.cpp index 6adfcb7a2..abcd3ef49 100644 --- a/modules/gpuimgproc/src/generalized_hough.cpp +++ b/modules/gpuimgproc/src/generalized_hough.cpp @@ -554,7 +554,7 @@ namespace Ptr cv::gpu::createGeneralizedHoughBallard() { - return new GeneralizedHoughBallardImpl; + return makePtr(); } // GeneralizedHoughGuil @@ -900,7 +900,7 @@ namespace Ptr cv::gpu::createGeneralizedHoughGuil() { - return new GeneralizedHoughGuilImpl; + return makePtr(); } #endif /* !defined (HAVE_CUDA) */ diff --git a/modules/gpuimgproc/src/gftt.cpp b/modules/gpuimgproc/src/gftt.cpp index ff197d84c..0446b6cdb 100644 --- a/modules/gpuimgproc/src/gftt.cpp +++ b/modules/gpuimgproc/src/gftt.cpp @@ -209,7 +209,8 @@ namespace Ptr cv::gpu::createGoodFeaturesToTrackDetector(int srcType, int maxCorners, double qualityLevel, double minDistance, int blockSize, bool useHarrisDetector, double harrisK) { - return new GoodFeaturesToTrackDetector(srcType, maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, harrisK); + return Ptr( + new GoodFeaturesToTrackDetector(srcType, maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, harrisK)); } #endif /* !defined (HAVE_CUDA) */ diff --git a/modules/gpuimgproc/src/histogram.cpp b/modules/gpuimgproc/src/histogram.cpp index 1baa89205..eb78ee0de 100644 --- a/modules/gpuimgproc/src/histogram.cpp +++ b/modules/gpuimgproc/src/histogram.cpp @@ -257,7 +257,7 @@ namespace cv::Ptr cv::gpu::createCLAHE(double clipLimit, cv::Size tileGridSize) { - return new CLAHE_Impl(clipLimit, tileGridSize.width, tileGridSize.height); + return makePtr(clipLimit, tileGridSize.width, tileGridSize.height); } //////////////////////////////////////////////////////////////////////// diff --git a/modules/gpuimgproc/src/hough_circles.cpp b/modules/gpuimgproc/src/hough_circles.cpp index fa583c09c..f123cf579 100644 --- a/modules/gpuimgproc/src/hough_circles.cpp +++ b/modules/gpuimgproc/src/hough_circles.cpp @@ -291,7 +291,7 @@ namespace Ptr cv::gpu::createHoughCirclesDetector(float dp, float minDist, int cannyThreshold, int votesThreshold, int minRadius, int maxRadius, int maxCircles) { - return new HoughCirclesDetectorImpl(dp, minDist, cannyThreshold, votesThreshold, minRadius, maxRadius, maxCircles); + return makePtr(dp, minDist, cannyThreshold, votesThreshold, minRadius, maxRadius, maxCircles); } #endif /* !defined (HAVE_CUDA) */ diff --git a/modules/gpuimgproc/src/hough_lines.cpp b/modules/gpuimgproc/src/hough_lines.cpp index e0dec305d..e3e03cba7 100644 --- a/modules/gpuimgproc/src/hough_lines.cpp +++ b/modules/gpuimgproc/src/hough_lines.cpp @@ -196,7 +196,7 @@ namespace Ptr cv::gpu::createHoughLinesDetector(float rho, float theta, int threshold, bool doSort, int maxLines) { - return new HoughLinesDetectorImpl(rho, theta, threshold, doSort, maxLines); + return makePtr(rho, theta, threshold, doSort, maxLines); } #endif /* !defined (HAVE_CUDA) */ diff --git a/modules/gpuimgproc/src/hough_segments.cpp b/modules/gpuimgproc/src/hough_segments.cpp index 1f11be68b..6f888a2c0 100644 --- a/modules/gpuimgproc/src/hough_segments.cpp +++ b/modules/gpuimgproc/src/hough_segments.cpp @@ -177,7 +177,7 @@ namespace Ptr cv::gpu::createHoughSegmentDetector(float rho, float theta, int minLineLength, int maxLineGap, int maxLines) { - return new HoughSegmentDetectorImpl(rho, theta, minLineLength, maxLineGap, maxLines); + return makePtr(rho, theta, minLineLength, maxLineGap, maxLines); } #endif /* !defined (HAVE_CUDA) */ diff --git a/modules/gpuimgproc/src/match_template.cpp b/modules/gpuimgproc/src/match_template.cpp index 2b5d5cb1c..aeebd01d9 100644 --- a/modules/gpuimgproc/src/match_template.cpp +++ b/modules/gpuimgproc/src/match_template.cpp @@ -607,10 +607,10 @@ Ptr cv::gpu::createTemplateMatching(int srcType, int meth switch (method) { case TM_SQDIFF: - return new Match_SQDIFF_32F; + return makePtr(); case TM_CCORR: - return new Match_CCORR_32F(user_block_size); + return makePtr(user_block_size); default: CV_Error( Error::StsBadFlag, "Unsopported method" ); @@ -622,22 +622,22 @@ Ptr cv::gpu::createTemplateMatching(int srcType, int meth switch (method) { case TM_SQDIFF: - return new Match_SQDIFF_8U(user_block_size); + return makePtr(user_block_size); case TM_SQDIFF_NORMED: - return new Match_SQDIFF_NORMED_8U(user_block_size); + return makePtr(user_block_size); case TM_CCORR: - return new Match_CCORR_8U(user_block_size); + return makePtr(user_block_size); case TM_CCORR_NORMED: - return new Match_CCORR_NORMED_8U(user_block_size); + return makePtr(user_block_size); case TM_CCOEFF: - return new Match_CCOEFF_8U(user_block_size); + return makePtr(user_block_size); case TM_CCOEFF_NORMED: - return new Match_CCOEFF_NORMED_8U(user_block_size); + return makePtr(user_block_size); default: CV_Error( Error::StsBadFlag, "Unsopported method" );