Commit e97dd57d authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

hopefully fixed test failures and complains from the doc builder

parent a760c454
......@@ -441,13 +441,10 @@ cv::Moments cv::moments( InputArray _src, bool binary )
int cn = CV_MAT_CN( type );
Size size = _src.size();
if( cn > 1 )
CV_Error( CV_StsBadArg, "Invalid image type (must be single-channel)" );
if( size.width <= 0 || size.height <= 0 )
return m;
if( ocl::useOpenCL() && depth == CV_8U && !binary &&
if( ocl::useOpenCL() && type == CV_8UC1 && !binary &&
_src.isUMat() && ocl_moments(_src, m) )
;
else
......@@ -456,6 +453,9 @@ cv::Moments cv::moments( InputArray _src, bool binary )
if( mat.checkVector(2) >= 0 && (depth == CV_32F || depth == CV_32S))
return contourMoments(mat);
if( cn > 1 )
CV_Error( CV_StsBadArg, "Invalid image type (must be single-channel)" );
if( binary || depth == CV_8U )
func = momentsInTile<uchar, int, int>;
else if( depth == CV_16U )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment