diff --git a/modules/ocl/src/filtering.cpp b/modules/ocl/src/filtering.cpp index 713854299d..4c952b8372 100644 --- a/modules/ocl/src/filtering.cpp +++ b/modules/ocl/src/filtering.cpp @@ -163,7 +163,7 @@ public: Ptr cv::ocl::createFilter2D_GPU(const Ptr filter2D) { - return Ptr(new Filter2DEngine_GPU(filter2D)); + return makePtr(filter2D); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -452,7 +452,7 @@ Ptr cv::ocl::createMorphologyFilter_GPU(int op, int type, cons Ptr filter2D = getMorphologyFilter_GPU(op, type, kernel, ksize, anchor); - return Ptr(new MorphologyFilterEngine_GPU(filter2D, iterations)); + return makePtr(filter2D, iterations); } namespace @@ -690,8 +690,8 @@ Ptr cv::ocl::getLinearFilter_GPU(int srcType, int dstType, const normalizeKernel(kernel, gpu_krnl, CV_32FC1); normalizeAnchor(norm_archor, ksize); - return Ptr(new LinearFilter_GPU(ksize, anchor, gpu_krnl, GPUFilter2D_callers[CV_MAT_CN(srcType)], - borderType)); + return makePtr(ksize, anchor, gpu_krnl, GPUFilter2D_callers[CV_MAT_CN(srcType)], + borderType); } Ptr cv::ocl::createLinearFilter_GPU(int srcType, int dstType, const Mat &kernel, const Point &anchor, @@ -773,7 +773,7 @@ public: Ptr cv::ocl::createSeparableFilter_GPU(const Ptr &rowFilter, const Ptr &columnFilter) { - return Ptr(new SeparableFilterEngine_GPU(rowFilter, columnFilter)); + return makePtr(rowFilter, columnFilter); } /* @@ -1044,8 +1044,8 @@ Ptr cv::ocl::getBoxFilter_GPU(int srcType, int dstType, normalizeAnchor(anchor, ksize); - return Ptr(new GPUBoxFilter(ksize, anchor, - borderType, FilterBox_callers[(CV_MAT_DEPTH(srcType) == CV_32F)][CV_MAT_CN(srcType)])); + return makePtr(ksize, anchor, + borderType, FilterBox_callers[(CV_MAT_DEPTH(srcType) == CV_32F)][CV_MAT_CN(srcType)]); } Ptr cv::ocl::createBoxFilter_GPU(int srcType, int dstType, @@ -1228,8 +1228,8 @@ Ptr cv::ocl::getLinearRowFilter_GPU(int srcType, int /*bufTyp normalizeAnchor(anchor, ksize); - return Ptr(new GpuLinearRowFilter(ksize, anchor, mat_kernel, - gpuFilter1D_callers[CV_MAT_DEPTH(srcType)], bordertype)); + return makePtr(ksize, anchor, mat_kernel, + gpuFilter1D_callers[CV_MAT_DEPTH(srcType)], bordertype); } namespace @@ -1397,8 +1397,8 @@ Ptr cv::ocl::getLinearColumnFilter_GPU(int /*bufType*/, in normalizeAnchor(anchor, ksize); - return Ptr(new GpuLinearColumnFilter(ksize, anchor, mat_kernel, - gpuFilter1D_callers[CV_MAT_DEPTH(dstType)], bordertype)); + return makePtr(ksize, anchor, mat_kernel, + gpuFilter1D_callers[CV_MAT_DEPTH(dstType)], bordertype); } Ptr cv::ocl::createSeparableLinearFilter_GPU(int srcType, int dstType, diff --git a/modules/ocl/src/imgproc.cpp b/modules/ocl/src/imgproc.cpp index 143e0e8a91..0dc7fe9cea 100644 --- a/modules/ocl/src/imgproc.cpp +++ b/modules/ocl/src/imgproc.cpp @@ -1692,7 +1692,7 @@ namespace cv cv::Ptr createCLAHE(double clipLimit, cv::Size tileGridSize) { - return new CLAHE_Impl(clipLimit, tileGridSize.width, tileGridSize.height); + return makePtr(clipLimit, tileGridSize.width, tileGridSize.height); } //////////////////////////////////bilateralFilter//////////////////////////////////////////////////// diff --git a/modules/ocl/src/mcwutil.cpp b/modules/ocl/src/mcwutil.cpp index 612165165c..c520cb8d48 100644 --- a/modules/ocl/src/mcwutil.cpp +++ b/modules/ocl/src/mcwutil.cpp @@ -246,7 +246,7 @@ namespace cv Ptr bindTexturePtr(const oclMat &mat) { - return Ptr(new TextureCL(bindTexture(mat), mat.rows, mat.cols, mat.type())); + return makePtr(bindTexture(mat), mat.rows, mat.cols, mat.type()); } void releaseTexture(cl_mem& texture) {