mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Partially back-port #25075 to 4.x
This commit is contained in:
@@ -389,9 +389,9 @@ cvApproxChains( CvSeq* src_seq,
|
||||
CvSeq *dst_seq = 0;
|
||||
|
||||
if( !src_seq || !storage )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
if( method > cv::CHAIN_APPROX_TC89_KCOS || method <= 0 || minimal_perimeter < 0 )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
while( src_seq != 0 )
|
||||
{
|
||||
@@ -410,7 +410,7 @@ cvApproxChains( CvSeq* src_seq,
|
||||
contour = icvApproximateChainTC89( (CvChain *) src_seq, sizeof( CvContour ), storage, method );
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
}
|
||||
|
||||
if( contour->total > 0 )
|
||||
@@ -681,7 +681,7 @@ void cv::approxPolyDP( InputArray _curve, OutputArray _approxCurve,
|
||||
//from being used.
|
||||
if (epsilon < 0.0 || !(epsilon < 1e30))
|
||||
{
|
||||
CV_Error(CV_StsOutOfRange, "Epsilon not valid.");
|
||||
CV_Error(cv::Error::StsOutOfRange, "Epsilon not valid.");
|
||||
}
|
||||
|
||||
Mat curve = _curve.getMat();
|
||||
@@ -704,7 +704,7 @@ void cv::approxPolyDP( InputArray _curve, OutputArray _approxCurve,
|
||||
else if( depth == CV_32F )
|
||||
nout = approxPolyDP_(curve.ptr<Point2f>(), npoints, (Point2f*)buf, closed, epsilon, _stack);
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
Mat(nout, 1, CV_MAKETYPE(depth, 2), buf).copyTo(_approxCurve);
|
||||
}
|
||||
@@ -728,7 +728,7 @@ cvApproxPoly( const void* array, int header_size,
|
||||
{
|
||||
src_seq = (CvSeq*)array;
|
||||
if( !CV_IS_SEQ_POLYLINE( src_seq ))
|
||||
CV_Error( CV_StsBadArg, "Unsupported sequence type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unsupported sequence type" );
|
||||
|
||||
recursive = parameter2;
|
||||
|
||||
@@ -743,10 +743,10 @@ cvApproxPoly( const void* array, int header_size,
|
||||
}
|
||||
|
||||
if( !storage )
|
||||
CV_Error( CV_StsNullPtr, "NULL storage pointer " );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL storage pointer " );
|
||||
|
||||
if( header_size < 0 )
|
||||
CV_Error( CV_StsOutOfRange, "header_size is negative. "
|
||||
CV_Error( cv::Error::StsOutOfRange, "header_size is negative. "
|
||||
"Pass 0 to make the destination header_size == input header_size" );
|
||||
|
||||
if( header_size == 0 )
|
||||
@@ -756,12 +756,12 @@ cvApproxPoly( const void* array, int header_size,
|
||||
{
|
||||
if( CV_IS_SEQ_CHAIN( src_seq ))
|
||||
{
|
||||
CV_Error( CV_StsBadArg, "Input curves are not polygonal. "
|
||||
CV_Error( cv::Error::StsBadArg, "Input curves are not polygonal. "
|
||||
"Use cvApproxChains first" );
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error( CV_StsBadArg, "Input curves have unknown type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Input curves have unknown type" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,10 +769,10 @@ cvApproxPoly( const void* array, int header_size,
|
||||
header_size = src_seq->header_size;
|
||||
|
||||
if( header_size < (int)sizeof(CvContour) )
|
||||
CV_Error( CV_StsBadSize, "New header size must be non-less than sizeof(CvContour)" );
|
||||
CV_Error( cv::Error::StsBadSize, "New header size must be non-less than sizeof(CvContour)" );
|
||||
|
||||
if( method != CV_POLY_APPROX_DP )
|
||||
CV_Error( CV_StsOutOfRange, "Unknown approximation method" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "Unknown approximation method" );
|
||||
|
||||
while( src_seq != 0 )
|
||||
{
|
||||
@@ -782,7 +782,7 @@ cvApproxPoly( const void* array, int header_size,
|
||||
{
|
||||
case CV_POLY_APPROX_DP:
|
||||
if( parameter < 0 )
|
||||
CV_Error( CV_StsOutOfRange, "Accuracy must be non-negative" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "Accuracy must be non-negative" );
|
||||
|
||||
CV_Assert( CV_SEQ_ELTYPE(src_seq) == CV_32SC2 ||
|
||||
CV_SEQ_ELTYPE(src_seq) == CV_32FC2 );
|
||||
@@ -804,7 +804,7 @@ cvApproxPoly( const void* array, int header_size,
|
||||
nout = cv::approxPolyDP_((cv::Point2f*)src, npoints,
|
||||
(cv::Point2f*)dst, closed, parameter, stack);
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
contour = cvCreateSeq( src_seq->flags, header_size,
|
||||
src_seq->elem_size, storage );
|
||||
@@ -812,7 +812,7 @@ cvApproxPoly( const void* array, int header_size,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "Invalid approximation method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid approximation method" );
|
||||
}
|
||||
|
||||
CV_Assert( contour );
|
||||
|
||||
@@ -422,7 +422,7 @@ void bilateralFilter( InputArray _src, OutputArray _dst, int d,
|
||||
else if( src.depth() == CV_32F )
|
||||
bilateralFilter_32f( src, dst, d, sigmaColor, sigmaSpace, borderType );
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"Bilateral filtering is only implemented for 8u and 32f images" );
|
||||
}
|
||||
|
||||
|
||||
@@ -1200,7 +1200,7 @@ Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType, int ksize, int anch
|
||||
if( sdepth == CV_64F && ddepth == CV_64F )
|
||||
return makePtr<RowSum<double, double> >(ksize, anchor);
|
||||
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
CV_Error_( cv::Error::StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and buffer format (=%d)",
|
||||
srcType, sumType));
|
||||
}
|
||||
@@ -1241,7 +1241,7 @@ Ptr<BaseColumnFilter> getColumnSumFilter(int sumType, int dstType, int ksize, in
|
||||
if( ddepth == CV_64F && sdepth == CV_64F )
|
||||
return makePtr<ColumnSum<double, double> >(ksize, anchor, scale);
|
||||
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
CV_Error_( cv::Error::StsNotImplemented,
|
||||
("Unsupported combination of sum format (=%d), and destination format (=%d)",
|
||||
sumType, dstType));
|
||||
}
|
||||
@@ -1339,7 +1339,7 @@ Ptr<BaseRowFilter> getSqrRowSumFilter(int srcType, int sumType, int ksize, int a
|
||||
if( sdepth == CV_64F && ddepth == CV_64F )
|
||||
return makePtr<SqrRowSum<double, double> >(ksize, anchor);
|
||||
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
CV_Error_( cv::Error::StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and buffer format (=%d)",
|
||||
srcType, sumType));
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ void Canny( InputArray _src, OutputArray _dst,
|
||||
}
|
||||
|
||||
if ((aperture_size & 1) == 0 || (aperture_size != -1 && (aperture_size < 3 || aperture_size > 7)))
|
||||
CV_Error(CV_StsBadFlag, "Aperture size should be odd between 3 and 7");
|
||||
CV_Error(cv::Error::StsBadFlag, "Aperture size should be odd between 3 and 7");
|
||||
|
||||
if (aperture_size == 7)
|
||||
{
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace
|
||||
else if (_src.type() == CV_16UC1)
|
||||
calcLutBody = cv::makePtr<CLAHE_CalcLut_Body<ushort, 65536, 0> >(srcForLut, lut_, tileSize, tilesX_, clipLimit, lutScale);
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unsupported type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unsupported type" );
|
||||
|
||||
cv::parallel_for_(cv::Range(0, tilesX_ * tilesY_), *calcLutBody);
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ void cvtColorTwoPlane( InputArray _ysrc, InputArray _uvsrc, OutputArray _dst, in
|
||||
case COLOR_YUV2BGRA_NV21: case COLOR_YUV2RGBA_NV21: case COLOR_YUV2BGRA_NV12: case COLOR_YUV2RGBA_NV12:
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadFlag, "Unknown/unsupported color conversion code" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported color conversion code" );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ void cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
|
||||
cvtColormRGBA2RGBA(_src, _dst);
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadFlag, "Unknown/unsupported color conversion code" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported color conversion code" );
|
||||
}
|
||||
}
|
||||
} //namespace cv
|
||||
|
||||
@@ -2029,7 +2029,7 @@ void cvtTwoPlaneYUVtoBGR(const uchar * y_data, size_t y_step, const uchar * uv_d
|
||||
case 401: cvtPtr = cvtYUV420sp2RGB<0, 1, 4>; break;
|
||||
case 420: cvtPtr = cvtYUV420sp2RGB<2, 0, 4>; break;
|
||||
case 421: cvtPtr = cvtYUV420sp2RGB<2, 1, 4>; break;
|
||||
default: CV_Error( CV_StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
default: CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
};
|
||||
|
||||
cvtPtr(dst_data, dst_step, dst_width, dst_height, y_data, y_step, uv_data, uv_step);
|
||||
@@ -2069,7 +2069,7 @@ void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||
case 32: cvtPtr = cvtYUV420p2RGB<2, 3>; break;
|
||||
case 40: cvtPtr = cvtYUV420p2RGB<0, 4>; break;
|
||||
case 42: cvtPtr = cvtYUV420p2RGB<2, 4>; break;
|
||||
default: CV_Error( CV_StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
default: CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
};
|
||||
|
||||
cvtPtr(dst_data, dst_step, dst_width, dst_height, src_step, src_data, u, v, ustepIdx, vstepIdx);
|
||||
@@ -2139,7 +2139,7 @@ void cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||
case 4200: cvtPtr = cvtYUV422toRGB<2,0,0,4>; break;
|
||||
case 4201: cvtPtr = cvtYUV422toRGB<2,0,1,4>; break;
|
||||
case 4210: cvtPtr = cvtYUV422toRGB<2,1,0,4>; break;
|
||||
default: CV_Error( CV_StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
default: CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
};
|
||||
|
||||
cvtPtr(dst_data, dst_step, src_data, src_step, width, height);
|
||||
@@ -2168,7 +2168,7 @@ void cvtOnePlaneBGRtoYUV(const uchar * src_data, size_t src_step,
|
||||
case 4200: cvtPtr = cvtRGBtoYUV422<2,0,0,4>; break;
|
||||
case 4201: cvtPtr = cvtRGBtoYUV422<2,0,1,4>; break;
|
||||
case 4210: cvtPtr = cvtRGBtoYUV422<2,1,0,4>; break;
|
||||
default: CV_Error( CV_StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
default: CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported color conversion code" ); break;
|
||||
};
|
||||
|
||||
cvtPtr(dst_data, dst_step, src_data, src_step, width, height);
|
||||
|
||||
@@ -5716,7 +5716,7 @@ namespace cv{
|
||||
}
|
||||
}
|
||||
|
||||
CV_Error(CV_StsUnsupportedFormat, "unsupported label/image type");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "unsupported label/image type");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5738,7 +5738,7 @@ int cv::connectedComponents(InputArray img_, OutputArray _labels, int connectivi
|
||||
return connectedComponents_sub1(img, labels, connectivity, ccltype, sop);
|
||||
}
|
||||
else{
|
||||
CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "the type of labels must be 16u or 32s");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5763,7 +5763,7 @@ int cv::connectedComponentsWithStats(InputArray img_, OutputArray _labels, Outpu
|
||||
return connectedComponents_sub1(img, labels, connectivity, ccltype, sop);
|
||||
}
|
||||
else{
|
||||
CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "the type of labels must be 16u or 32s");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ cvStartReadChainPoints( CvChain * chain, CvChainPtReader * reader )
|
||||
int i;
|
||||
|
||||
if( !chain || !reader )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( chain->elem_size != 1 || chain->header_size < (int)sizeof(CvChain))
|
||||
CV_Error( CV_StsBadSize, "" );
|
||||
CV_Error( cv::Error::StsBadSize, "" );
|
||||
|
||||
cvStartReadSeq( (CvSeq *) chain, (CvSeqReader *) reader, 0 );
|
||||
|
||||
@@ -80,7 +80,7 @@ CV_IMPL CvPoint
|
||||
cvReadChainPoint( CvChainPtReader * reader )
|
||||
{
|
||||
if( !reader )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
cv::Point2i pt = reader->pt;
|
||||
|
||||
@@ -180,7 +180,7 @@ cvStartFindContours_Impl( void* _img, CvMemStorage* storage,
|
||||
int method, CvPoint offset, int needFillBorder )
|
||||
{
|
||||
if( !storage )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
CvMat stub, *mat = cvGetMat( _img, &stub );
|
||||
|
||||
@@ -189,7 +189,7 @@ cvStartFindContours_Impl( void* _img, CvMemStorage* storage,
|
||||
|
||||
if( !((CV_IS_MASK_ARR( mat ) && mode < CV_RETR_FLOODFILL) ||
|
||||
(CV_MAT_TYPE(mat->type) == CV_32SC1 && mode == CV_RETR_FLOODFILL)) )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"[Start]FindContours supports only CV_8UC1 images when mode != CV_RETR_FLOODFILL "
|
||||
"otherwise supports CV_32SC1 images only" );
|
||||
|
||||
@@ -198,10 +198,10 @@ cvStartFindContours_Impl( void* _img, CvMemStorage* storage,
|
||||
uchar* img = (uchar*)(mat->data.ptr);
|
||||
|
||||
if( method < 0 || method > CV_CHAIN_APPROX_TC89_KCOS )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
if( header_size < (int) (method == CV_CHAIN_CODE ? sizeof( CvChain ) : sizeof( CvContour )))
|
||||
CV_Error( CV_StsBadSize, "" );
|
||||
CV_Error( cv::Error::StsBadSize, "" );
|
||||
|
||||
CvContourScanner scanner = (CvContourScanner)cvAlloc( sizeof( *scanner ));
|
||||
memset( scanner, 0, sizeof(*scanner) );
|
||||
@@ -487,7 +487,7 @@ cvSubstituteContour( CvContourScanner scanner, CvSeq * new_contour )
|
||||
_CvContourInfo *l_cinfo;
|
||||
|
||||
if( !scanner )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
l_cinfo = scanner->l_cinfo;
|
||||
if( l_cinfo && l_cinfo->contour && l_cinfo->contour != new_contour )
|
||||
@@ -1029,7 +1029,7 @@ CvSeq *
|
||||
cvFindNextContour( CvContourScanner scanner )
|
||||
{
|
||||
if( !scanner )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
CV_Assert(scanner->img_step >= 0);
|
||||
|
||||
@@ -1313,7 +1313,7 @@ cvEndFindContours( CvContourScanner * _scanner )
|
||||
CvSeq *first = 0;
|
||||
|
||||
if( !_scanner )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
scanner = *_scanner;
|
||||
|
||||
if( scanner )
|
||||
@@ -1438,13 +1438,13 @@ icvFindContoursInInterval( const CvArr* src,
|
||||
CvSeq* prev = 0;
|
||||
|
||||
if( !storage )
|
||||
CV_Error( CV_StsNullPtr, "NULL storage pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL storage pointer" );
|
||||
|
||||
if( !result )
|
||||
CV_Error( CV_StsNullPtr, "NULL double CvSeq pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL double CvSeq pointer" );
|
||||
|
||||
if( contourHeaderSize < (int)sizeof(CvContour))
|
||||
CV_Error( CV_StsBadSize, "Contour header size must be >= sizeof(CvContour)" );
|
||||
CV_Error( cv::Error::StsBadSize, "Contour header size must be >= sizeof(CvContour)" );
|
||||
|
||||
storage00.reset(cvCreateChildMemStorage(storage));
|
||||
storage01.reset(cvCreateChildMemStorage(storage));
|
||||
@@ -1453,7 +1453,7 @@ icvFindContoursInInterval( const CvArr* src,
|
||||
|
||||
mat = cvGetMat( src, &stub );
|
||||
if( !CV_IS_MASK_ARR(mat))
|
||||
CV_Error( CV_StsBadArg, "Input array must be 8uC1 or 8sC1" );
|
||||
CV_Error( cv::Error::StsBadArg, "Input array must be 8uC1 or 8sC1" );
|
||||
src_data = mat->data.ptr;
|
||||
img_step = mat->step;
|
||||
img_size = cvGetMatSize(mat);
|
||||
@@ -1745,14 +1745,14 @@ cvFindContours_Impl( void* img, CvMemStorage* storage,
|
||||
int count = -1;
|
||||
|
||||
if( !firstContour )
|
||||
CV_Error( CV_StsNullPtr, "NULL double CvSeq pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL double CvSeq pointer" );
|
||||
|
||||
*firstContour = 0;
|
||||
|
||||
if( method == CV_LINK_RUNS )
|
||||
{
|
||||
if( offset.x != 0 || offset.y != 0 )
|
||||
CV_Error( CV_StsOutOfRange,
|
||||
CV_Error( cv::Error::StsOutOfRange,
|
||||
"Nonzero offset is not supported in CV_LINK_RUNS yet" );
|
||||
|
||||
count = icvFindContoursInInterval( img, storage, firstContour, cntHeaderSize );
|
||||
|
||||
@@ -471,7 +471,7 @@ cvConvexHull2( const CvArr* array, void* hull_storage,
|
||||
{
|
||||
ptseq = (CvSeq*)array;
|
||||
if( !CV_IS_SEQ_POINT_SET( ptseq ))
|
||||
CV_Error( CV_StsBadArg, "Unsupported sequence type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unsupported sequence type" );
|
||||
if( hull_storage == 0 )
|
||||
hull_storage = ptseq->storage;
|
||||
}
|
||||
@@ -503,15 +503,15 @@ cvConvexHull2( const CvArr* array, void* hull_storage,
|
||||
mat = (CvMat*)hull_storage;
|
||||
|
||||
if( (mat->cols != 1 && mat->rows != 1) || !CV_IS_MAT_CONT(mat->type))
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"The hull matrix should be continuous and have a single row or a single column" );
|
||||
|
||||
if( mat->cols + mat->rows - 1 < ptseq->total )
|
||||
CV_Error( CV_StsBadSize, "The hull matrix size might be not enough to fit the hull" );
|
||||
CV_Error( cv::Error::StsBadSize, "The hull matrix size might be not enough to fit the hull" );
|
||||
|
||||
if( CV_MAT_TYPE(mat->type) != CV_SEQ_ELTYPE(ptseq) &&
|
||||
CV_MAT_TYPE(mat->type) != CV_32SC1 )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"The hull matrix must have the same type as input or 32sC1 (integers)" );
|
||||
|
||||
hullseq = cvMakeSeqHeaderForArray(
|
||||
@@ -526,7 +526,7 @@ cvConvexHull2( const CvArr* array, void* hull_storage,
|
||||
if( total == 0 )
|
||||
{
|
||||
if( !isStorage )
|
||||
CV_Error( CV_StsBadSize,
|
||||
CV_Error( cv::Error::StsBadSize,
|
||||
"Point sequence can not be empty if the output is matrix" );
|
||||
return 0;
|
||||
}
|
||||
@@ -592,7 +592,7 @@ CV_IMPL CvSeq* cvConvexityDefects( const CvArr* array,
|
||||
if( CV_IS_SEQ( ptseq ))
|
||||
{
|
||||
if( !CV_IS_SEQ_POINT_SET( ptseq ))
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"Input sequence is not a sequence of points" );
|
||||
if( !storage )
|
||||
storage = ptseq->storage;
|
||||
@@ -603,13 +603,13 @@ CV_IMPL CvSeq* cvConvexityDefects( const CvArr* array,
|
||||
}
|
||||
|
||||
if( CV_SEQ_ELTYPE( ptseq ) != CV_32SC2 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "Floating-point coordinates are not supported here" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "Floating-point coordinates are not supported here" );
|
||||
|
||||
if( CV_IS_SEQ( hull ))
|
||||
{
|
||||
int hulltype = CV_SEQ_ELTYPE( hull );
|
||||
if( hulltype != CV_SEQ_ELTYPE_PPOINT && hulltype != CV_SEQ_ELTYPE_INDEX )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"Convex hull must represented as a sequence "
|
||||
"of indices or sequence of pointers" );
|
||||
if( !storage )
|
||||
@@ -620,15 +620,15 @@ CV_IMPL CvSeq* cvConvexityDefects( const CvArr* array,
|
||||
CvMat* mat = (CvMat*)hull;
|
||||
|
||||
if( !CV_IS_MAT( hull ))
|
||||
CV_Error(CV_StsBadArg, "Convex hull is neither sequence nor matrix");
|
||||
CV_Error(cv::Error::StsBadArg, "Convex hull is neither sequence nor matrix");
|
||||
|
||||
if( (mat->cols != 1 && mat->rows != 1) ||
|
||||
!CV_IS_MAT_CONT(mat->type) || CV_MAT_TYPE(mat->type) != CV_32SC1 )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"The matrix should be 1-dimensional and continuous array of int's" );
|
||||
|
||||
if( mat->cols + mat->rows - 1 > ptseq->total )
|
||||
CV_Error( CV_StsBadSize, "Convex hull is larger than the point sequence" );
|
||||
CV_Error( cv::Error::StsBadSize, "Convex hull is larger than the point sequence" );
|
||||
|
||||
hull = cvMakeSeqHeaderForArray(
|
||||
CV_SEQ_KIND_CURVE|CV_MAT_TYPE(mat->type)|CV_SEQ_FLAG_CLOSED,
|
||||
@@ -639,13 +639,13 @@ CV_IMPL CvSeq* cvConvexityDefects( const CvArr* array,
|
||||
is_index = CV_SEQ_ELTYPE(hull) == CV_SEQ_ELTYPE_INDEX;
|
||||
|
||||
if( !storage )
|
||||
CV_Error( CV_StsNullPtr, "NULL storage pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL storage pointer" );
|
||||
|
||||
defects = cvCreateSeq( CV_SEQ_KIND_GENERIC, sizeof(CvSeq), sizeof(CvConvexityDefect), storage );
|
||||
|
||||
if( ptseq->total < 4 || hull->total < 3)
|
||||
{
|
||||
//CV_ERROR( CV_StsBadSize,
|
||||
//CV_ERROR( cv::Error::StsBadSize,
|
||||
// "point seq size must be >= 4, convex hull size must be >= 3" );
|
||||
return defects;
|
||||
}
|
||||
@@ -779,7 +779,7 @@ cvCheckContourConvexity( const CvArr* array )
|
||||
if( CV_IS_SEQ(contour) )
|
||||
{
|
||||
if( !CV_IS_SEQ_POINT_SET(contour))
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"Input sequence must be polygon (closed 2d curve)" );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1708,7 +1708,7 @@ void cv::demosaicing(InputArray _src, OutputArray _dst, int code, int dcn)
|
||||
else if( depth == CV_16U )
|
||||
Bayer2Gray_<ushort, SIMDBayerStubInterpolator_<ushort> >(src, dst, code);
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "Bayer->Gray demosaicing only supports 8u and 16u types");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "Bayer->Gray demosaicing only supports 8u and 16u types");
|
||||
break;
|
||||
|
||||
case COLOR_BayerBG2BGRA: case COLOR_BayerGB2BGRA: case COLOR_BayerRG2BGRA: case COLOR_BayerGR2BGRA:
|
||||
@@ -1735,7 +1735,7 @@ void cv::demosaicing(InputArray _src, OutputArray _dst, int code, int dcn)
|
||||
else if( depth == CV_16U )
|
||||
Bayer2RGB_<ushort, SIMDBayerStubInterpolator_<ushort> >(src, dst_, code);
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "Bayer->RGB demosaicing only supports 8u and 16u types");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "Bayer->RGB demosaicing only supports 8u and 16u types");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1758,11 +1758,11 @@ void cv::demosaicing(InputArray _src, OutputArray _dst, int code, int dcn)
|
||||
else if (depth == CV_16U)
|
||||
Bayer2RGB_EdgeAware_T<ushort, SIMDBayerStubInterpolator_<ushort> >(src, dst, code);
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "Bayer->RGB Edge-Aware demosaicing only currently supports 8u and 16u types");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "Bayer->RGB Edge-Aware demosaicing only currently supports 8u and 16u types");
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
CV_Error( CV_StsBadFlag, "Unknown / unsupported color conversion code" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Unknown / unsupported color conversion code" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ static void getSobelKernels( OutputArray _kx, OutputArray _ky,
|
||||
Mat ky = _ky.getMat();
|
||||
|
||||
if( _ksize % 2 == 0 || _ksize > 31 )
|
||||
CV_Error( CV_StsOutOfRange, "The kernel size must be odd and not larger than 31" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The kernel size must be odd and not larger than 31" );
|
||||
std::vector<int> kerI(std::max(ksizeX, ksizeY) + 1);
|
||||
|
||||
CV_Assert( dx >= 0 && dy >= 0 && dx+dy > 0 );
|
||||
|
||||
@@ -448,7 +448,7 @@ static void getDistanceTransformMask( int maskType, float *metrics )
|
||||
metrics[2] = 2.1969f;
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsBadArg, "Unknown metric type");
|
||||
CV_Error(cv::Error::StsBadArg, "Unknown metric type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,7 +766,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
|
||||
float _mask[5] = {0};
|
||||
|
||||
if( maskSize != cv::DIST_MASK_3 && maskSize != cv::DIST_MASK_5 && maskSize != cv::DIST_MASK_PRECISE )
|
||||
CV_Error( CV_StsBadSize, "Mask size should be 3 or 5 or 0 (precise)" );
|
||||
CV_Error( cv::Error::StsBadSize, "Mask size should be 3 or 5 or 0 (precise)" );
|
||||
|
||||
if ((distType == cv::DIST_C || distType == cv::DIST_L1) && !need_labels)
|
||||
maskSize = cv::DIST_MASK_3;
|
||||
|
||||
@@ -2239,7 +2239,7 @@ static const int* getFontData(int fontFace)
|
||||
ascii = HersheyScriptComplex;
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsOutOfRange, "Unknown font type" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "Unknown font type" );
|
||||
}
|
||||
return ascii;
|
||||
}
|
||||
|
||||
+18
-18
@@ -174,28 +174,28 @@ CV_IMPL float cvCalcEMD2( const CvArr* signature_arr1,
|
||||
signature2 = cvGetMat( signature2, &sign_stub2 );
|
||||
|
||||
if( signature1->cols != signature2->cols )
|
||||
CV_Error( CV_StsUnmatchedSizes, "The arrays must have equal number of columns (which is number of dimensions but 1)" );
|
||||
CV_Error( cv::Error::StsUnmatchedSizes, "The arrays must have equal number of columns (which is number of dimensions but 1)" );
|
||||
|
||||
dims = signature1->cols - 1;
|
||||
size1 = signature1->rows;
|
||||
size2 = signature2->rows;
|
||||
|
||||
if( !CV_ARE_TYPES_EQ( signature1, signature2 ))
|
||||
CV_Error( CV_StsUnmatchedFormats, "The array must have equal types" );
|
||||
CV_Error( cv::Error::StsUnmatchedFormats, "The array must have equal types" );
|
||||
|
||||
if( CV_MAT_TYPE( signature1->type ) != CV_32FC1 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "The signatures must be 32fC1" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "The signatures must be 32fC1" );
|
||||
|
||||
if( flow )
|
||||
{
|
||||
flow = cvGetMat( flow, &flow_stub );
|
||||
|
||||
if( flow->rows != size1 || flow->cols != size2 )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The flow matrix size does not match to the signatures' sizes" );
|
||||
|
||||
if( CV_MAT_TYPE( flow->type ) != CV_32FC1 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "The flow matrix must be 32fC1" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "The flow matrix must be 32fC1" );
|
||||
}
|
||||
|
||||
cost->data.fl = 0;
|
||||
@@ -206,28 +206,28 @@ CV_IMPL float cvCalcEMD2( const CvArr* signature_arr1,
|
||||
if( cost_matrix )
|
||||
{
|
||||
if( dist_func )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"Only one of cost matrix or distance function should be non-NULL in case of user-defined distance" );
|
||||
|
||||
if( lower_bound )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"The lower boundary can not be calculated if the cost matrix is used" );
|
||||
|
||||
cost = cvGetMat( cost_matrix, &cost_stub );
|
||||
if( cost->rows != size1 || cost->cols != size2 )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The cost matrix size does not match to the signatures' sizes" );
|
||||
|
||||
if( CV_MAT_TYPE( cost->type ) != CV_32FC1 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "The cost matrix must be 32fC1" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "The cost matrix must be 32fC1" );
|
||||
}
|
||||
else if( !dist_func )
|
||||
CV_Error( CV_StsNullPtr, "In case of user-defined distance Distance function is undefined" );
|
||||
CV_Error( cv::Error::StsNullPtr, "In case of user-defined distance Distance function is undefined" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( dims == 0 )
|
||||
CV_Error( CV_StsBadSize,
|
||||
CV_Error( cv::Error::StsBadSize,
|
||||
"Number of dimensions can be 0 only if a user-defined metric is used" );
|
||||
user_param = (void *) (size_t)dims;
|
||||
switch (dist_type)
|
||||
@@ -242,7 +242,7 @@ CV_IMPL float cvCalcEMD2( const CvArr* signature_arr1,
|
||||
dist_func = icvDistC;
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadFlag, "Bad or unsupported metric type" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Bad or unsupported metric type" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ CV_IMPL float cvCalcEMD2( const CvArr* signature_arr1,
|
||||
state.ssize, state.dsize, state.enter_x );
|
||||
|
||||
if( min_delta == CV_EMD_INF )
|
||||
CV_Error( CV_StsNoConv, "" );
|
||||
CV_Error( cv::Error::StsNoConv, "" );
|
||||
|
||||
/* if no negative deltamin, we found the optimal solution */
|
||||
if( min_delta >= -eps )
|
||||
@@ -287,7 +287,7 @@ CV_IMPL float cvCalcEMD2( const CvArr* signature_arr1,
|
||||
|
||||
/* improve solution */
|
||||
if(!icvNewSolution( &state ))
|
||||
CV_Error( CV_StsNoConv, "" );
|
||||
CV_Error( cv::Error::StsNoConv, "" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ static int icvInitEMD( const float* signature1, int size1,
|
||||
|
||||
}
|
||||
else if( weight < 0 )
|
||||
CV_Error(CV_StsBadArg, "signature1 must not contain negative weights");
|
||||
CV_Error(cv::Error::StsBadArg, "signature1 must not contain negative weights");
|
||||
}
|
||||
|
||||
for( i = 0; i < size2; i++ )
|
||||
@@ -401,13 +401,13 @@ static int icvInitEMD( const float* signature1, int size1,
|
||||
state->idx2[dsize++] = i;
|
||||
}
|
||||
else if( weight < 0 )
|
||||
CV_Error(CV_StsBadArg, "signature2 must not contain negative weights");
|
||||
CV_Error(cv::Error::StsBadArg, "signature2 must not contain negative weights");
|
||||
}
|
||||
|
||||
if( ssize == 0 )
|
||||
CV_Error(CV_StsBadArg, "signature1 must contain at least one non-zero value");
|
||||
CV_Error(cv::Error::StsBadArg, "signature1 must contain at least one non-zero value");
|
||||
if( dsize == 0 )
|
||||
CV_Error(CV_StsBadArg, "signature2 must contain at least one non-zero value");
|
||||
CV_Error(cv::Error::StsBadArg, "signature2 must contain at least one non-zero value");
|
||||
|
||||
/* if supply different than the demand, add a zero-cost dummy cluster */
|
||||
diff = s_sum - d_sum;
|
||||
|
||||
@@ -3039,7 +3039,7 @@ Ptr<BaseRowFilter> getLinearRowFilter(
|
||||
if( sdepth == CV_64F && ddepth == CV_64F )
|
||||
return makePtr<RowFilter<double, double, RowNoVec> >(kernel, anchor);
|
||||
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
CV_Error_( cv::Error::StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and buffer format (=%d)",
|
||||
srcType, bufType));
|
||||
}
|
||||
@@ -3137,7 +3137,7 @@ Ptr<BaseColumnFilter> getLinearColumnFilter(
|
||||
(kernel, anchor, delta, symmetryType);
|
||||
}
|
||||
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
CV_Error_( cv::Error::StsNotImplemented,
|
||||
("Unsupported combination of buffer format (=%d), and destination format (=%d)",
|
||||
bufType, dstType));
|
||||
}
|
||||
@@ -3291,7 +3291,7 @@ Ptr<BaseFilter> getLinearFilter(
|
||||
return makePtr<Filter2D<double,
|
||||
Cast<double, double>, FilterNoVec> >(kernel, anchor, delta);
|
||||
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
CV_Error_( cv::Error::StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and destination format (=%d)",
|
||||
srcType, dstType));
|
||||
}
|
||||
|
||||
@@ -487,12 +487,12 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
|
||||
|
||||
if ( (cn != 1) && (cn != 3) )
|
||||
{
|
||||
CV_Error( CV_StsBadArg, "Number of channels in input image must be 1 or 3" );
|
||||
CV_Error( cv::Error::StsBadArg, "Number of channels in input image must be 1 or 3" );
|
||||
}
|
||||
|
||||
const int connectivity = flags & 255;
|
||||
if( connectivity != 0 && connectivity != 4 && connectivity != 8 )
|
||||
CV_Error( CV_StsBadFlag, "Connectivity must be 4, 0(=4) or 8" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Connectivity must be 4, 0(=4) or 8" );
|
||||
|
||||
if( _mask.empty() )
|
||||
{
|
||||
@@ -513,13 +513,13 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
|
||||
for( i = 0; i < cn; i++ )
|
||||
{
|
||||
if( loDiff[i] < 0 || upDiff[i] < 0 )
|
||||
CV_Error( CV_StsBadArg, "lo_diff and up_diff must be non-negative" );
|
||||
CV_Error( cv::Error::StsBadArg, "lo_diff and up_diff must be non-negative" );
|
||||
is_simple = is_simple && fabs(loDiff[i]) < DBL_EPSILON && fabs(upDiff[i]) < DBL_EPSILON;
|
||||
}
|
||||
|
||||
if( (unsigned)seedPoint.x >= (unsigned)size.width ||
|
||||
(unsigned)seedPoint.y >= (unsigned)size.height )
|
||||
CV_Error( CV_StsOutOfRange, "Seed point is outside of image" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "Seed point is outside of image" );
|
||||
|
||||
scalarToRawData( newVal, &nv_buf, type, 0);
|
||||
size_t buffer_size = MAX( size.width, size.height ) * 2;
|
||||
@@ -550,7 +550,7 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
|
||||
else if( type == CV_32FC3 )
|
||||
floodFill_CnIR(img, seedPoint, Vec3f(nv_buf.f), &comp, flags, &buffer);
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
if( rect )
|
||||
*rect = comp.rect;
|
||||
return comp.area;
|
||||
@@ -583,7 +583,7 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
|
||||
ud_buf.f[i] = (float)upDiff[i];
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
uchar newMaskVal = (uchar)((flags & 0xff00) == 0 ? 1 : ((flags >> 8) & 255));
|
||||
|
||||
@@ -618,7 +618,7 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
|
||||
Diff32fC3(ld_buf.f, ud_buf.f),
|
||||
&comp, flags, &buffer);
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
|
||||
if( rect )
|
||||
*rect = comp.rect;
|
||||
|
||||
@@ -87,7 +87,7 @@ CV_IMPL void
|
||||
cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] )
|
||||
{
|
||||
if( !pt )
|
||||
CV_Error( CV_StsNullPtr, "NULL vertex array pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL vertex array pointer" );
|
||||
cv::RotatedRect(box).points((cv::Point2f*)pt);
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ GMM::GMM( Mat& _model )
|
||||
_model.setTo(Scalar(0));
|
||||
}
|
||||
else if( (_model.type() != CV_64FC1) || (_model.rows != 1) || (_model.cols != modelSize*componentsCount) )
|
||||
CV_Error( CV_StsBadArg, "_model must have CV_64FC1 type, rows == 1 and cols == 13*componentsCount" );
|
||||
CV_Error( cv::Error::StsBadArg, "_model must have CV_64FC1 type, rows == 1 and cols == 13*componentsCount" );
|
||||
|
||||
model = _model;
|
||||
|
||||
@@ -329,18 +329,18 @@ static void calcNWeights( const Mat& img, Mat& leftW, Mat& upleftW, Mat& upW, Ma
|
||||
static void checkMask( const Mat& img, const Mat& mask )
|
||||
{
|
||||
if( mask.empty() )
|
||||
CV_Error( CV_StsBadArg, "mask is empty" );
|
||||
CV_Error( cv::Error::StsBadArg, "mask is empty" );
|
||||
if( mask.type() != CV_8UC1 )
|
||||
CV_Error( CV_StsBadArg, "mask must have CV_8UC1 type" );
|
||||
CV_Error( cv::Error::StsBadArg, "mask must have CV_8UC1 type" );
|
||||
if( mask.cols != img.cols || mask.rows != img.rows )
|
||||
CV_Error( CV_StsBadArg, "mask must have as many rows and cols as img" );
|
||||
CV_Error( cv::Error::StsBadArg, "mask must have as many rows and cols as img" );
|
||||
for( int y = 0; y < mask.rows; y++ )
|
||||
{
|
||||
for( int x = 0; x < mask.cols; x++ )
|
||||
{
|
||||
uchar val = mask.at<uchar>(y,x);
|
||||
if( val!=GC_BGD && val!=GC_FGD && val!=GC_PR_BGD && val!=GC_PR_FGD )
|
||||
CV_Error( CV_StsBadArg, "mask element value must be equal "
|
||||
CV_Error( cv::Error::StsBadArg, "mask element value must be equal "
|
||||
"GC_BGD or GC_FGD or GC_PR_BGD or GC_PR_FGD" );
|
||||
}
|
||||
}
|
||||
@@ -552,9 +552,9 @@ void cv::grabCut( InputArray _img, InputOutputArray _mask, Rect rect,
|
||||
Mat& fgdModel = _fgdModel.getMatRef();
|
||||
|
||||
if( img.empty() )
|
||||
CV_Error( CV_StsBadArg, "image is empty" );
|
||||
CV_Error( cv::Error::StsBadArg, "image is empty" );
|
||||
if( img.type() != CV_8UC3 )
|
||||
CV_Error( CV_StsBadArg, "image must have CV_8UC3 type" );
|
||||
CV_Error( cv::Error::StsBadArg, "image must have CV_8UC3 type" );
|
||||
|
||||
GMM bgdGMM( bgdModel ), fgdGMM( fgdModel );
|
||||
Mat compIdxs( img.size(), CV_32SC1 );
|
||||
|
||||
@@ -1005,7 +1005,7 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels,
|
||||
else if( depth == CV_32F )
|
||||
calcHist_<float>(ptrs, deltas, imsize, ihist, dims, ranges, _uniranges, uniform );
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
|
||||
ihist.convertTo(hist, CV_32F);
|
||||
}
|
||||
@@ -1182,7 +1182,7 @@ static void calcHist( const Mat* images, int nimages, const int* channels,
|
||||
else if( depth == CV_32F )
|
||||
calcSparseHist_<float>(ptrs, deltas, imsize, hist, dims, ranges, _uniranges, uniform );
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
|
||||
if( !keepInt )
|
||||
{
|
||||
@@ -1637,7 +1637,7 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels,
|
||||
else if( depth == CV_32F )
|
||||
calcBackProj_<float, float>(ptrs, deltas, imsize, hist, dims, ranges, _uniranges, (float)scale, uniform );
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
}
|
||||
|
||||
|
||||
@@ -1810,7 +1810,7 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels,
|
||||
calcSparseBackProj_<float, float>(ptrs, deltas, imsize, hist, dims, ranges,
|
||||
_uniranges, (float)scale, uniform );
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
@@ -2211,7 +2211,7 @@ double cv::compareHist( InputArray _H1, InputArray _H2, int method )
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown comparison method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown comparison method" );
|
||||
}
|
||||
|
||||
if( method == CV_COMP_CHISQR_ALT )
|
||||
@@ -2350,7 +2350,7 @@ double cv::compareHist( const SparseMat& H1, const SparseMat& H2, int method )
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown comparison method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown comparison method" );
|
||||
|
||||
if( method == CV_COMP_CHISQR_ALT )
|
||||
result *= 2;
|
||||
@@ -2387,7 +2387,7 @@ cvCreateHist( int dims, int *sizes, CvHistType type, float** ranges, int uniform
|
||||
else if( type == CV_HIST_SPARSE )
|
||||
hist->bins = cvCreateSparseMat( dims, sizes, CV_HIST_DEFAULT_TYPE );
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram type" );
|
||||
|
||||
if( ranges )
|
||||
cvSetHistBinRanges( hist, ranges, uniform );
|
||||
@@ -2402,10 +2402,10 @@ cvMakeHistHeaderForArray( int dims, int *sizes, CvHistogram *hist,
|
||||
float *data, float **ranges, int uniform )
|
||||
{
|
||||
if( !hist )
|
||||
CV_Error( CV_StsNullPtr, "Null histogram header pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Null histogram header pointer" );
|
||||
|
||||
if( !data )
|
||||
CV_Error( CV_StsNullPtr, "Null data pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Null data pointer" );
|
||||
|
||||
hist->thresh2 = 0;
|
||||
hist->type = CV_HIST_MAGIC_VAL;
|
||||
@@ -2414,7 +2414,7 @@ cvMakeHistHeaderForArray( int dims, int *sizes, CvHistogram *hist,
|
||||
if( ranges )
|
||||
{
|
||||
if( !uniform )
|
||||
CV_Error( CV_StsBadArg, "Only uniform bin ranges can be used here "
|
||||
CV_Error( cv::Error::StsBadArg, "Only uniform bin ranges can be used here "
|
||||
"(to avoid memory allocation)" );
|
||||
cvSetHistBinRanges( hist, ranges, uniform );
|
||||
}
|
||||
@@ -2427,14 +2427,14 @@ CV_IMPL void
|
||||
cvReleaseHist( CvHistogram **hist )
|
||||
{
|
||||
if( !hist )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( *hist )
|
||||
{
|
||||
CvHistogram* temp = *hist;
|
||||
|
||||
if( !CV_IS_HIST(temp))
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header" );
|
||||
*hist = 0;
|
||||
|
||||
if( CV_IS_SPARSE_HIST( temp ))
|
||||
@@ -2455,7 +2455,7 @@ CV_IMPL void
|
||||
cvClearHist( CvHistogram *hist )
|
||||
{
|
||||
if( !CV_IS_HIST(hist) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header" );
|
||||
cvZero( hist->bins );
|
||||
}
|
||||
|
||||
@@ -2465,7 +2465,7 @@ CV_IMPL void
|
||||
cvThreshHist( CvHistogram* hist, double thresh )
|
||||
{
|
||||
if( !CV_IS_HIST(hist) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header" );
|
||||
|
||||
if( !CV_IS_SPARSE_MAT(hist->bins) )
|
||||
{
|
||||
@@ -2497,7 +2497,7 @@ cvNormalizeHist( CvHistogram* hist, double factor )
|
||||
double sum = 0;
|
||||
|
||||
if( !CV_IS_HIST(hist) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header" );
|
||||
|
||||
if( !CV_IS_SPARSE_HIST(hist) )
|
||||
{
|
||||
@@ -2544,7 +2544,7 @@ cvGetMinMaxHistValue( const CvHistogram* hist,
|
||||
int dims, size[CV_MAX_DIM];
|
||||
|
||||
if( !CV_IS_HIST(hist) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header" );
|
||||
|
||||
dims = cvGetDims( hist->bins, size );
|
||||
|
||||
@@ -2662,10 +2662,10 @@ cvCompareHist( const CvHistogram* hist1,
|
||||
int size1[CV_MAX_DIM], size2[CV_MAX_DIM], total = 1;
|
||||
|
||||
if( !CV_IS_HIST(hist1) || !CV_IS_HIST(hist2) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header[s]" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header[s]" );
|
||||
|
||||
if( CV_IS_SPARSE_MAT(hist1->bins) != CV_IS_SPARSE_MAT(hist2->bins))
|
||||
CV_Error(CV_StsUnmatchedFormats, "One of histograms is sparse and other is not");
|
||||
CV_Error(cv::Error::StsUnmatchedFormats, "One of histograms is sparse and other is not");
|
||||
|
||||
if( !CV_IS_SPARSE_MAT(hist1->bins) )
|
||||
{
|
||||
@@ -2678,13 +2678,13 @@ cvCompareHist( const CvHistogram* hist1,
|
||||
int dims2 = cvGetDims( hist2->bins, size2 );
|
||||
|
||||
if( dims1 != dims2 )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The histograms have different numbers of dimensions" );
|
||||
|
||||
for( i = 0; i < dims1; i++ )
|
||||
{
|
||||
if( size1[i] != size2[i] )
|
||||
CV_Error( CV_StsUnmatchedSizes, "The histograms have different sizes" );
|
||||
CV_Error( cv::Error::StsUnmatchedSizes, "The histograms have different sizes" );
|
||||
total *= size1[i];
|
||||
}
|
||||
|
||||
@@ -2804,7 +2804,7 @@ cvCompareHist( const CvHistogram* hist1,
|
||||
result = cv::compareHist( sH1, sH2, CV_COMP_KL_DIV );
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown comparison method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown comparison method" );
|
||||
|
||||
if( method == CV_COMP_CHISQR_ALT )
|
||||
result *= 2;
|
||||
@@ -2817,12 +2817,12 @@ CV_IMPL void
|
||||
cvCopyHist( const CvHistogram* src, CvHistogram** _dst )
|
||||
{
|
||||
if( !_dst )
|
||||
CV_Error( CV_StsNullPtr, "Destination double pointer is NULL" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Destination double pointer is NULL" );
|
||||
|
||||
CvHistogram* dst = *_dst;
|
||||
|
||||
if( !CV_IS_HIST(src) || (dst && !CV_IS_HIST(dst)) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header[s]" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header[s]" );
|
||||
|
||||
bool eq = false;
|
||||
int size1[CV_MAX_DIM];
|
||||
@@ -2887,10 +2887,10 @@ cvSetHistBinRanges( CvHistogram* hist, float** ranges, int uniform )
|
||||
int i, j;
|
||||
|
||||
if( !ranges )
|
||||
CV_Error( CV_StsNullPtr, "NULL ranges pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL ranges pointer" );
|
||||
|
||||
if( !CV_IS_HIST(hist) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header" );
|
||||
|
||||
dims = cvGetDims( hist->bins, size );
|
||||
for( i = 0; i < dims; i++ )
|
||||
@@ -2901,7 +2901,7 @@ cvSetHistBinRanges( CvHistogram* hist, float** ranges, int uniform )
|
||||
for( i = 0; i < dims; i++ )
|
||||
{
|
||||
if( !ranges[i] )
|
||||
CV_Error( CV_StsNullPtr, "One of <ranges> elements is NULL" );
|
||||
CV_Error( cv::Error::StsNullPtr, "One of <ranges> elements is NULL" );
|
||||
hist->thresh[i][0] = ranges[i][0];
|
||||
hist->thresh[i][1] = ranges[i][1];
|
||||
}
|
||||
@@ -2925,13 +2925,13 @@ cvSetHistBinRanges( CvHistogram* hist, float** ranges, int uniform )
|
||||
float val0 = -FLT_MAX;
|
||||
|
||||
if( !ranges[i] )
|
||||
CV_Error( CV_StsNullPtr, "One of <ranges> elements is NULL" );
|
||||
CV_Error( cv::Error::StsNullPtr, "One of <ranges> elements is NULL" );
|
||||
|
||||
for( j = 0; j <= size[i]; j++ )
|
||||
{
|
||||
float val = ranges[i][j];
|
||||
if( val <= val0 )
|
||||
CV_Error(CV_StsOutOfRange, "Bin ranges should go in ascenting order");
|
||||
CV_Error(cv::Error::StsOutOfRange, "Bin ranges should go in ascenting order");
|
||||
val0 = dim_ranges[j] = val;
|
||||
}
|
||||
|
||||
@@ -2949,10 +2949,10 @@ CV_IMPL void
|
||||
cvCalcArrHist( CvArr** img, CvHistogram* hist, int accumulate, const CvArr* mask )
|
||||
{
|
||||
if( !CV_IS_HIST(hist))
|
||||
CV_Error( CV_StsBadArg, "Bad histogram pointer" );
|
||||
CV_Error( cv::Error::StsBadArg, "Bad histogram pointer" );
|
||||
|
||||
if( !img )
|
||||
CV_Error( CV_StsNullPtr, "Null double array pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Null double array pointer" );
|
||||
|
||||
int size[CV_MAX_DIM];
|
||||
int i, dims = cvGetDims( hist->bins, size);
|
||||
@@ -3015,10 +3015,10 @@ CV_IMPL void
|
||||
cvCalcArrBackProject( CvArr** img, CvArr* dst, const CvHistogram* hist )
|
||||
{
|
||||
if( !CV_IS_HIST(hist))
|
||||
CV_Error( CV_StsBadArg, "Bad histogram pointer" );
|
||||
CV_Error( cv::Error::StsBadArg, "Bad histogram pointer" );
|
||||
|
||||
if( !img )
|
||||
CV_Error( CV_StsNullPtr, "Null double array pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Null double array pointer" );
|
||||
|
||||
int size[CV_MAX_DIM];
|
||||
int i, dims = cvGetDims( hist->bins, size );
|
||||
@@ -3078,21 +3078,21 @@ cvCalcArrBackProjectPatch( CvArr** arr, CvArr* dst, CvSize patch_size, CvHistogr
|
||||
cv::Size size;
|
||||
|
||||
if( !CV_IS_HIST(hist))
|
||||
CV_Error( CV_StsBadArg, "Bad histogram pointer" );
|
||||
CV_Error( cv::Error::StsBadArg, "Bad histogram pointer" );
|
||||
|
||||
if( !arr )
|
||||
CV_Error( CV_StsNullPtr, "Null double array pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Null double array pointer" );
|
||||
|
||||
if( norm_factor <= 0 )
|
||||
CV_Error( CV_StsOutOfRange,
|
||||
CV_Error( cv::Error::StsOutOfRange,
|
||||
"Bad normalization factor (set it to 1.0 if unsure)" );
|
||||
|
||||
if( patch_size.width <= 0 || patch_size.height <= 0 )
|
||||
CV_Error( CV_StsBadSize, "The patch width and height must be positive" );
|
||||
CV_Error( cv::Error::StsBadSize, "The patch width and height must be positive" );
|
||||
|
||||
dims = cvGetDims( hist->bins );
|
||||
if (dims < 1)
|
||||
CV_Error( CV_StsOutOfRange, "Invalid number of dimensions");
|
||||
CV_Error( cv::Error::StsOutOfRange, "Invalid number of dimensions");
|
||||
cvNormalizeHist( hist, norm_factor );
|
||||
|
||||
for( i = 0; i < dims; i++ )
|
||||
@@ -3105,11 +3105,11 @@ cvCalcArrBackProjectPatch( CvArr** arr, CvArr* dst, CvSize patch_size, CvHistogr
|
||||
|
||||
dstmat = cvGetMat( dst, &dststub, 0, 0 );
|
||||
if( CV_MAT_TYPE( dstmat->type ) != CV_32FC1 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "Resultant image must have 32fC1 type" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "Resultant image must have 32fC1 type" );
|
||||
|
||||
if( dstmat->cols != img[0]->width - patch_size.width + 1 ||
|
||||
dstmat->rows != img[0]->height - patch_size.height + 1 )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The output map must be (W-w+1 x H-h+1), "
|
||||
"where the input images are (W x H) each and the patch is (w x h)" );
|
||||
|
||||
@@ -3146,18 +3146,18 @@ cvCalcBayesianProb( CvHistogram** src, int count, CvHistogram** dst )
|
||||
int i;
|
||||
|
||||
if( !src || !dst )
|
||||
CV_Error( CV_StsNullPtr, "NULL histogram array pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL histogram array pointer" );
|
||||
|
||||
if( count < 2 )
|
||||
CV_Error( CV_StsOutOfRange, "Too small number of histograms" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "Too small number of histograms" );
|
||||
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
if( !CV_IS_HIST(src[i]) || !CV_IS_HIST(dst[i]) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram header" );
|
||||
|
||||
if( !CV_IS_MATND(src[i]->bins) || !CV_IS_MATND(dst[i]->bins) )
|
||||
CV_Error( CV_StsBadArg, "The function supports dense histograms only" );
|
||||
CV_Error( cv::Error::StsBadArg, "The function supports dense histograms only" );
|
||||
}
|
||||
|
||||
cvZero( dst[0]->bins );
|
||||
@@ -3178,10 +3178,10 @@ cvCalcProbDensity( const CvHistogram* hist, const CvHistogram* hist_mask,
|
||||
CvHistogram* hist_dens, double scale )
|
||||
{
|
||||
if( scale <= 0 )
|
||||
CV_Error( CV_StsOutOfRange, "scale must be positive" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "scale must be positive" );
|
||||
|
||||
if( !CV_IS_HIST(hist) || !CV_IS_HIST(hist_mask) || !CV_IS_HIST(hist_dens) )
|
||||
CV_Error( CV_StsBadArg, "Invalid histogram pointer[s]" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid histogram pointer[s]" );
|
||||
|
||||
{
|
||||
CvArr* arrs[] = { hist->bins, hist_mask->bins, hist_dens->bins };
|
||||
@@ -3191,7 +3191,7 @@ cvCalcProbDensity( const CvHistogram* hist, const CvHistogram* hist_mask,
|
||||
cvInitNArrayIterator( 3, arrs, 0, stubs, &iterator );
|
||||
|
||||
if( CV_MAT_TYPE(iterator.hdr[0]->type) != CV_32FC1 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "All histograms must have 32fC1 type" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "All histograms must have 32fC1 type" );
|
||||
|
||||
do
|
||||
{
|
||||
@@ -3533,7 +3533,7 @@ static void *icvReadHist( CvFileStorage * fs, CvFileNode * node )
|
||||
int i, sizes[CV_MAX_DIM];
|
||||
|
||||
if(!CV_IS_MATND(mat))
|
||||
CV_Error( CV_StsError, "Expected CvMatND");
|
||||
CV_Error( cv::Error::StsError, "Expected CvMatND");
|
||||
|
||||
for(i=0; i<mat->dims; i++)
|
||||
sizes[i] = mat->dim[i].size;
|
||||
@@ -3554,7 +3554,7 @@ static void *icvReadHist( CvFileStorage * fs, CvFileNode * node )
|
||||
{
|
||||
h->bins = cvReadByName( fs, node, "bins" );
|
||||
if(!CV_IS_SPARSE_MAT(h->bins)){
|
||||
CV_Error( CV_StsError, "Unknown Histogram type");
|
||||
CV_Error( cv::Error::StsError, "Unknown Histogram type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3571,7 +3571,7 @@ static void *icvReadHist( CvFileStorage * fs, CvFileNode * node )
|
||||
|
||||
thresh_node = cvGetFileNodeByName( fs, node, "thresh" );
|
||||
if(!thresh_node)
|
||||
CV_Error( CV_StsError, "'thresh' node is missing");
|
||||
CV_Error( cv::Error::StsError, "'thresh' node is missing");
|
||||
cvStartReadRawData( fs, thresh_node, &reader );
|
||||
|
||||
if(is_uniform)
|
||||
|
||||
@@ -2396,11 +2396,11 @@ cvHoughLines2( CvArr* src_image, void* lineStorage, int method,
|
||||
mat = (CvMat*)lineStorage;
|
||||
|
||||
if( !CV_IS_MAT_CONT( mat->type ) || (mat->rows != 1 && mat->cols != 1) )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"The destination matrix should be continuous and have a single row or a single column" );
|
||||
|
||||
if( CV_MAT_TYPE( mat->type ) != lineType )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"The destination matrix data type is inappropriate, see the manual" );
|
||||
|
||||
lines = cvMakeSeqHeaderForArray( lineType, sizeof(CvSeq), elemSize, mat->data.ptr,
|
||||
@@ -2427,7 +2427,7 @@ cvHoughLines2( CvArr* src_image, void* lineStorage, int method,
|
||||
threshold, iparam1, iparam2, l4, linesMax );
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "Unrecognized method id" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unrecognized method id" );
|
||||
}
|
||||
|
||||
int nlines = (int)(l2.size() + l4.size());
|
||||
@@ -2473,7 +2473,7 @@ cvHoughCircles( CvArr* src_image, void* circle_storage,
|
||||
cv::Mat src = cv::cvarrToMat(src_image), circles_mat;
|
||||
|
||||
if( !circle_storage )
|
||||
CV_Error( CV_StsNullPtr, "NULL destination" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL destination" );
|
||||
|
||||
bool isStorage = isStorageOrMat(circle_storage);
|
||||
|
||||
@@ -2490,7 +2490,7 @@ cvHoughCircles( CvArr* src_image, void* circle_storage,
|
||||
|
||||
if( !CV_IS_MAT_CONT( mat->type ) || (mat->rows != 1 && mat->cols != 1) ||
|
||||
CV_MAT_TYPE(mat->type) != CV_32FC3 )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"The destination matrix should be continuous and have a single row or a single column" );
|
||||
|
||||
circles = cvMakeSeqHeaderForArray( CV_32FC3, sizeof(CvSeq), sizeof(float)*3,
|
||||
|
||||
@@ -206,7 +206,7 @@ static void initInterTab1D(int method, float* tab, int tabsz)
|
||||
interpolateLanczos4( i*scale, tab );
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown interpolation method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown interpolation method" );
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ static const void* initInterTab2D( int method, bool fixpt )
|
||||
else if( method == INTER_LANCZOS4 )
|
||||
tab = Lanczos4Tab_f[0][0], itab = Lanczos4Tab_i[0][0], ksize=8;
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown/unsupported interpolation type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported interpolation type" );
|
||||
|
||||
if( !inittab[method] )
|
||||
{
|
||||
@@ -1502,7 +1502,7 @@ static bool ocl_logPolar(InputArray _src, OutputArray _dst,
|
||||
Point2f center, double M, int flags)
|
||||
{
|
||||
if (M <= 0)
|
||||
CV_Error(CV_StsOutOfRange, "M should be >0");
|
||||
CV_Error(cv::Error::StsOutOfRange, "M should be >0");
|
||||
UMat src_with_border; // don't scope this variable (it holds image data)
|
||||
|
||||
UMat mapx, mapy, r, cp_sp;
|
||||
@@ -1649,12 +1649,12 @@ static bool openvx_remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation
|
||||
}
|
||||
catch (const ivx::RuntimeError & e)
|
||||
{
|
||||
CV_Error(CV_StsInternal, e.what());
|
||||
CV_Error(cv::Error::StsInternal, e.what());
|
||||
return false;
|
||||
}
|
||||
catch (const ivx::WrapperError & e)
|
||||
{
|
||||
CV_Error(CV_StsInternal, e.what());
|
||||
CV_Error(cv::Error::StsInternal, e.what());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -1888,7 +1888,7 @@ void cv::remap( InputArray _src, OutputArray _dst,
|
||||
CV_Assert( _src.channels() <= 4 );
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown interpolation method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown interpolation method" );
|
||||
CV_Assert( ifunc != 0 );
|
||||
ctab = initInterTab2D( interpolation, fixpt );
|
||||
}
|
||||
@@ -2236,7 +2236,7 @@ void cv::convertMaps( InputArray _map1, InputArray _map2,
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsNotImplemented, "Unsupported combination of input/output matrices" );
|
||||
CV_Error( cv::Error::StsNotImplemented, "Unsupported combination of input/output matrices" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3610,7 +3610,7 @@ void cv::invertAffineTransform(InputArray _matM, OutputArray __iM)
|
||||
iM[istep] = A21; iM[istep+1] = A22; iM[istep+2] = b2;
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
}
|
||||
|
||||
cv::Mat cv::getPerspectiveTransform(InputArray _src, InputArray _dst, int solveMethod)
|
||||
|
||||
@@ -358,7 +358,7 @@ static void fitLine2D( const Point2f * points, int count, int dist,
|
||||
calc_weights = (void ( * )(float *, int, float *)) _PFP.fp;
|
||||
break;*/
|
||||
default:
|
||||
CV_Error(CV_StsBadArg, "Unknown distance type");
|
||||
CV_Error(cv::Error::StsBadArg, "Unknown distance type");
|
||||
}
|
||||
|
||||
AutoBuffer<float> wr(count*2);
|
||||
@@ -499,7 +499,7 @@ static void fitLine3D( Point3f * points, int count, int dist,
|
||||
break;
|
||||
|
||||
default:
|
||||
CV_Error(CV_StsBadArg, "Unknown distance");
|
||||
CV_Error(cv::Error::StsBadArg, "Unknown distance");
|
||||
}
|
||||
|
||||
AutoBuffer<float> buf(count*2);
|
||||
|
||||
@@ -158,7 +158,7 @@ double cv::matchShapes(InputArray contour1, InputArray contour2, int method, dou
|
||||
}
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "Unknown comparison method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown comparison method" );
|
||||
}
|
||||
|
||||
//If anyA and anyB are both true, the result is correct.
|
||||
|
||||
@@ -867,7 +867,7 @@ void medianBlur(const Mat& src0, /*const*/ Mat& dst, int ksize)
|
||||
else if( src.depth() == CV_32F )
|
||||
medianBlur_SortNet<MinMax32f, MinMaxVec32f>( src, dst, ksize );
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ cv::Moments cv::moments( InputArray _src, bool binary )
|
||||
return contourMoments(mat);
|
||||
|
||||
if( cn > 1 )
|
||||
CV_Error( CV_StsBadArg, "Invalid image type (must be single-channel)" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid image type (must be single-channel)" );
|
||||
|
||||
CV_IPP_RUN(!binary, ipp_moments(mat, m), m);
|
||||
|
||||
@@ -599,7 +599,7 @@ cv::Moments cv::moments( InputArray _src, bool binary )
|
||||
else if( depth == CV_64F )
|
||||
func = momentsInTile<double, double, double>;
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
Mat src0(mat);
|
||||
|
||||
@@ -730,9 +730,9 @@ CV_IMPL double cvGetSpatialMoment( CvMoments * moments, int x_order, int y_order
|
||||
int order = x_order + y_order;
|
||||
|
||||
if( !moments )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
if( (x_order | y_order) < 0 || order > 3 )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
return (&(moments->m00))[order + (order >> 1) + (order > 2) * 2 + y_order];
|
||||
}
|
||||
@@ -743,9 +743,9 @@ CV_IMPL double cvGetCentralMoment( CvMoments * moments, int x_order, int y_order
|
||||
int order = x_order + y_order;
|
||||
|
||||
if( !moments )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
if( (x_order | y_order) < 0 || order > 3 )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
return order >= 2 ? (&(moments->m00))[4 + order * 3 + y_order] :
|
||||
order == 0 ? moments->m00 : 0;
|
||||
@@ -768,7 +768,7 @@ CV_IMPL double cvGetNormalizedCentralMoment( CvMoments * moments, int x_order, i
|
||||
CV_IMPL void cvGetHuMoments( CvMoments * mState, CvHuMoments * HuState )
|
||||
{
|
||||
if( !mState || !HuState )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
double m00s = mState->inv_sqrt_m00, m00 = m00s * m00s, s2 = m00 * m00, s3 = s2 * m00s;
|
||||
|
||||
|
||||
@@ -1076,7 +1076,7 @@ static bool ocl_morphologyEx(InputArray _src, OutputArray _dst, int op,
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "unknown morphological operation" );
|
||||
CV_Error( cv::Error::StsBadArg, "unknown morphological operation" );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1249,7 +1249,7 @@ void morphologyEx( InputArray _src, OutputArray _dst, int op,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "unknown morphological operation" );
|
||||
CV_Error( cv::Error::StsBadArg, "unknown morphological operation" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1296,7 +1296,7 @@ CV_IMPL void
|
||||
cvReleaseStructuringElement( IplConvKernel ** element )
|
||||
{
|
||||
if( !element )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
cvFree( element );
|
||||
}
|
||||
|
||||
|
||||
@@ -753,7 +753,7 @@ Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int ksize, int ancho
|
||||
DilateRowVec64f> >(ksize, anchor);
|
||||
}
|
||||
|
||||
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
CV_Error_( cv::Error::StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
}
|
||||
|
||||
Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int ksize, int anchor)
|
||||
@@ -801,7 +801,7 @@ Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int ksize, int
|
||||
DilateColumnVec64f> >(ksize, anchor);
|
||||
}
|
||||
|
||||
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
CV_Error_( cv::Error::StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
}
|
||||
|
||||
Ptr<BaseFilter> getMorphologyFilter(int op, int type, const Mat& kernel, Point anchor)
|
||||
@@ -838,7 +838,7 @@ Ptr<BaseFilter> getMorphologyFilter(int op, int type, const Mat& kernel, Point a
|
||||
return makePtr<MorphFilter<MaxOp<double>, DilateVec64f> >(kernel, anchor);
|
||||
}
|
||||
|
||||
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
CV_Error_( cv::Error::StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@ inline bool isStorageOrMat(void * arr)
|
||||
return true;
|
||||
else if (CV_IS_MAT( arr ))
|
||||
return false;
|
||||
CV_Error( CV_StsBadArg, "Destination is not CvMemStorage* nor CvMat*" );
|
||||
CV_Error( cv::Error::StsBadArg, "Destination is not CvMemStorage* nor CvMat*" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1448,7 +1448,7 @@ void cv::pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz, int borde
|
||||
else if( depth == CV_64F )
|
||||
func = pyrDown_< FltCast<double, 8> >;
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
func( src, dst, borderType );
|
||||
}
|
||||
@@ -1551,7 +1551,7 @@ void cv::pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int borderT
|
||||
else if( depth == CV_64F )
|
||||
func = pyrUp_< FltCast<double, 6> >;
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
func( src, dst, borderType );
|
||||
}
|
||||
@@ -1722,7 +1722,7 @@ CV_IMPL void
|
||||
cvReleasePyramid( CvMat*** _pyramid, int extra_layers )
|
||||
{
|
||||
if( !_pyramid )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( *_pyramid )
|
||||
for( int i = 0; i <= extra_layers; i++ )
|
||||
@@ -1743,7 +1743,7 @@ cvCreatePyramid( const CvArr* srcarr, int extra_layers, double rate,
|
||||
CvMat stub, *src = cvGetMat( srcarr, &stub );
|
||||
|
||||
if( extra_layers < 0 )
|
||||
CV_Error( CV_StsOutOfRange, "The number of extra layers must be non negative" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The number of extra layers must be non negative" );
|
||||
|
||||
int i, layer_step, elem_size = CV_ELEM_SIZE(src->type);
|
||||
cv::Size layer_size, size = cvGetMatSize(src);
|
||||
@@ -1770,7 +1770,7 @@ cvCreatePyramid( const CvArr* srcarr, int extra_layers, double rate,
|
||||
}
|
||||
|
||||
if( bufsize < 0 )
|
||||
CV_Error( CV_StsOutOfRange, "The buffer is too small to fit the pyramid" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The buffer is too small to fit the pyramid" );
|
||||
ptr = buf->data.ptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -4024,7 +4024,7 @@ void resize(int src_type,
|
||||
else if( interpolation == INTER_LINEAR || interpolation == INTER_AREA )
|
||||
ksize = 2, func = linear_tab[depth];
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown interpolation method" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown interpolation method" );
|
||||
ksize2 = ksize/2;
|
||||
|
||||
CV_Assert( func != 0 );
|
||||
|
||||
@@ -245,7 +245,7 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
|
||||
base_b = lead_x;
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsError, "main_element should be 0, 1, 2 or 3");
|
||||
CV_Error(cv::Error::StsError, "main_element should be 0, 1, 2 or 3");
|
||||
}
|
||||
}
|
||||
/* change base point of main edge */
|
||||
|
||||
@@ -417,7 +417,7 @@ void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center,
|
||||
getRectSubPix_Cn_<float, float, float, nop<float>, nop<float> >
|
||||
(image.ptr<float>(), image.step, image.size(), patch.ptr<float>(), patch.step, patch.size(), center, cn);
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "Unsupported combination of input and output formats");
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "Unsupported combination of input and output formats");
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ cvSampleLine( const void* _img, CvPoint pt1, CvPoint pt2,
|
||||
size_t pixsize = img.elemSize();
|
||||
|
||||
if( !buffer )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
for( int i = 0; i < li.count; i++, ++li )
|
||||
{
|
||||
|
||||
@@ -348,7 +348,7 @@ void cv::pyrMeanShiftFiltering( InputArray _src, OutputArray _dst,
|
||||
const int MAX_LEVELS = 8;
|
||||
|
||||
if( (unsigned)max_level > (unsigned)MAX_LEVELS )
|
||||
CV_Error( CV_StsOutOfRange, "The number of pyramid levels is too large or negative" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The number of pyramid levels is too large or negative" );
|
||||
|
||||
std::vector<cv::Mat> src_pyramid(max_level+1);
|
||||
std::vector<cv::Mat> dst_pyramid(max_level+1);
|
||||
@@ -365,13 +365,13 @@ void cv::pyrMeanShiftFiltering( InputArray _src, OutputArray _dst,
|
||||
|
||||
|
||||
if( src0.type() != CV_8UC3 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "Only 8-bit, 3-channel images are supported" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "Only 8-bit, 3-channel images are supported" );
|
||||
|
||||
if( src0.type() != dst0.type() )
|
||||
CV_Error( CV_StsUnmatchedFormats, "The input and output images must have the same type" );
|
||||
CV_Error( cv::Error::StsUnmatchedFormats, "The input and output images must have the same type" );
|
||||
|
||||
if( src0.size() != dst0.size() )
|
||||
CV_Error( CV_StsUnmatchedSizes, "The input and output images must have the same size" );
|
||||
CV_Error( cv::Error::StsUnmatchedSizes, "The input and output images must have the same size" );
|
||||
|
||||
if( !(termcrit.type & CV_TERMCRIT_ITER) )
|
||||
termcrit.maxCount = 5;
|
||||
|
||||
@@ -357,7 +357,7 @@ static RotatedRect fitEllipseNoDirect( InputArray _points )
|
||||
RotatedRect box;
|
||||
|
||||
if( n < 5 )
|
||||
CV_Error( CV_StsBadSize, "There should be at least 5 points to fit the ellipse" );
|
||||
CV_Error( cv::Error::StsBadSize, "There should be at least 5 points to fit the ellipse" );
|
||||
|
||||
// New fitellipse algorithm, contributed by Dr. Daniel Weiss
|
||||
Point2f c(0,0);
|
||||
@@ -520,7 +520,7 @@ cv::RotatedRect cv::fitEllipseAMS( InputArray _points )
|
||||
RotatedRect box;
|
||||
|
||||
if( n < 5 )
|
||||
CV_Error( CV_StsBadSize, "There should be at least 5 points to fit the ellipse" );
|
||||
CV_Error( cv::Error::StsBadSize, "There should be at least 5 points to fit the ellipse" );
|
||||
|
||||
Point2f c(0,0);
|
||||
|
||||
@@ -705,7 +705,7 @@ cv::RotatedRect cv::fitEllipseDirect( InputArray _points )
|
||||
RotatedRect box;
|
||||
|
||||
if( n < 5 )
|
||||
CV_Error( CV_StsBadSize, "There should be at least 5 points to fit the ellipse" );
|
||||
CV_Error( cv::Error::StsBadSize, "There should be at least 5 points to fit the ellipse" );
|
||||
|
||||
Point2d c(0., 0.);
|
||||
|
||||
@@ -1364,7 +1364,7 @@ cvContourArea( const void *array, CvSlice slice, int oriented )
|
||||
{
|
||||
contour = (CvSeq*)array;
|
||||
if( !CV_IS_SEQ_POLYLINE( contour ))
|
||||
CV_Error( CV_StsBadArg, "Unsupported sequence type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unsupported sequence type" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1379,7 +1379,7 @@ cvContourArea( const void *array, CvSlice slice, int oriented )
|
||||
}
|
||||
|
||||
if( CV_SEQ_ELTYPE( contour ) != CV_32SC2 )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"Only curves with integer coordinates are supported in case of contour slice" );
|
||||
area = icvContourSecArea( contour, slice );
|
||||
return oriented ? area : fabs(area);
|
||||
@@ -1405,7 +1405,7 @@ cvArcLength( const void *array, CvSlice slice, int is_closed )
|
||||
{
|
||||
contour = (CvSeq*)array;
|
||||
if( !CV_IS_SEQ_POLYLINE( contour ))
|
||||
CV_Error( CV_StsBadArg, "Unsupported sequence type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unsupported sequence type" );
|
||||
if( is_closed < 0 )
|
||||
is_closed = CV_IS_SEQ_CLOSED( contour );
|
||||
}
|
||||
@@ -1498,7 +1498,7 @@ cvBoundingRect( CvArr* array, int update )
|
||||
{
|
||||
ptseq = (CvSeq*)array;
|
||||
if( !CV_IS_SEQ_POINT_SET( ptseq ))
|
||||
CV_Error( CV_StsBadArg, "Unsupported sequence type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unsupported sequence type" );
|
||||
|
||||
if( ptseq->header_size < (int)sizeof(CvContour))
|
||||
{
|
||||
@@ -1517,7 +1517,7 @@ cvBoundingRect( CvArr* array, int update )
|
||||
}
|
||||
else if( CV_MAT_TYPE(mat->type) != CV_8UC1 &&
|
||||
CV_MAT_TYPE(mat->type) != CV_8SC1 )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"The image/matrix format is not supported by the function" );
|
||||
update = 0;
|
||||
calculate = 1;
|
||||
|
||||
@@ -784,7 +784,7 @@ cvSmooth( const void* srcarr, void* dstarr, int smooth_type,
|
||||
cv::bilateralFilter( src, dst, param1, param3, param4, cv::BORDER_REPLICATE );
|
||||
|
||||
if( dst.data != dst0.data )
|
||||
CV_Error( CV_StsUnmatchedFormats, "The destination image does not have the proper type" );
|
||||
CV_Error( cv::Error::StsUnmatchedFormats, "The destination image does not have the proper type" );
|
||||
}
|
||||
|
||||
/* End of file. */
|
||||
|
||||
@@ -282,10 +282,10 @@ int Subdiv2D::locate(Point2f pt, int& _edge, int& _vertex)
|
||||
int i, maxEdges = (int)(qedges.size() * 4);
|
||||
|
||||
if( qedges.size() < (size_t)4 )
|
||||
CV_Error( CV_StsError, "Subdivision is empty" );
|
||||
CV_Error( cv::Error::StsError, "Subdivision is empty" );
|
||||
|
||||
if( pt.x < topLeft.x || pt.y < topLeft.y || pt.x >= bottomRight.x || pt.y >= bottomRight.y )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
int edge = recentEdge;
|
||||
CV_Assert(edge > 0);
|
||||
@@ -417,10 +417,10 @@ int Subdiv2D::insert(Point2f pt)
|
||||
int location = locate( pt, curr_edge, curr_point );
|
||||
|
||||
if( location == PTLOC_ERROR )
|
||||
CV_Error( CV_StsBadSize, "" );
|
||||
CV_Error( cv::Error::StsBadSize, "" );
|
||||
|
||||
if( location == PTLOC_OUTSIDE_RECT )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
if( location == PTLOC_VERTEX )
|
||||
return curr_point;
|
||||
@@ -434,7 +434,7 @@ int Subdiv2D::insert(Point2f pt)
|
||||
else if( location == PTLOC_INSIDE )
|
||||
;
|
||||
else
|
||||
CV_Error_(CV_StsError, ("Subdiv2D::locate returned invalid location = %d", location) );
|
||||
CV_Error_(cv::Error::StsError, ("Subdiv2D::locate returned invalid location = %d", location) );
|
||||
|
||||
CV_Assert( curr_edge != 0 );
|
||||
validGeometry = false;
|
||||
|
||||
@@ -145,7 +145,7 @@ void ConvolveBuf::create(Size image_size, Size templ_size)
|
||||
dft_size.width = std::max(getOptimalDFTSize(block_size.width + templ_size.width - 1), 2);
|
||||
dft_size.height = getOptimalDFTSize(block_size.height + templ_size.height - 1);
|
||||
if( dft_size.width <= 0 || dft_size.height <= 0 )
|
||||
CV_Error( CV_StsOutOfRange, "the input arrays are too big" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "the input arrays are too big" );
|
||||
|
||||
// recompute block size
|
||||
block_size.width = dft_size.width - templ_size.width + 1;
|
||||
@@ -602,7 +602,7 @@ void crossCorr( const Mat& img, const Mat& _templ, Mat& corr,
|
||||
dftsize.width = std::max(getOptimalDFTSize(blocksize.width + templ.cols - 1), 2);
|
||||
dftsize.height = getOptimalDFTSize(blocksize.height + templ.rows - 1);
|
||||
if( dftsize.width <= 0 || dftsize.height <= 0 )
|
||||
CV_Error( CV_StsOutOfRange, "the input arrays are too big" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "the input arrays are too big" );
|
||||
|
||||
// recompute block size
|
||||
blocksize.width = dftsize.width - templ.cols + 1;
|
||||
|
||||
@@ -117,7 +117,7 @@ static void threshGeneric(Size roi, const T* src, size_t src_step, T* dst,
|
||||
return;
|
||||
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "" ); return;
|
||||
CV_Error( cv::Error::StsBadArg, "" ); return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,7 +719,7 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "" ); return;
|
||||
CV_Error( cv::Error::StsBadArg, "" ); return;
|
||||
}
|
||||
#else
|
||||
threshGeneric<short>(roi, src, src_step, dst, dst_step, thresh, maxval, type);
|
||||
@@ -925,7 +925,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, "" ); return;
|
||||
CV_Error( cv::Error::StsBadArg, "" ); return;
|
||||
}
|
||||
#else
|
||||
threshGeneric<float>(roi, src, src_step, dst, dst_step, thresh, maxval, type);
|
||||
@@ -1096,7 +1096,7 @@ thresh_64f(const Mat& _src, Mat& _dst, double thresh, double maxval, int type)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsBadArg, ""); return;
|
||||
CV_Error(cv::Error::StsBadArg, ""); return;
|
||||
}
|
||||
#else
|
||||
threshGeneric<double>(roi, src, src_step, dst, dst_step, thresh, maxval, type);
|
||||
@@ -1656,7 +1656,7 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m
|
||||
else if( src.depth() == CV_64F )
|
||||
;
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
parallel_for_(Range(0, dst.rows),
|
||||
ThresholdRunner(src, dst, thresh, maxval, type),
|
||||
@@ -1704,7 +1704,7 @@ void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue,
|
||||
meanfloat.convertTo(mean, src.type());
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadFlag, "Unknown/unsupported adaptive threshold method" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported adaptive threshold method" );
|
||||
|
||||
int i, j;
|
||||
uchar imaxval = saturate_cast<uchar>(maxValue);
|
||||
@@ -1718,7 +1718,7 @@ void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue,
|
||||
for( i = 0; i < 768; i++ )
|
||||
tab[i] = (uchar)(i - 255 <= -idelta ? imaxval : 0);
|
||||
else
|
||||
CV_Error( CV_StsBadFlag, "Unknown/unsupported threshold type" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Unknown/unsupported threshold type" );
|
||||
|
||||
if( src.isContinuous() && mean.isContinuous() && dst.isContinuous() )
|
||||
{
|
||||
|
||||
@@ -51,19 +51,19 @@ CV_IMPL CvSeq* cvPointSeqFromMat( int seq_kind, const CvArr* arr,
|
||||
CvMat* mat = (CvMat*)arr;
|
||||
|
||||
if( !CV_IS_MAT( mat ))
|
||||
CV_Error( CV_StsBadArg, "Input array is not a valid matrix" );
|
||||
CV_Error( cv::Error::StsBadArg, "Input array is not a valid matrix" );
|
||||
|
||||
if( CV_MAT_CN(mat->type) == 1 && mat->width == 2 )
|
||||
mat = cvReshape(mat, &hdr, 2);
|
||||
|
||||
eltype = CV_MAT_TYPE( mat->type );
|
||||
if( eltype != CV_32SC2 && eltype != CV_32FC2 )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"The matrix can not be converted to point sequence because of "
|
||||
"inappropriate element type" );
|
||||
|
||||
if( (mat->width != 1 && mat->height != 1) || !CV_IS_MAT_CONT(mat->type))
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"The matrix converted to point sequence must be "
|
||||
"1-dimensional and continuous" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user