From c1f4fe1637aa1279d7eef7ef95f26ea92c9de967 Mon Sep 17 00:00:00 2001 From: peng xiao Date: Thu, 20 Jun 2013 11:26:22 +0800 Subject: [PATCH] Fix a bug of convertTo. The bug was found that all 3-channel oclMat's were converted to 4-channel oclMat's after using convertTo function. --- modules/ocl/src/matrix_operations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ocl/src/matrix_operations.cpp b/modules/ocl/src/matrix_operations.cpp index 268a1fe9b..172dfa5a8 100644 --- a/modules/ocl/src/matrix_operations.cpp +++ b/modules/ocl/src/matrix_operations.cpp @@ -394,7 +394,7 @@ void cv::ocl::oclMat::convertTo( oclMat &dst, int rtype, double alpha, double be if( rtype < 0 ) rtype = type(); else - rtype = CV_MAKETYPE(CV_MAT_DEPTH(rtype), oclchannels()); + rtype = CV_MAKETYPE(CV_MAT_DEPTH(rtype), channels()); //int scn = channels(); int sdepth = depth(), ddepth = CV_MAT_DEPTH(rtype);