1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Partially back-port #25075 to 4.x

This commit is contained in:
Alexander Smorkalov
2024-03-04 15:51:05 +03:00
parent ef611df09b
commit daa8f7dfc6
111 changed files with 1124 additions and 1124 deletions
+70 -70
View File
@@ -254,32 +254,32 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
CvMat matJ = cvMat( 3, 9, CV_64F, J );
if( !CV_IS_MAT(src) )
CV_Error( !src ? CV_StsNullPtr : CV_StsBadArg, "Input argument is not a valid matrix" );
CV_Error( !src ? cv::Error::StsNullPtr : cv::Error::StsBadArg, "Input argument is not a valid matrix" );
if( !CV_IS_MAT(dst) )
CV_Error( !dst ? CV_StsNullPtr : CV_StsBadArg,
CV_Error( !dst ? cv::Error::StsNullPtr : cv::Error::StsBadArg,
"The first output argument is not a valid matrix" );
int depth = CV_MAT_DEPTH(src->type);
int elem_size = CV_ELEM_SIZE(depth);
if( depth != CV_32F && depth != CV_64F )
CV_Error( CV_StsUnsupportedFormat, "The matrices must have 32f or 64f data type" );
CV_Error( cv::Error::StsUnsupportedFormat, "The matrices must have 32f or 64f data type" );
if( !CV_ARE_DEPTHS_EQ(src, dst) )
CV_Error( CV_StsUnmatchedFormats, "All the matrices must have the same data type" );
CV_Error( cv::Error::StsUnmatchedFormats, "All the matrices must have the same data type" );
if( jacobian )
{
if( !CV_IS_MAT(jacobian) )
CV_Error( CV_StsBadArg, "Jacobian is not a valid matrix" );
CV_Error( cv::Error::StsBadArg, "Jacobian is not a valid matrix" );
if( !CV_ARE_DEPTHS_EQ(src, jacobian) || CV_MAT_CN(jacobian->type) != 1 )
CV_Error( CV_StsUnmatchedFormats, "Jacobian must have 32fC1 or 64fC1 datatype" );
CV_Error( cv::Error::StsUnmatchedFormats, "Jacobian must have 32fC1 or 64fC1 datatype" );
if( (jacobian->rows != 9 || jacobian->cols != 3) &&
(jacobian->rows != 3 || jacobian->cols != 9))
CV_Error( CV_StsBadSize, "Jacobian must be 3x9 or 9x3" );
CV_Error( cv::Error::StsBadSize, "Jacobian must be 3x9 or 9x3" );
}
if( src->cols == 1 || src->rows == 1 )
@@ -287,10 +287,10 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
int step = src->rows > 1 ? src->step / elem_size : 1;
if( src->rows + src->cols*CV_MAT_CN(src->type) - 1 != 3 )
CV_Error( CV_StsBadSize, "Input matrix must be 1x3, 3x1 or 3x3" );
CV_Error( cv::Error::StsBadSize, "Input matrix must be 1x3, 3x1 or 3x3" );
if( dst->rows != 3 || dst->cols != 3 || CV_MAT_CN(dst->type) != 1 )
CV_Error( CV_StsBadSize, "Output matrix must be 3x3, single-channel floating point matrix" );
CV_Error( cv::Error::StsBadSize, "Output matrix must be 3x3, single-channel floating point matrix" );
Point3d r;
if( depth == CV_32F )
@@ -368,7 +368,7 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
if( (dst->rows != 1 || dst->cols*CV_MAT_CN(dst->type) != 3) &&
(dst->rows != 3 || dst->cols != 1 || CV_MAT_CN(dst->type) != 1))
CV_Error( CV_StsBadSize, "Output matrix must be 1x3 or 3x1" );
CV_Error( cv::Error::StsBadSize, "Output matrix must be 1x3 or 3x1" );
Matx33d R = cvarrToMat(src);
@@ -490,7 +490,7 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
}
else
{
CV_Error(CV_StsBadSize, "Input matrix must be 1x3 or 3x1 for a rotation vector, or 3x3 for a rotation matrix");
CV_Error(cv::Error::StsBadSize, "Input matrix must be 1x3 or 3x1 for a rotation vector, or 3x3 for a rotation matrix");
}
if( jacobian )
@@ -553,13 +553,13 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
if( !CV_IS_MAT(objectPoints) || !CV_IS_MAT(r_vec) ||
!CV_IS_MAT(t_vec) || !CV_IS_MAT(A) ||
/*!CV_IS_MAT(distCoeffs) ||*/ !CV_IS_MAT(imagePoints) )
CV_Error( CV_StsBadArg, "One of required arguments is not a valid matrix" );
CV_Error( cv::Error::StsBadArg, "One of required arguments is not a valid matrix" );
int total = objectPoints->rows * objectPoints->cols * CV_MAT_CN(objectPoints->type);
if(total % 3 != 0)
{
//we have stopped support of homogeneous coordinates because it cause ambiguity in interpretation of the input data
CV_Error( CV_StsBadArg, "Homogeneous coordinates are not supported" );
CV_Error( cv::Error::StsBadArg, "Homogeneous coordinates are not supported" );
}
count = total / 3;
@@ -576,7 +576,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
{
// matM = cvCreateMat( 1, count, CV_64FC3 );
// cvConvertPointsHomogeneous( objectPoints, matM );
CV_Error( CV_StsBadArg, "Homogeneous coordinates are not supported" );
CV_Error( cv::Error::StsBadArg, "Homogeneous coordinates are not supported" );
}
if( CV_IS_CONT_MAT(imagePoints->type) &&
@@ -591,7 +591,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
else
{
// _m = cvCreateMat( 1, count, CV_64FC2 );
CV_Error( CV_StsBadArg, "Homogeneous coordinates are not supported" );
CV_Error( cv::Error::StsBadArg, "Homogeneous coordinates are not supported" );
}
M = (CvPoint3D64f*)matM->data.db;
@@ -601,7 +601,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
(((r_vec->rows != 1 && r_vec->cols != 1) ||
r_vec->rows*r_vec->cols*CV_MAT_CN(r_vec->type) != 3) &&
((r_vec->rows != 3 && r_vec->cols != 3) || CV_MAT_CN(r_vec->type) != 1)))
CV_Error( CV_StsBadArg, "Rotation must be represented by 1x3 or 3x1 "
CV_Error( cv::Error::StsBadArg, "Rotation must be represented by 1x3 or 3x1 "
"floating-point rotation vector, or 3x3 rotation matrix" );
if( r_vec->rows == 3 && r_vec->cols == 3 )
@@ -621,7 +621,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
if( (CV_MAT_DEPTH(t_vec->type) != CV_64F && CV_MAT_DEPTH(t_vec->type) != CV_32F) ||
(t_vec->rows != 1 && t_vec->cols != 1) ||
t_vec->rows*t_vec->cols*CV_MAT_CN(t_vec->type) != 3 )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"Translation vector must be 1x3 or 3x1 floating-point vector" );
_t = cvMat( t_vec->rows, t_vec->cols, CV_MAKETYPE(CV_64F,CV_MAT_CN(t_vec->type)), t );
@@ -629,7 +629,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
if( (CV_MAT_TYPE(A->type) != CV_64FC1 && CV_MAT_TYPE(A->type) != CV_32FC1) ||
A->rows != 3 || A->cols != 3 )
CV_Error( CV_StsBadArg, "Intrinsic parameters must be 3x3 floating-point matrix" );
CV_Error( cv::Error::StsBadArg, "Intrinsic parameters must be 3x3 floating-point matrix" );
cvConvert( A, &_a );
fx = a[0]; fy = a[4];
@@ -649,7 +649,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
distCoeffs->rows*distCoeffs->cols*CV_MAT_CN(distCoeffs->type) != 8 &&
distCoeffs->rows*distCoeffs->cols*CV_MAT_CN(distCoeffs->type) != 12 &&
distCoeffs->rows*distCoeffs->cols*CV_MAT_CN(distCoeffs->type) != 14) )
CV_Error( CV_StsBadArg, cvDistCoeffErr );
CV_Error( cv::Error::StsBadArg, cvDistCoeffErr );
_k = cvMat( distCoeffs->rows, distCoeffs->cols,
CV_MAKETYPE(CV_64F,CV_MAT_CN(distCoeffs->type)), k );
@@ -667,7 +667,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
(CV_MAT_TYPE(dpdr->type) != CV_32FC1 &&
CV_MAT_TYPE(dpdr->type) != CV_64FC1) ||
dpdr->rows != count*2 || dpdr->cols != 3 )
CV_Error( CV_StsBadArg, "dp/drot must be 2Nx3 floating-point matrix" );
CV_Error( cv::Error::StsBadArg, "dp/drot must be 2Nx3 floating-point matrix" );
if( CV_MAT_TYPE(dpdr->type) == CV_64FC1 )
{
@@ -685,7 +685,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
(CV_MAT_TYPE(dpdt->type) != CV_32FC1 &&
CV_MAT_TYPE(dpdt->type) != CV_64FC1) ||
dpdt->rows != count*2 || dpdt->cols != 3 )
CV_Error( CV_StsBadArg, "dp/dT must be 2Nx3 floating-point matrix" );
CV_Error( cv::Error::StsBadArg, "dp/dT must be 2Nx3 floating-point matrix" );
if( CV_MAT_TYPE(dpdt->type) == CV_64FC1 )
{
@@ -702,7 +702,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
if( !CV_IS_MAT(dpdf) ||
(CV_MAT_TYPE(dpdf->type) != CV_32FC1 && CV_MAT_TYPE(dpdf->type) != CV_64FC1) ||
dpdf->rows != count*2 || dpdf->cols != 2 )
CV_Error( CV_StsBadArg, "dp/df must be 2Nx2 floating-point matrix" );
CV_Error( cv::Error::StsBadArg, "dp/df must be 2Nx2 floating-point matrix" );
if( CV_MAT_TYPE(dpdf->type) == CV_64FC1 )
{
@@ -719,7 +719,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
if( !CV_IS_MAT(dpdc) ||
(CV_MAT_TYPE(dpdc->type) != CV_32FC1 && CV_MAT_TYPE(dpdc->type) != CV_64FC1) ||
dpdc->rows != count*2 || dpdc->cols != 2 )
CV_Error( CV_StsBadArg, "dp/dc must be 2Nx2 floating-point matrix" );
CV_Error( cv::Error::StsBadArg, "dp/dc must be 2Nx2 floating-point matrix" );
if( CV_MAT_TYPE(dpdc->type) == CV_64FC1 )
{
@@ -736,10 +736,10 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
if( !CV_IS_MAT(dpdk) ||
(CV_MAT_TYPE(dpdk->type) != CV_32FC1 && CV_MAT_TYPE(dpdk->type) != CV_64FC1) ||
dpdk->rows != count*2 || (dpdk->cols != 14 && dpdk->cols != 12 && dpdk->cols != 8 && dpdk->cols != 5 && dpdk->cols != 4 && dpdk->cols != 2) )
CV_Error( CV_StsBadArg, "dp/df must be 2Nx14, 2Nx12, 2Nx8, 2Nx5, 2Nx4 or 2Nx2 floating-point matrix" );
CV_Error( cv::Error::StsBadArg, "dp/df must be 2Nx14, 2Nx12, 2Nx8, 2Nx5, 2Nx4 or 2Nx2 floating-point matrix" );
if( !distCoeffs )
CV_Error( CV_StsNullPtr, "distCoeffs is NULL while dpdk is not" );
CV_Error( cv::Error::StsNullPtr, "distCoeffs is NULL while dpdk is not" );
if( CV_MAT_TYPE(dpdk->type) == CV_64FC1 )
{
@@ -756,7 +756,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
if( !CV_IS_MAT( dpdo ) || ( CV_MAT_TYPE( dpdo->type ) != CV_32FC1
&& CV_MAT_TYPE( dpdo->type ) != CV_64FC1 )
|| dpdo->rows != count * 2 || dpdo->cols != count * 3 )
CV_Error( CV_StsBadArg, "dp/do must be 2Nx3N floating-point matrix" );
CV_Error( cv::Error::StsBadArg, "dp/do must be 2Nx3N floating-point matrix" );
if( CV_MAT_TYPE( dpdo->type ) == CV_64FC1 )
{
@@ -1283,10 +1283,10 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints,
CV_MAT_TYPE(objectPoints->type) != CV_64FC3) ||
(CV_MAT_TYPE(imagePoints->type) != CV_32FC2 &&
CV_MAT_TYPE(imagePoints->type) != CV_64FC2) )
CV_Error( CV_StsUnsupportedFormat, "Both object points and image points must be 2D" );
CV_Error( cv::Error::StsUnsupportedFormat, "Both object points and image points must be 2D" );
if( objectPoints->rows != 1 || imagePoints->rows != 1 )
CV_Error( CV_StsBadSize, "object points and image points must be a single-row matrices" );
CV_Error( cv::Error::StsBadSize, "object points and image points must be a single-row matrices" );
matA.reset(cvCreateMat( 2*nimages, 2, CV_64F ));
_b.reset(cvCreateMat( 2*nimages, 1, CV_64F ));
@@ -1395,27 +1395,27 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
// 0. check the parameters & allocate buffers
if( !CV_IS_MAT(objectPoints) || !CV_IS_MAT(imagePoints) ||
!CV_IS_MAT(npoints) || !CV_IS_MAT(cameraMatrix) || !CV_IS_MAT(distCoeffs) )
CV_Error( CV_StsBadArg, "One of required vector arguments is not a valid matrix" );
CV_Error( cv::Error::StsBadArg, "One of required vector arguments is not a valid matrix" );
if( imageSize.width <= 0 || imageSize.height <= 0 )
CV_Error( CV_StsOutOfRange, "image width and height must be positive" );
CV_Error( cv::Error::StsOutOfRange, "image width and height must be positive" );
if( CV_MAT_TYPE(npoints->type) != CV_32SC1 ||
(npoints->rows != 1 && npoints->cols != 1) )
CV_Error( CV_StsUnsupportedFormat,
CV_Error( cv::Error::StsUnsupportedFormat,
"the array of point counters must be 1-dimensional integer vector" );
if(flags & CALIB_TILTED_MODEL)
{
//when the tilted sensor model is used the distortion coefficients matrix must have 14 parameters
if (distCoeffs->cols*distCoeffs->rows != 14)
CV_Error( CV_StsBadArg, "The tilted sensor model must have 14 parameters in the distortion matrix" );
CV_Error( cv::Error::StsBadArg, "The tilted sensor model must have 14 parameters in the distortion matrix" );
}
else
{
//when the thin prism model is used the distortion coefficients matrix must have 12 parameters
if(flags & CALIB_THIN_PRISM_MODEL)
if (distCoeffs->cols*distCoeffs->rows != 12)
CV_Error( CV_StsBadArg, "Thin prism model must have 12 parameters in the distortion matrix" );
CV_Error( cv::Error::StsBadArg, "Thin prism model must have 12 parameters in the distortion matrix" );
}
nimages = npoints->rows*npoints->cols;
@@ -1428,7 +1428,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
(CV_MAT_DEPTH(rvecs->type) != CV_32F && CV_MAT_DEPTH(rvecs->type) != CV_64F) ||
((rvecs->rows != nimages || (rvecs->cols*cn != 3 && rvecs->cols*cn != 9)) &&
(rvecs->rows != 1 || rvecs->cols != nimages || cn != 3)) )
CV_Error( CV_StsBadArg, "the output array of rotation vectors must be 3-channel "
CV_Error( cv::Error::StsBadArg, "the output array of rotation vectors must be 3-channel "
"1xn or nx1 array or 1-channel nx3 or nx9 array, where n is the number of views" );
}
@@ -1439,7 +1439,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
(CV_MAT_DEPTH(tvecs->type) != CV_32F && CV_MAT_DEPTH(tvecs->type) != CV_64F) ||
((tvecs->rows != nimages || tvecs->cols*cn != 3) &&
(tvecs->rows != 1 || tvecs->cols != nimages || cn != 3)) )
CV_Error( CV_StsBadArg, "the output array of translation vectors must be 3-channel "
CV_Error( cv::Error::StsBadArg, "the output array of translation vectors must be 3-channel "
"1xn or nx1 array or 1-channel nx3 array, where n is the number of views" );
}
@@ -1454,7 +1454,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
(stdDevs->rows != 1 || stdDevs->cols != (nimages*6 + NINTRINSIC) || cn != 1)) )
#define STR__(x) #x
#define STR_(x) STR__(x)
CV_Error( CV_StsBadArg, "the output array of standard deviations vectors must be 1-channel "
CV_Error( cv::Error::StsBadArg, "the output array of standard deviations vectors must be 1-channel "
"1x(n*6 + NINTRINSIC) or (n*6 + NINTRINSIC)x1 array, where n is the number of views,"
" NINTRINSIC = " STR_(CV_CALIB_NINTRINSIC));
}
@@ -1462,7 +1462,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
if( (CV_MAT_TYPE(cameraMatrix->type) != CV_32FC1 &&
CV_MAT_TYPE(cameraMatrix->type) != CV_64FC1) ||
cameraMatrix->rows != 3 || cameraMatrix->cols != 3 )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"Intrinsic parameters must be 3x3 floating-point matrix" );
if( (CV_MAT_TYPE(distCoeffs->type) != CV_32FC1 &&
@@ -1473,14 +1473,14 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
distCoeffs->cols*distCoeffs->rows != 8 &&
distCoeffs->cols*distCoeffs->rows != 12 &&
distCoeffs->cols*distCoeffs->rows != 14) )
CV_Error( CV_StsBadArg, cvDistCoeffErr );
CV_Error( cv::Error::StsBadArg, cvDistCoeffErr );
for( i = 0; i < nimages; i++ )
{
ni = npoints->data.i[i*npstep];
if( ni < 4 )
{
CV_Error_( CV_StsOutOfRange, ("The number of points in the view #%d is < 4", i));
CV_Error_( cv::Error::StsOutOfRange, ("The number of points in the view #%d is < 4", i));
}
maxPoints = MAX( maxPoints, ni );
total += ni;
@@ -1493,7 +1493,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
(CV_MAT_DEPTH(newObjPoints->type) != CV_32F && CV_MAT_DEPTH(newObjPoints->type) != CV_64F) ||
((newObjPoints->rows != maxPoints || newObjPoints->cols*cn != 3) &&
(newObjPoints->rows != 1 || newObjPoints->cols != maxPoints || cn != 3)) )
CV_Error( CV_StsBadArg, "the output array of refined object points must be 3-channel "
CV_Error( cv::Error::StsBadArg, "the output array of refined object points must be 3-channel "
"1xn or nx1 array or 1-channel nx3 array, where n is the number of object points per view" );
}
@@ -1504,7 +1504,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
(CV_MAT_DEPTH(stdDevs->type) != CV_32F && CV_MAT_DEPTH(stdDevs->type) != CV_64F) ||
((stdDevs->rows != (nimages*6 + NINTRINSIC + maxPoints*3) || stdDevs->cols*cn != 1) &&
(stdDevs->rows != 1 || stdDevs->cols != (nimages*6 + NINTRINSIC + maxPoints*3) || cn != 1)) )
CV_Error( CV_StsBadArg, "the output array of standard deviations vectors must be 1-channel "
CV_Error( cv::Error::StsBadArg, "the output array of standard deviations vectors must be 1-channel "
"1x(n*6 + NINTRINSIC + m*3) or (n*6 + NINTRINSIC + m*3)x1 array, where n is the number of views,"
" NINTRINSIC = " STR_(CV_CALIB_NINTRINSIC) ", m is the number of object points per view");
}
@@ -1544,15 +1544,15 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
{
cvConvert( cameraMatrix, &matA );
if( A(0, 0) <= 0 || A(1, 1) <= 0 )
CV_Error( CV_StsOutOfRange, "Focal length (fx and fy) must be positive" );
CV_Error( cv::Error::StsOutOfRange, "Focal length (fx and fy) must be positive" );
if( A(0, 2) < 0 || A(0, 2) >= imageSize.width ||
A(1, 2) < 0 || A(1, 2) >= imageSize.height )
CV_Error( CV_StsOutOfRange, "Principal point must be within the image" );
CV_Error( cv::Error::StsOutOfRange, "Principal point must be within the image" );
if( fabs(A(0, 1)) > 1e-5 )
CV_Error( CV_StsOutOfRange, "Non-zero skew is not supported by the function" );
CV_Error( cv::Error::StsOutOfRange, "Non-zero skew is not supported by the function" );
if( fabs(A(1, 0)) > 1e-5 || fabs(A(2, 0)) > 1e-5 ||
fabs(A(2, 1)) > 1e-5 || fabs(A(2,2)-1) > 1e-5 )
CV_Error( CV_StsOutOfRange,
CV_Error( cv::Error::StsOutOfRange,
"The intrinsic matrix must have [fx 0 cx; 0 fy cy; 0 0 1] shape" );
A(0, 1) = A(1, 0) = A(2, 0) = A(2, 1) = 0.;
A(2, 2) = 1.;
@@ -1562,7 +1562,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
aspectRatio = A(0, 0)/A(1, 1);
if( aspectRatio < minValidAspectRatio || aspectRatio > maxValidAspectRatio )
CV_Error( CV_StsOutOfRange,
CV_Error( cv::Error::StsOutOfRange,
"The specified aspect ratio (= cameraMatrix[0][0] / cameraMatrix[1][1]) is incorrect" );
}
cvConvert( distCoeffs, &_k );
@@ -1572,7 +1572,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
Scalar mean, sdv;
meanStdDev(matM, mean, sdv);
if( fabs(mean[2]) > 1e-5 || fabs(sdv[2]) > 1e-5 )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"For non-planar calibration rigs the initial intrinsic matrix must be specified" );
for( i = 0; i < total; i++ )
matM.at<Point3d>(i).z = 0.;
@@ -1582,7 +1582,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
aspectRatio = cvmGet(cameraMatrix,0,0);
aspectRatio /= cvmGet(cameraMatrix,1,1);
if( aspectRatio < minValidAspectRatio || aspectRatio > maxValidAspectRatio )
CV_Error( CV_StsOutOfRange,
CV_Error( cv::Error::StsOutOfRange,
"The specified aspect ratio (= cameraMatrix[0][0] / cameraMatrix[1][1]) is incorrect" );
}
CvMat _matM = cvMat(matM), m = cvMat(_m);
@@ -1673,7 +1673,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
Mat mask = cvarrToMat(solver.mask);
int nparams_nz = countNonZero(mask);
if (nparams_nz >= 2 * total)
CV_Error_(CV_StsBadArg,
CV_Error_(cv::Error::StsBadArg,
("There should be less vars to optimize (having %d) than the number of residuals (%d = 2 per point)", nparams_nz, 2 * total));
// 2. initialize extrinsic parameters
@@ -1889,10 +1889,10 @@ CV_IMPL double cvCalibrateCamera4( const CvMat* objectPoints,
CvMat* rvecs, CvMat* tvecs, CvMat* newObjPoints, int flags, CvTermCriteria termCrit )
{
if( !CV_IS_MAT(npoints) )
CV_Error( CV_StsBadArg, "npoints is not a valid matrix" );
CV_Error( cv::Error::StsBadArg, "npoints is not a valid matrix" );
if( CV_MAT_TYPE(npoints->type) != CV_32SC1 ||
(npoints->rows != 1 && npoints->cols != 1) )
CV_Error( CV_StsUnsupportedFormat,
CV_Error( cv::Error::StsUnsupportedFormat,
"the array of point counters must be 1-dimensional integer vector" );
bool releaseObject = iFixedPoint > 0 && iFixedPoint < npoints->data.i[0] - 1;
@@ -1903,7 +1903,7 @@ CV_IMPL double cvCalibrateCamera4( const CvMat* objectPoints,
if( releaseObject )
{
if( !CV_IS_MAT(objectPoints) )
CV_Error( CV_StsBadArg, "objectPoints is not a valid matrix" );
CV_Error( cv::Error::StsBadArg, "objectPoints is not a valid matrix" );
Mat matM;
if(CV_MAT_CN(objectPoints->type) == 3) {
matM = cvarrToMat(objectPoints);
@@ -1917,14 +1917,14 @@ CV_IMPL double cvCalibrateCamera4( const CvMat* objectPoints,
{
if( npoints->data.i[i * npstep] != ni )
{
CV_Error( CV_StsBadArg, "All objectPoints[i].size() should be equal when "
CV_Error( cv::Error::StsBadArg, "All objectPoints[i].size() should be equal when "
"object-releasing method is requested." );
}
Mat ocmp = matM.colRange(ni * i, ni * i + ni) != matM.colRange(0, ni);
ocmp = ocmp.reshape(1);
if( countNonZero(ocmp) )
{
CV_Error( CV_StsBadArg, "All objectPoints[i] should be identical when object-releasing"
CV_Error( cv::Error::StsBadArg, "All objectPoints[i] should be identical when object-releasing"
" method is requested." );
}
}
@@ -1941,10 +1941,10 @@ void cvCalibrationMatrixValues( const CvMat *calibMatr, CvSize imgSize,
{
/* Validate parameters. */
if(calibMatr == 0)
CV_Error(CV_StsNullPtr, "Some of parameters is a NULL pointer!");
CV_Error(cv::Error::StsNullPtr, "Some of parameters is a NULL pointer!");
if(!CV_IS_MAT(calibMatr))
CV_Error(CV_StsUnsupportedFormat, "Input parameters must be matrices!");
CV_Error(cv::Error::StsUnsupportedFormat, "Input parameters must be matrices!");
double dummy = .0;
Point2d pp;
@@ -2023,7 +2023,7 @@ static double cvStereoCalibrateImpl( const CvMat* _objectPoints, const CvMat* _i
(CV_MAT_DEPTH(rvecs->type) != CV_32F && CV_MAT_DEPTH(rvecs->type) != CV_64F) ||
((rvecs->rows != nimages || (rvecs->cols*cn != 3 && rvecs->cols*cn != 9)) &&
(rvecs->rows != 1 || rvecs->cols != nimages || cn != 3)) )
CV_Error( CV_StsBadArg, "the output array of rotation vectors must be 3-channel "
CV_Error( cv::Error::StsBadArg, "the output array of rotation vectors must be 3-channel "
"1xn or nx1 array or 1-channel nx3 or nx9 array, where n is the number of views" );
}
@@ -2034,7 +2034,7 @@ static double cvStereoCalibrateImpl( const CvMat* _objectPoints, const CvMat* _i
(CV_MAT_DEPTH(tvecs->type) != CV_32F && CV_MAT_DEPTH(tvecs->type) != CV_64F) ||
((tvecs->rows != nimages || tvecs->cols*cn != 3) &&
(tvecs->rows != 1 || tvecs->cols != nimages || cn != 3)) )
CV_Error( CV_StsBadArg, "the output array of translation vectors must be 3-channel "
CV_Error( cv::Error::StsBadArg, "the output array of translation vectors must be 3-channel "
"1xn or nx1 array or 1-channel nx3 array, where n is the number of views" );
}
@@ -3344,19 +3344,19 @@ cvDecomposeProjectionMatrix( const CvMat *projMatr, CvMat *calibMatr,
/* Validate parameters. */
if(projMatr == 0 || calibMatr == 0 || rotMatr == 0 || posVect == 0)
CV_Error(CV_StsNullPtr, "Some of parameters is a NULL pointer!");
CV_Error(cv::Error::StsNullPtr, "Some of parameters is a NULL pointer!");
if(!CV_IS_MAT(projMatr) || !CV_IS_MAT(calibMatr) || !CV_IS_MAT(rotMatr) || !CV_IS_MAT(posVect))
CV_Error(CV_StsUnsupportedFormat, "Input parameters must be matrices!");
CV_Error(cv::Error::StsUnsupportedFormat, "Input parameters must be matrices!");
if(projMatr->cols != 4 || projMatr->rows != 3)
CV_Error(CV_StsUnmatchedSizes, "Size of projection matrix must be 3x4!");
CV_Error(cv::Error::StsUnmatchedSizes, "Size of projection matrix must be 3x4!");
if(calibMatr->cols != 3 || calibMatr->rows != 3 || rotMatr->cols != 3 || rotMatr->rows != 3)
CV_Error(CV_StsUnmatchedSizes, "Size of calibration and rotation matrices must be 3x3!");
CV_Error(cv::Error::StsUnmatchedSizes, "Size of calibration and rotation matrices must be 3x3!");
if(posVect->cols != 1 || posVect->rows != 4)
CV_Error(CV_StsUnmatchedSizes, "Size of position vector must be 4x1!");
CV_Error(cv::Error::StsUnmatchedSizes, "Size of position vector must be 4x1!");
/* Compute position vector. */
cvSetZero(&tmpProjMatr); // Add zero row to make matrix square.
@@ -3402,17 +3402,17 @@ static void collectCalibrationData( InputArrayOfArrays objectPoints,
{
Mat objectPoint = objectPoints.getMat(i);
if (objectPoint.empty())
CV_Error(CV_StsBadSize, "objectPoints should not contain empty vector of vectors of points");
CV_Error(cv::Error::StsBadSize, "objectPoints should not contain empty vector of vectors of points");
int numberOfObjectPoints = objectPoint.checkVector(3, CV_32F);
if (numberOfObjectPoints <= 0)
CV_Error(CV_StsUnsupportedFormat, "objectPoints should contain vector of vectors of points of type Point3f");
CV_Error(cv::Error::StsUnsupportedFormat, "objectPoints should contain vector of vectors of points of type Point3f");
Mat imagePoint1 = imagePoints1.getMat(i);
if (imagePoint1.empty())
CV_Error(CV_StsBadSize, "imagePoints1 should not contain empty vector of vectors of points");
CV_Error(cv::Error::StsBadSize, "imagePoints1 should not contain empty vector of vectors of points");
int numberOfImagePoints = imagePoint1.checkVector(2, CV_32F);
if (numberOfImagePoints <= 0)
CV_Error(CV_StsUnsupportedFormat, "imagePoints1 should contain vector of vectors of points of type Point2f");
CV_Error(cv::Error::StsUnsupportedFormat, "imagePoints1 should contain vector of vectors of points of type Point2f");
CV_CheckEQ(numberOfObjectPoints, numberOfImagePoints, "Number of object and image points must be equal");
total += numberOfObjectPoints;
@@ -3467,14 +3467,14 @@ static void collectCalibrationData( InputArrayOfArrays objectPoints,
{
if( npoints.at<int>(i) != ni )
{
CV_Error( CV_StsBadArg, "All objectPoints[i].size() should be equal when "
CV_Error( cv::Error::StsBadArg, "All objectPoints[i].size() should be equal when "
"object-releasing method is requested." );
}
Mat ocmp = objPtMat.colRange(ni * i, ni * i + ni) != objPtMat.colRange(0, ni);
ocmp = ocmp.reshape(1);
if( countNonZero(ocmp) )
{
CV_Error( CV_StsBadArg, "All objectPoints[i] should be identical when object-releasing"
CV_Error( cv::Error::StsBadArg, "All objectPoints[i] should be identical when object-releasing"
" method is requested." );
}
}
@@ -3884,7 +3884,7 @@ void cv::calibrationMatrixValues( InputArray _cameraMatrix, Size imageSize,
CV_INSTRUMENT_REGION();
if(_cameraMatrix.size() != Size(3, 3))
CV_Error(CV_StsUnmatchedSizes, "Size of cameraMatrix must be 3x3!");
CV_Error(cv::Error::StsUnmatchedSizes, "Size of cameraMatrix must be 3x3!");
Matx33d K = _cameraMatrix.getMat();
+1 -1
View File
@@ -1041,7 +1041,7 @@ int solvePnPGeneric( InputArray _opoints, InputArray _ipoints,
vec_tvecs.push_back(tvec);
}*/
else
CV_Error(CV_StsBadArg, "The flags argument must be one of SOLVEPNP_ITERATIVE, SOLVEPNP_P3P, "
CV_Error(cv::Error::StsBadArg, "The flags argument must be one of SOLVEPNP_ITERATIVE, SOLVEPNP_P3P, "
"SOLVEPNP_EPNP, SOLVEPNP_DLS, SOLVEPNP_UPNP, SOLVEPNP_AP3P, SOLVEPNP_IPPE, SOLVEPNP_IPPE_SQUARE or SOLVEPNP_SQPNP");
CV_Assert(vec_rvecs.size() == vec_tvecs.size());
+17 -17
View File
@@ -56,30 +56,30 @@ icvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2, CvMat* projPoints1, CvM
if( projMatr1 == 0 || projMatr2 == 0 ||
projPoints1 == 0 || projPoints2 == 0 ||
points4D == 0)
CV_Error( CV_StsNullPtr, "Some of parameters is a NULL pointer" );
CV_Error( cv::Error::StsNullPtr, "Some of parameters is a NULL pointer" );
if( !CV_IS_MAT(projMatr1) || !CV_IS_MAT(projMatr2) ||
!CV_IS_MAT(projPoints1) || !CV_IS_MAT(projPoints2) ||
!CV_IS_MAT(points4D) )
CV_Error( CV_StsUnsupportedFormat, "Input parameters must be matrices" );
CV_Error( cv::Error::StsUnsupportedFormat, "Input parameters must be matrices" );
int numPoints = projPoints1->cols;
if( numPoints < 1 )
CV_Error( CV_StsOutOfRange, "Number of points must be more than zero" );
CV_Error( cv::Error::StsOutOfRange, "Number of points must be more than zero" );
if( projPoints2->cols != numPoints || points4D->cols != numPoints )
CV_Error( CV_StsUnmatchedSizes, "Number of points must be the same" );
CV_Error( cv::Error::StsUnmatchedSizes, "Number of points must be the same" );
if( projPoints1->rows != 2 || projPoints2->rows != 2)
CV_Error( CV_StsUnmatchedSizes, "Number of proj points coordinates must be == 2" );
CV_Error( cv::Error::StsUnmatchedSizes, "Number of proj points coordinates must be == 2" );
if( points4D->rows != 4 )
CV_Error( CV_StsUnmatchedSizes, "Number of world points coordinates must be == 4" );
CV_Error( cv::Error::StsUnmatchedSizes, "Number of world points coordinates must be == 4" );
if( projMatr1->cols != 4 || projMatr1->rows != 3 ||
projMatr2->cols != 4 || projMatr2->rows != 3)
CV_Error( CV_StsUnmatchedSizes, "Size of projection matrices must be 3x4" );
CV_Error( cv::Error::StsUnmatchedSizes, "Size of projection matrices must be 3x4" );
// preallocate SVD matrices on stack
cv::Matx<double, 4, 4> matrA;
@@ -147,30 +147,30 @@ icvCorrectMatches(CvMat *F_, CvMat *points1_, CvMat *points2_, CvMat *new_points
cv::Ptr<CvMat> F;
if (!CV_IS_MAT(F_) || !CV_IS_MAT(points1_) || !CV_IS_MAT(points2_) )
CV_Error( CV_StsUnsupportedFormat, "Input parameters must be matrices" );
CV_Error( cv::Error::StsUnsupportedFormat, "Input parameters must be matrices" );
if (!( F_->cols == 3 && F_->rows == 3))
CV_Error( CV_StsUnmatchedSizes, "The fundamental matrix must be a 3x3 matrix");
CV_Error( cv::Error::StsUnmatchedSizes, "The fundamental matrix must be a 3x3 matrix");
if (!(((F_->type & CV_MAT_TYPE_MASK) >> 3) == 0 ))
CV_Error( CV_StsUnsupportedFormat, "The fundamental matrix must be a single-channel matrix" );
CV_Error( cv::Error::StsUnsupportedFormat, "The fundamental matrix must be a single-channel matrix" );
if (!(points1_->rows == 1 && points2_->rows == 1 && points1_->cols == points2_->cols))
CV_Error( CV_StsUnmatchedSizes, "The point-matrices must have one row, and an equal number of columns" );
CV_Error( cv::Error::StsUnmatchedSizes, "The point-matrices must have one row, and an equal number of columns" );
if (((points1_->type & CV_MAT_TYPE_MASK) >> 3) != 1 )
CV_Error( CV_StsUnmatchedSizes, "The first set of points must contain two channels; one for x and one for y" );
CV_Error( cv::Error::StsUnmatchedSizes, "The first set of points must contain two channels; one for x and one for y" );
if (((points2_->type & CV_MAT_TYPE_MASK) >> 3) != 1 )
CV_Error( CV_StsUnmatchedSizes, "The second set of points must contain two channels; one for x and one for y" );
CV_Error( cv::Error::StsUnmatchedSizes, "The second set of points must contain two channels; one for x and one for y" );
if (new_points1 != NULL) {
CV_Assert(CV_IS_MAT(new_points1));
if (new_points1->cols != points1_->cols || new_points1->rows != 1)
CV_Error( CV_StsUnmatchedSizes, "The first output matrix must have the same dimensions as the input matrices" );
CV_Error( cv::Error::StsUnmatchedSizes, "The first output matrix must have the same dimensions as the input matrices" );
if (CV_MAT_CN(new_points1->type) != 2)
CV_Error( CV_StsUnsupportedFormat, "The first output matrix must have two channels; one for x and one for y" );
CV_Error( cv::Error::StsUnsupportedFormat, "The first output matrix must have two channels; one for x and one for y" );
}
if (new_points2 != NULL) {
CV_Assert(CV_IS_MAT(new_points2));
if (new_points2->cols != points2_->cols || new_points2->rows != 1)
CV_Error( CV_StsUnmatchedSizes, "The second output matrix must have the same dimensions as the input matrices" );
CV_Error( cv::Error::StsUnmatchedSizes, "The second output matrix must have the same dimensions as the input matrices" );
if (CV_MAT_CN(new_points2->type) != 2)
CV_Error( CV_StsUnsupportedFormat, "The second output matrix must have two channels; one for x and one for y" );
CV_Error( cv::Error::StsUnsupportedFormat, "The second output matrix must have two channels; one for x and one for y" );
}
// Make sure F uses double precision
@@ -149,49 +149,49 @@ void CV_CameraCalibrationBadArgTest::run( int /* start_from */ )
caller.initArgs();
caller.objPts_arg = noArray();
errors += run_test_case( CV_StsBadArg, "None passed in objPts", caller);
errors += run_test_case( cv::Error::StsBadArg, "None passed in objPts", caller);
caller.initArgs();
caller.imgPts_arg = noArray();
errors += run_test_case( CV_StsBadArg, "None passed in imgPts", caller );
errors += run_test_case( cv::Error::StsBadArg, "None passed in imgPts", caller );
caller.initArgs();
caller.cameraMatrix_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Zero passed in cameraMatrix", caller );
errors += run_test_case( cv::Error::StsBadArg, "Zero passed in cameraMatrix", caller );
caller.initArgs();
caller.distCoeffs_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Zero passed in distCoeffs", caller );
errors += run_test_case( cv::Error::StsBadArg, "Zero passed in distCoeffs", caller );
caller.initArgs();
caller.imageSize.width = -1;
errors += run_test_case( CV_StsOutOfRange, "Bad image width", caller );
errors += run_test_case( cv::Error::StsOutOfRange, "Bad image width", caller );
caller.initArgs();
caller.imageSize.height = -1;
errors += run_test_case( CV_StsOutOfRange, "Bad image height", caller );
errors += run_test_case( cv::Error::StsOutOfRange, "Bad image height", caller );
caller.initArgs();
caller.imgPts[0].clear();
errors += run_test_case( CV_StsBadSize, "Bad imgpts[0]", caller );
errors += run_test_case( cv::Error::StsBadSize, "Bad imgpts[0]", caller );
caller.imgPts[0] = caller.imgPts[1];
caller.initArgs();
caller.objPts[1].clear();
errors += run_test_case( CV_StsBadSize, "Bad objpts[1]", caller );
errors += run_test_case( cv::Error::StsBadSize, "Bad objpts[1]", caller );
caller.objPts[1] = caller.objPts[0];
caller.initArgs();
Mat badCM = Mat::zeros(4, 4, CV_64F);
caller.cameraMatrix_arg = badCM;
caller.flags = CALIB_USE_INTRINSIC_GUESS;
errors += run_test_case( CV_StsBadArg, "Bad camearaMatrix header", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad camearaMatrix header", caller );
caller.initArgs();
Mat badDC = Mat::zeros(10, 10, CV_64F);
caller.distCoeffs_arg = badDC;
caller.flags = CALIB_USE_INTRINSIC_GUESS;
errors += run_test_case( CV_StsBadArg, "Bad camearaMatrix header", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad camearaMatrix header", caller );
if (errors)
ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
@@ -244,15 +244,15 @@ protected:
caller.initArgs();
caller.src_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Src is empty matrix", caller );
errors += run_test_case( cv::Error::StsBadArg, "Src is empty matrix", caller );
caller.initArgs();
caller.src = Mat::zeros(3, 1, CV_8U);
errors += run_test_case( CV_StsUnsupportedFormat, "Bad src formart", caller );
errors += run_test_case( cv::Error::StsUnsupportedFormat, "Bad src formart", caller );
caller.initArgs();
caller.src = Mat::zeros(1, 1, CV_32F);
errors += run_test_case( CV_StsBadSize, "Bad src size", caller );
errors += run_test_case( cv::Error::StsBadSize, "Bad src size", caller );
if (errors)
ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
@@ -331,57 +331,57 @@ protected:
caller.initArgs();
caller.objectPoints_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Zero objectPoints", caller );
errors += run_test_case( cv::Error::StsBadArg, "Zero objectPoints", caller );
caller.initArgs();
caller.rvec_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Zero r_vec", caller );
errors += run_test_case( cv::Error::StsBadArg, "Zero r_vec", caller );
caller.initArgs();
caller.tvec_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Zero t_vec", caller );
errors += run_test_case( cv::Error::StsBadArg, "Zero t_vec", caller );
caller.initArgs();
caller.A_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Zero camMat", caller );
errors += run_test_case( cv::Error::StsBadArg, "Zero camMat", caller );
caller.initArgs();
caller.imagePoints_arg = noArray();
errors += run_test_case( CV_StsBadArg, "Zero imagePoints", caller );
errors += run_test_case( cv::Error::StsBadArg, "Zero imagePoints", caller );
Mat save_rvec = caller.r_vec;
caller.initArgs();
caller.r_vec.create(2, 2, CV_32F);
errors += run_test_case( CV_StsBadArg, "Bad rvec format", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad rvec format", caller );
caller.initArgs();
caller.r_vec.create(1, 3, CV_8U);
errors += run_test_case( CV_StsBadArg, "Bad rvec format", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad rvec format", caller );
caller.r_vec = save_rvec;
/****************************/
Mat save_tvec = caller.t_vec;
caller.initArgs();
caller.t_vec.create(3, 3, CV_32F);
errors += run_test_case( CV_StsBadArg, "Bad tvec format", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad tvec format", caller );
caller.initArgs();
caller.t_vec.create(1, 3, CV_8U);
errors += run_test_case( CV_StsBadArg, "Bad tvec format", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad tvec format", caller );
caller.t_vec = save_tvec;
/****************************/
Mat save_A = caller.A;
caller.initArgs();
caller.A.create(2, 2, CV_32F);
errors += run_test_case( CV_StsBadArg, "Bad A format", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad A format", caller );
caller.A = save_A;
/****************************/
Mat save_DC = caller.distCoeffs;
caller.initArgs();
caller.distCoeffs.create(3, 3, CV_32F);
errors += run_test_case( CV_StsBadArg, "Bad distCoeffs format", caller );
errors += run_test_case( cv::Error::StsBadArg, "Bad distCoeffs format", caller );
caller.distCoeffs = save_DC;
if (errors)
@@ -106,15 +106,15 @@ void CV_UndistortPointsBadArgTest::run(int)
src_points = cv::cvarrToMat(&_src_points_orig);
src_points.create(2, 2, CV_32FC2);
errcount += run_test_case( CV_StsAssert, "Invalid input data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid input data matrix size" );
src_points = cv::cvarrToMat(&_src_points_orig);
src_points.create(1, 4, CV_64FC2);
errcount += run_test_case( CV_StsAssert, "Invalid input data matrix type" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid input data matrix type" );
src_points = cv::cvarrToMat(&_src_points_orig);
src_points = cv::Mat();
errcount += run_test_case( CV_StsBadArg, "Input data matrix is not continuous" );
errcount += run_test_case( cv::Error::StsBadArg, "Input data matrix is not continuous" );
src_points = cv::cvarrToMat(&_src_points_orig);
//------------
@@ -181,19 +181,19 @@ void CV_InitUndistortRectifyMapBadArgTest::run(int)
mapy = cv::cvarrToMat(&_mapy_orig);
mat_type = CV_64F;
errcount += run_test_case( CV_StsAssert, "Invalid map matrix type" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid map matrix type" );
mat_type = mat_type_orig;
camera_mat.create(3, 2, CV_32F);
errcount += run_test_case( CV_StsAssert, "Invalid camera data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid camera data matrix size" );
camera_mat = cv::cvarrToMat(&_camera_mat_orig);
R.create(4, 3, CV_32F);
errcount += run_test_case( CV_StsAssert, "Invalid R data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid R data matrix size" );
R = cv::cvarrToMat(&_R_orig);
distortion_coeffs.create(6, 1, CV_32F);
errcount += run_test_case( CV_StsAssert, "Invalid distortion coefficients data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid distortion coefficients data matrix size" );
distortion_coeffs = cv::cvarrToMat(&_distortion_coeffs_orig);
//------------
@@ -256,7 +256,7 @@ void CV_UndistortBadArgTest::run(int)
dst = cv::cvarrToMat(&_dst_orig);
camera_mat.create(5, 5, CV_64F);
errcount += run_test_case( CV_StsAssert, "Invalid camera data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid camera data matrix size" );
//------------
ts->set_failed_test_info(errcount > 0 ? cvtest::TS::FAIL_BAD_ARG_CHECK : cvtest::TS::OK);
+1 -1
View File
@@ -70,7 +70,7 @@ namespace cv {
static void* OutOfMemoryError(size_t size)
{
CV_Error_(CV_StsNoMem, ("Failed to allocate %llu bytes", (unsigned long long)size));
CV_Error_(cv::Error::StsNoMem, ("Failed to allocate %llu bytes", (unsigned long long)size));
}
CV_EXPORTS cv::utils::AllocatorStatisticsInterface& getAllocatorStatistics();
+8 -8
View File
@@ -209,7 +209,7 @@ static void binary_op( InputArray _src1, InputArray _src2, OutputArray _dst,
swap(sz1, sz2);
}
else if( !checkScalar(*psrc2, type1, kind2, kind1) )
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"The operation is neither 'array op array' (where arrays have the same size and type), "
"nor 'array op scalar', nor 'scalar op array'" );
haveScalar = true;
@@ -644,7 +644,7 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
oclop = OCL_OP_RDIV_SCALE;
}
else if( !checkScalar(*psrc2, type1, kind2, kind1) )
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"The operation is neither 'array op array' "
"(where arrays have the same size and the same number of channels), "
"nor 'array op scalar', nor 'scalar op array'" );
@@ -669,7 +669,7 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
else
{
if( !haveScalar && type1 != type2 )
CV_Error(CV_StsBadArg,
CV_Error(cv::Error::StsBadArg,
"When the input arrays in add/subtract/multiply/divide functions have different types, "
"the output array type must be explicitly specified");
dtype = type1;
@@ -1206,7 +1206,7 @@ void cv::compare(InputArray _src1, InputArray _src2, OutputArray _dst, int op)
return;
}
else if(is_src1_scalar == is_src2_scalar)
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"The operation is neither 'array op array' (where arrays have the same size and the same type), "
"nor 'array op scalar', nor 'scalar op array'" );
haveScalar = true;
@@ -1615,7 +1615,7 @@ static bool ocl_inRange( InputArray _src, InputArray _lowerb,
ssize != lsize || stype != ltype )
{
if( !checkScalar(_lowerb, stype, lkind, skind) )
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"The lower boundary is neither an array of the same size and same type as src, nor a scalar");
lbScalar = true;
}
@@ -1624,7 +1624,7 @@ static bool ocl_inRange( InputArray _src, InputArray _lowerb,
ssize != usize || stype != utype )
{
if( !checkScalar(_upperb, stype, ukind, skind) )
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"The upper boundary is neither an array of the same size and same type as src, nor a scalar");
ubScalar = true;
}
@@ -1738,7 +1738,7 @@ void cv::inRange(InputArray _src, InputArray _lowerb,
src.size != lb.size || src.type() != lb.type() )
{
if( !checkScalar(lb, src.type(), lkind, skind) )
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"The lower boundary is neither an array of the same size and same type as src, nor a scalar");
lbScalar = true;
}
@@ -1747,7 +1747,7 @@ void cv::inRange(InputArray _src, InputArray _lowerb,
src.size != ub.size || src.type() != ub.type() )
{
if( !checkScalar(ub, src.type(), ukind, skind) )
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"The upper boundary is neither an array of the same size and same type as src, nor a scalar");
ubScalar = true;
}
+160 -160
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -377,7 +377,7 @@ void cv::batchDistance( InputArray _src1, InputArray _src2,
}
if( func == 0 )
CV_Error_(CV_StsUnsupportedFormat,
CV_Error_(cv::Error::StsUnsupportedFormat,
("The combination of type=%d, dtype=%d and normType=%d is not supported",
type, dtype, normType));
+3 -3
View File
@@ -464,7 +464,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
{
if (begin == true)
{
throw cv::Exception(CV_StsParseError,
throw cv::Exception(cv::Error::StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -484,7 +484,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
{
if (begin == false)
{
throw cv::Exception(CV_StsParseError,
throw cv::Exception(cv::Error::StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -508,7 +508,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
if (begin == true)
{
throw cv::Exception(CV_StsParseError,
throw cv::Exception(cv::Error::StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
+2 -2
View File
@@ -96,7 +96,7 @@ void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to)
scalarToRawData_<float16_t>(s, (float16_t*)_buf, cn, unroll_to);
break;
default:
CV_Error(CV_StsUnsupportedFormat,"");
CV_Error(cv::Error::StsUnsupportedFormat,"");
}
}
@@ -788,7 +788,7 @@ int cv::borderInterpolate( int p, int len, int borderType )
else if( borderType == BORDER_CONSTANT )
p = -1;
else
CV_Error( CV_StsBadArg, "Unknown/unsupported border type" );
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported border type" );
return p;
}
+107 -107
View File
@@ -91,7 +91,7 @@ static void
icvInitMemStorage( CvMemStorage* storage, int block_size )
{
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( block_size <= 0 )
block_size = CV_STORAGE_BLOCK_SIZE;
@@ -120,7 +120,7 @@ CV_IMPL CvMemStorage *
cvCreateChildMemStorage( CvMemStorage * parent )
{
if( !parent )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
CvMemStorage* storage = cvCreateMemStorage(parent->block_size);
storage->parent = parent;
@@ -137,7 +137,7 @@ icvDestroyMemStorage( CvMemStorage* storage )
CvMemBlock *dst_top = 0;
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( storage->parent )
dst_top = storage->parent->top;
@@ -180,7 +180,7 @@ CV_IMPL void
cvReleaseMemStorage( CvMemStorage** storage )
{
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
CvMemStorage* st = *storage;
*storage = 0;
@@ -197,7 +197,7 @@ CV_IMPL void
cvClearMemStorage( CvMemStorage * storage )
{
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( storage->parent )
icvDestroyMemStorage( storage );
@@ -215,7 +215,7 @@ static void
icvGoNextMemBlock( CvMemStorage * storage )
{
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( !storage->top || !storage->top->next )
{
@@ -273,7 +273,7 @@ CV_IMPL void
cvSaveMemStoragePos( const CvMemStorage * storage, CvMemStoragePos * pos )
{
if( !storage || !pos )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
pos->top = storage->top;
pos->free_space = storage->free_space;
@@ -285,9 +285,9 @@ CV_IMPL void
cvRestoreMemStoragePos( CvMemStorage * storage, CvMemStoragePos * pos )
{
if( !storage || !pos )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( pos->free_space > storage->block_size )
CV_Error( CV_StsBadSize, "" );
CV_Error( cv::Error::StsBadSize, "" );
/*
// this breaks icvGoNextMemBlock, so comment it off for now
@@ -324,10 +324,10 @@ cvMemStorageAlloc( CvMemStorage* storage, size_t size )
{
schar *ptr = 0;
if( !storage )
CV_Error( CV_StsNullPtr, "NULL storage pointer" );
CV_Error( cv::Error::StsNullPtr, "NULL storage pointer" );
if( size > INT_MAX )
CV_Error( CV_StsOutOfRange, "Too large memory block is requested" );
CV_Error( cv::Error::StsOutOfRange, "Too large memory block is requested" );
CV_Assert( storage->free_space % CV_STRUCT_ALIGN == 0 );
@@ -335,7 +335,7 @@ cvMemStorageAlloc( CvMemStorage* storage, size_t size )
{
size_t max_free_space = cvAlignLeft(storage->block_size - sizeof(CvMemBlock), CV_STRUCT_ALIGN);
if( max_free_space < size )
CV_Error( CV_StsOutOfRange, "requested size is negative or too big" );
CV_Error( cv::Error::StsOutOfRange, "requested size is negative or too big" );
icvGoNextMemBlock( storage );
}
@@ -374,9 +374,9 @@ cvCreateSeq( int seq_flags, size_t header_size, size_t elem_size, CvMemStorage*
CvSeq *seq = 0;
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( header_size < sizeof( CvSeq ) || elem_size <= 0 )
CV_Error( CV_StsBadSize, "" );
CV_Error( cv::Error::StsBadSize, "" );
/* allocate sequence header */
seq = (CvSeq*)cvMemStorageAlloc( storage, header_size );
@@ -390,7 +390,7 @@ cvCreateSeq( int seq_flags, size_t header_size, size_t elem_size, CvMemStorage*
if( elemtype != CV_SEQ_ELTYPE_GENERIC && elemtype != CV_SEQ_ELTYPE_PTR &&
typesize != 0 && typesize != (int)elem_size )
CV_Error( CV_StsBadSize,
CV_Error( cv::Error::StsBadSize,
"Specified element size doesn't match to the size of the specified element type "
"(try to use 0 for element type)" );
}
@@ -412,9 +412,9 @@ cvSetSeqBlockSize( CvSeq *seq, int delta_elements )
int useful_block_size;
if( !seq || !seq->storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( delta_elements < 0 )
CV_Error( CV_StsOutOfRange, "" );
CV_Error( cv::Error::StsOutOfRange, "" );
useful_block_size = cvAlignLeft(seq->storage->block_size - sizeof(CvMemBlock) -
sizeof(CvSeqBlock), CV_STRUCT_ALIGN);
@@ -429,7 +429,7 @@ cvSetSeqBlockSize( CvSeq *seq, int delta_elements )
{
delta_elements = useful_block_size / elem_size;
if( delta_elements == 0 )
CV_Error( CV_StsOutOfRange, "Storage block size is too small "
CV_Error( cv::Error::StsOutOfRange, "Storage block size is too small "
"to fit the sequence elements" );
}
@@ -487,7 +487,7 @@ cvSeqElemIdx( const CvSeq* seq, const void* _element, CvSeqBlock** _block )
CvSeqBlock *block;
if( !seq || !element )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
block = first_block = seq->first;
elem_size = seq->elem_size;
@@ -548,7 +548,7 @@ cvCvtSeqToArray( const CvSeq *seq, void *array, CvSlice slice )
char *dst = (char*)array;
if( !seq || !array )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
elem_size = seq->elem_size;
total = cvSliceLength( slice, seq )*elem_size;
@@ -587,10 +587,10 @@ cvMakeSeqHeaderForArray( int seq_flags, int header_size, int elem_size,
CvSeq* result = 0;
if( elem_size <= 0 || header_size < (int)sizeof( CvSeq ) || total < 0 )
CV_Error( CV_StsBadSize, "" );
CV_Error( cv::Error::StsBadSize, "" );
if( !seq || ((!array || !block) && total > 0) )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
memset( seq, 0, header_size );
@@ -602,7 +602,7 @@ cvMakeSeqHeaderForArray( int seq_flags, int header_size, int elem_size,
if( elemtype != CV_SEQ_ELTYPE_GENERIC &&
typesize != 0 && typesize != elem_size )
CV_Error( CV_StsBadSize,
CV_Error( cv::Error::StsBadSize,
"Element size doesn't match to the size of predefined element type "
"(try to use 0 for sequence element type)" );
}
@@ -634,7 +634,7 @@ icvGrowSeq( CvSeq *seq, int in_front_of )
CvSeqBlock *block;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
block = seq->free_blocks;
if( !block )
@@ -647,7 +647,7 @@ icvGrowSeq( CvSeq *seq, int in_front_of )
cvSetSeqBlockSize( seq, delta_elems*2 );
if( !storage )
CV_Error( CV_StsNullPtr, "The sequence has NULL storage pointer" );
CV_Error( cv::Error::StsNullPtr, "The sequence has NULL storage pointer" );
/* If there is a free space just after last allocated block
and it is big enough then enlarge the last block.
@@ -817,7 +817,7 @@ CV_IMPL void
cvStartAppendToSeq( CvSeq *seq, CvSeqWriter * writer )
{
if( !seq || !writer )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
memset( writer, 0, sizeof( *writer ));
writer->header_size = sizeof( CvSeqWriter );
@@ -835,7 +835,7 @@ cvStartWriteSeq( int seq_flags, int header_size,
int elem_size, CvMemStorage * storage, CvSeqWriter * writer )
{
if( !storage || !writer )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
CvSeq* seq = cvCreateSeq( seq_flags, header_size, elem_size, storage );
cvStartAppendToSeq( seq, writer );
@@ -847,7 +847,7 @@ CV_IMPL void
cvFlushSeqWriter( CvSeqWriter * writer )
{
if( !writer )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
CvSeq* seq = writer->seq;
seq->ptr = writer->ptr;
@@ -878,7 +878,7 @@ CV_IMPL CvSeq *
cvEndWriteSeq( CvSeqWriter * writer )
{
if( !writer )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
cvFlushSeqWriter( writer );
CvSeq* seq = writer->seq;
@@ -909,7 +909,7 @@ CV_IMPL void
cvCreateSeqBlock( CvSeqWriter * writer )
{
if( !writer || !writer->seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
CvSeq* seq = writer->seq;
@@ -942,7 +942,7 @@ cvStartReadSeq( const CvSeq *seq, CvSeqReader * reader, int reverse )
}
if( !seq || !reader )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
reader->header_size = sizeof( CvSeqReader );
reader->seq = (CvSeq*)seq;
@@ -992,7 +992,7 @@ cvChangeSeqBlock( void* _reader, int direction )
CvSeqReader* reader = (CvSeqReader*)_reader;
if( !reader )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( direction > 0 )
{
@@ -1017,7 +1017,7 @@ cvGetSeqReaderPos( CvSeqReader* reader )
int index = -1;
if( !reader || !reader->ptr )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
elem_size = reader->seq->elem_size;
if( elem_size <= ICV_SHIFT_TAB_MAX && (index = icvPower2ShiftTab[elem_size - 1]) >= 0 )
@@ -1042,7 +1042,7 @@ cvSetSeqReaderPos( CvSeqReader* reader, int index, int is_relative )
int elem_size, count, total;
if( !reader || !reader->seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
total = reader->seq->total;
elem_size = reader->seq->elem_size;
@@ -1052,14 +1052,14 @@ cvSetSeqReaderPos( CvSeqReader* reader, int index, int is_relative )
if( index < 0 )
{
if( index < -total )
CV_Error( CV_StsOutOfRange, "" );
CV_Error( cv::Error::StsOutOfRange, "" );
index += total;
}
else if( index >= total )
{
index -= total;
if( index >= total )
CV_Error( CV_StsOutOfRange, "" );
CV_Error( cv::Error::StsOutOfRange, "" );
}
block = reader->seq->first;
@@ -1135,7 +1135,7 @@ cvSeqPush( CvSeq *seq, const void *element )
size_t elem_size;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
elem_size = seq->elem_size;
ptr = seq->ptr;
@@ -1166,9 +1166,9 @@ cvSeqPop( CvSeq *seq, void *element )
int elem_size;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( seq->total <= 0 )
CV_Error( CV_StsBadSize, "" );
CV_Error( cv::Error::StsBadSize, "" );
elem_size = seq->elem_size;
seq->ptr = ptr = seq->ptr - elem_size;
@@ -1195,7 +1195,7 @@ cvSeqPushFront( CvSeq *seq, const void *element )
CvSeqBlock *block;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
elem_size = seq->elem_size;
block = seq->first;
@@ -1228,9 +1228,9 @@ cvSeqPopFront( CvSeq *seq, void *element )
CvSeqBlock *block;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( seq->total <= 0 )
CV_Error( CV_StsBadSize, "" );
CV_Error( cv::Error::StsBadSize, "" );
elem_size = seq->elem_size;
block = seq->first;
@@ -1257,14 +1257,14 @@ cvSeqInsert( CvSeq *seq, int before_index, const void *element )
schar* ret_ptr = 0;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
total = seq->total;
before_index += before_index < 0 ? total : 0;
before_index -= before_index > total ? total : 0;
if( (unsigned)before_index > (unsigned)total )
CV_Error( CV_StsOutOfRange, "" );
CV_Error( cv::Error::StsOutOfRange, "" );
if( before_index == total )
{
@@ -1375,7 +1375,7 @@ cvSeqRemove( CvSeq *seq, int index )
int total, front = 0;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
total = seq->total;
@@ -1383,7 +1383,7 @@ cvSeqRemove( CvSeq *seq, int index )
index -= index >= total ? total : 0;
if( (unsigned) index >= (unsigned) total )
CV_Error( CV_StsOutOfRange, "Invalid index" );
CV_Error( cv::Error::StsOutOfRange, "Invalid index" );
if( index == total - 1 )
{
@@ -1456,9 +1456,9 @@ cvSeqPushMulti( CvSeq *seq, const void *_elements, int count, int front )
char *elements = (char *) _elements;
if( !seq )
CV_Error( CV_StsNullPtr, "NULL sequence pointer" );
CV_Error( cv::Error::StsNullPtr, "NULL sequence pointer" );
if( count < 0 )
CV_Error( CV_StsBadSize, "number of removed elements is negative" );
CV_Error( cv::Error::StsBadSize, "number of removed elements is negative" );
int elem_size = seq->elem_size;
@@ -1525,9 +1525,9 @@ cvSeqPopMulti( CvSeq *seq, void *_elements, int count, int front )
char *elements = (char *) _elements;
if( !seq )
CV_Error( CV_StsNullPtr, "NULL sequence pointer" );
CV_Error( cv::Error::StsNullPtr, "NULL sequence pointer" );
if( count < 0 )
CV_Error( CV_StsBadSize, "number of removed elements is negative" );
CV_Error( cv::Error::StsBadSize, "number of removed elements is negative" );
count = MIN( count, seq->total );
@@ -1593,7 +1593,7 @@ CV_IMPL void
cvClearSeq( CvSeq *seq )
{
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
cvSeqPopMulti( seq, 0, seq->total );
}
@@ -1607,13 +1607,13 @@ cvSeqSlice( const CvSeq* seq, CvSlice slice, CvMemStorage* storage, int copy_dat
CvSeqBlock *block, *first_block = 0, *last_block = 0;
if( !CV_IS_SEQ(seq) )
CV_Error( CV_StsBadArg, "Invalid sequence header" );
CV_Error( cv::Error::StsBadArg, "Invalid sequence header" );
if( !storage )
{
storage = seq->storage;
if( !storage )
CV_Error( CV_StsNullPtr, "NULL storage pointer" );
CV_Error( cv::Error::StsNullPtr, "NULL storage pointer" );
}
elem_size = seq->elem_size;
@@ -1624,7 +1624,7 @@ cvSeqSlice( const CvSeq* seq, CvSlice slice, CvMemStorage* storage, int copy_dat
slice.start_index -= seq->total;
if( (unsigned)length > (unsigned)seq->total ||
((unsigned)slice.start_index >= (unsigned)seq->total && length != 0) )
CV_Error( CV_StsOutOfRange, "Bad sequence slice" );
CV_Error( cv::Error::StsOutOfRange, "Bad sequence slice" );
subseq = cvCreateSeq( seq->flags, seq->header_size, elem_size, storage );
@@ -1680,7 +1680,7 @@ cvSeqRemoveSlice( CvSeq* seq, CvSlice slice )
int total, length;
if( !CV_IS_SEQ(seq) )
CV_Error( CV_StsBadArg, "Invalid sequence header" );
CV_Error( cv::Error::StsBadArg, "Invalid sequence header" );
length = cvSliceLength( slice, seq );
total = seq->total;
@@ -1691,7 +1691,7 @@ cvSeqRemoveSlice( CvSeq* seq, CvSlice slice )
slice.start_index -= total;
if( (unsigned)slice.start_index >= (unsigned)total )
CV_Error( CV_StsOutOfRange, "start slice index is out of range" );
CV_Error( cv::Error::StsOutOfRange, "start slice index is out of range" );
slice.end_index = slice.start_index + length;
@@ -1757,16 +1757,16 @@ cvSeqInsertSlice( CvSeq* seq, int index, const CvArr* from_arr )
CvSeqBlock block;
if( !CV_IS_SEQ(seq) )
CV_Error( CV_StsBadArg, "Invalid destination sequence header" );
CV_Error( cv::Error::StsBadArg, "Invalid destination sequence header" );
if( !CV_IS_SEQ(from))
{
CvMat* mat = (CvMat*)from;
if( !CV_IS_MAT(mat))
CV_Error( CV_StsBadArg, "Source is not a sequence nor matrix" );
CV_Error( cv::Error::StsBadArg, "Source is not a sequence nor matrix" );
if( !CV_IS_MAT_CONT(mat->type) || (mat->rows != 1 && mat->cols != 1) )
CV_Error( CV_StsBadArg, "The source array must be 1d continuous vector" );
CV_Error( cv::Error::StsBadArg, "The source array must be 1d continuous vector" );
from = cvMakeSeqHeaderForArray( CV_SEQ_KIND_GENERIC, sizeof(from_header),
CV_ELEM_SIZE(mat->type),
@@ -1775,7 +1775,7 @@ cvSeqInsertSlice( CvSeq* seq, int index, const CvArr* from_arr )
}
if( seq->elem_size != from->elem_size )
CV_Error( CV_StsUnmatchedSizes,
CV_Error( cv::Error::StsUnmatchedSizes,
"Source and destination sequence element sizes are different." );
from_total = from->total;
@@ -1788,7 +1788,7 @@ cvSeqInsertSlice( CvSeq* seq, int index, const CvArr* from_arr )
index -= index > total ? total : 0;
if( (unsigned)index > (unsigned)total )
CV_Error( CV_StsOutOfRange, "" );
CV_Error( cv::Error::StsOutOfRange, "" );
elem_size = seq->elem_size;
@@ -1918,10 +1918,10 @@ cvSeqSort( CvSeq* seq, CvCmpFunc cmp_func, void* aux )
stack[48];
if( !CV_IS_SEQ(seq) )
CV_Error( !seq ? CV_StsNullPtr : CV_StsBadArg, "Bad input sequence" );
CV_Error( !seq ? cv::Error::StsNullPtr : cv::Error::StsBadArg, "Bad input sequence" );
if( !cmp_func )
CV_Error( CV_StsNullPtr, "Null compare function" );
CV_Error( cv::Error::StsNullPtr, "Null compare function" );
if( seq->total <= 1 )
return;
@@ -2195,10 +2195,10 @@ cvSeqSearch( CvSeq* seq, const void* _elem, CvCmpFunc cmp_func,
*_idx = idx;
if( !CV_IS_SEQ(seq) )
CV_Error( !seq ? CV_StsNullPtr : CV_StsBadArg, "Bad input sequence" );
CV_Error( !seq ? cv::Error::StsNullPtr : cv::Error::StsBadArg, "Bad input sequence" );
if( !elem )
CV_Error( CV_StsNullPtr, "Null element pointer" );
CV_Error( cv::Error::StsNullPtr, "Null element pointer" );
int elem_size = seq->elem_size;
int total = seq->total;
@@ -2256,7 +2256,7 @@ cvSeqSearch( CvSeq* seq, const void* _elem, CvCmpFunc cmp_func,
else
{
if( !cmp_func )
CV_Error( CV_StsNullPtr, "Null compare function" );
CV_Error( cv::Error::StsNullPtr, "Null compare function" );
i = 0, j = total;
@@ -2340,16 +2340,16 @@ cvSeqPartition( const CvSeq* seq, CvMemStorage* storage, CvSeq** labels,
int is_set;
if( !labels )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( !seq || !is_equal )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( !storage )
storage = seq->storage;
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
is_set = CV_IS_SET(seq);
@@ -2483,11 +2483,11 @@ CV_IMPL CvSet*
cvCreateSet( int set_flags, int header_size, int elem_size, CvMemStorage * storage )
{
if( !storage )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( header_size < (int)sizeof( CvSet ) ||
elem_size < (int)sizeof(void*)*2 ||
(elem_size & (sizeof(void*)-1)) != 0 )
CV_Error( CV_StsBadSize, "" );
CV_Error( cv::Error::StsBadSize, "" );
CvSet* set = (CvSet*) cvCreateSeq( set_flags, header_size, elem_size, storage );
set->flags = (set->flags & ~CV_MAGIC_MASK) | CV_SET_MAGIC_VAL;
@@ -2504,7 +2504,7 @@ cvSetAdd( CvSet* set, CvSetElem* element, CvSetElem** inserted_element )
CvSetElem *free_elem;
if( !set )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( !(set->free_elems) )
{
@@ -2552,7 +2552,7 @@ cvSetRemove( CvSet* set, int index )
if( elem )
cvSetRemoveByPtr( set, elem );
else if( !set )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
}
@@ -2583,7 +2583,7 @@ cvCreateGraph( int graph_type, int header_size,
|| edge_size < (int) sizeof( CvGraphEdge )
|| vtx_size < (int) sizeof( CvGraphVtx )
){
CV_Error( CV_StsBadSize, "" );
CV_Error( cv::Error::StsBadSize, "" );
}
vertices = cvCreateSet( graph_type, header_size, vtx_size, storage );
@@ -2602,7 +2602,7 @@ CV_IMPL void
cvClearGraph( CvGraph * graph )
{
if( !graph )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
cvClearSet( graph->edges );
cvClearSet( (CvSet*)graph );
@@ -2617,7 +2617,7 @@ cvGraphAddVtx( CvGraph* graph, const CvGraphVtx* _vertex, CvGraphVtx** _inserted
int index = -1;
if( !graph )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
vertex = (CvGraphVtx*)cvSetNew((CvSet*)graph);
if( vertex )
@@ -2642,10 +2642,10 @@ cvGraphRemoveVtxByPtr( CvGraph* graph, CvGraphVtx* vtx )
int count = -1;
if( !graph || !vtx )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( !CV_IS_SET_ELEM(vtx))
CV_Error( CV_StsBadArg, "The vertex does not belong to the graph" );
CV_Error( cv::Error::StsBadArg, "The vertex does not belong to the graph" );
count = graph->edges->active_count;
for( ;; )
@@ -2670,11 +2670,11 @@ cvGraphRemoveVtx( CvGraph* graph, int index )
CvGraphVtx *vtx = 0;
if( !graph )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
vtx = cvGetGraphVtx( graph, index );
if( !vtx )
CV_Error( CV_StsBadArg, "The vertex is not found" );
CV_Error( cv::Error::StsBadArg, "The vertex is not found" );
count = graph->edges->active_count;
for( ;; )
@@ -2702,7 +2702,7 @@ cvFindGraphEdgeByPtr( const CvGraph* graph,
int ofs = 0;
if( !graph || !start_vtx || !end_vtx )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( start_vtx == end_vtx )
return 0;
@@ -2735,7 +2735,7 @@ cvFindGraphEdge( const CvGraph* graph, int start_idx, int end_idx )
CvGraphVtx *end_vtx;
if( !graph )
CV_Error( CV_StsNullPtr, "graph pointer is NULL" );
CV_Error( cv::Error::StsNullPtr, "graph pointer is NULL" );
start_vtx = cvGetGraphVtx( graph, start_idx );
end_vtx = cvGetGraphVtx( graph, end_idx );
@@ -2759,7 +2759,7 @@ cvGraphAddEdgeByPtr( CvGraph* graph,
int delta;
if( !graph )
CV_Error( CV_StsNullPtr, "graph pointer is NULL" );
CV_Error( cv::Error::StsNullPtr, "graph pointer is NULL" );
if( !CV_IS_GRAPH_ORIENTED( graph ) &&
(start_vtx->flags & CV_SET_ELEM_IDX_MASK) > (end_vtx->flags & CV_SET_ELEM_IDX_MASK) )
@@ -2778,7 +2778,7 @@ cvGraphAddEdgeByPtr( CvGraph* graph,
}
if( start_vtx == end_vtx )
CV_Error( start_vtx ? CV_StsBadArg : CV_StsNullPtr,
CV_Error( start_vtx ? cv::Error::StsBadArg : cv::Error::StsNullPtr,
"vertex pointers coincide (or set to NULL)" );
edge = (CvGraphEdge*)cvSetNew( (CvSet*)(graph->edges) );
@@ -2826,7 +2826,7 @@ cvGraphAddEdge( CvGraph* graph,
CvGraphVtx *end_vtx;
if( !graph )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
start_vtx = cvGetGraphVtx( graph, start_idx );
end_vtx = cvGetGraphVtx( graph, end_idx );
@@ -2843,7 +2843,7 @@ cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx, CvGraphVtx* end_v
CvGraphEdge *edge, *next_edge, *prev_edge;
if( !graph || !start_vtx || !end_vtx )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( start_vtx == end_vtx )
return;
@@ -2902,7 +2902,7 @@ cvGraphRemoveEdge( CvGraph* graph, int start_idx, int end_idx )
CvGraphVtx *end_vtx;
if( !graph )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
start_vtx = cvGetGraphVtx( graph, start_idx );
end_vtx = cvGetGraphVtx( graph, end_idx );
@@ -2919,7 +2919,7 @@ cvGraphVtxDegreeByPtr( const CvGraph* graph, const CvGraphVtx* vertex )
int count;
if( !graph || !vertex )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
for( edge = vertex->first, count = 0; edge; )
{
@@ -2940,11 +2940,11 @@ cvGraphVtxDegree( const CvGraph* graph, int vtx_idx )
int count;
if( !graph )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
vertex = cvGetGraphVtx( graph, vtx_idx );
if( !vertex )
CV_Error( CV_StsObjectNotFound, "" );
CV_Error( cv::Error::StsObjectNotFound, "" );
for( edge = vertex->first, count = 0; edge; )
{
@@ -2971,13 +2971,13 @@ icvSeqElemsClearFlags( CvSeq* seq, int offset, int clear_mask )
int i, total, elem_size;
if( !seq )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
elem_size = seq->elem_size;
total = seq->total;
if( (unsigned)offset > (unsigned)elem_size )
CV_Error( CV_StsBadArg, "" );
CV_Error( cv::Error::StsBadArg, "" );
cvStartReadSeq( seq, &reader );
@@ -3001,14 +3001,14 @@ icvSeqFindNextElem( CvSeq* seq, int offset, int mask,
int total, elem_size, index;
if( !seq || !start_index )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
elem_size = seq->elem_size;
total = seq->total;
index = *start_index;
if( (unsigned)offset > (unsigned)elem_size )
CV_Error( CV_StsBadArg, "" );
CV_Error( cv::Error::StsBadArg, "" );
if( total == 0 )
return 0;
@@ -3048,7 +3048,7 @@ CV_IMPL CvGraphScanner*
cvCreateGraphScanner( CvGraph* graph, CvGraphVtx* vtx, int mask )
{
if( !graph )
CV_Error( CV_StsNullPtr, "Null graph pointer" );
CV_Error( cv::Error::StsNullPtr, "Null graph pointer" );
CV_Assert( graph->storage != 0 );
@@ -3082,7 +3082,7 @@ CV_IMPL void
cvReleaseGraphScanner( CvGraphScanner** scanner )
{
if( !scanner )
CV_Error( CV_StsNullPtr, "Null double pointer to graph scanner" );
CV_Error( cv::Error::StsNullPtr, "Null double pointer to graph scanner" );
if( *scanner )
{
@@ -3103,7 +3103,7 @@ cvNextGraphItem( CvGraphScanner* scanner )
CvGraphItem item;
if( !scanner || !(scanner->stack))
CV_Error( CV_StsNullPtr, "Null graph scanner" );
CV_Error( cv::Error::StsNullPtr, "Null graph scanner" );
dst = scanner->dst;
vtx = scanner->vtx;
@@ -3259,13 +3259,13 @@ cvCloneGraph( const CvGraph* graph, CvMemStorage* storage )
CvSeqReader reader;
if( !CV_IS_GRAPH(graph))
CV_Error( CV_StsBadArg, "Invalid graph pointer" );
CV_Error( cv::Error::StsBadArg, "Invalid graph pointer" );
if( !storage )
storage = graph->storage;
if( !storage )
CV_Error( CV_StsNullPtr, "NULL storage pointer" );
CV_Error( cv::Error::StsNullPtr, "NULL storage pointer" );
vtx_size = graph->elem_size;
edge_size = graph->edges->elem_size;
@@ -3343,7 +3343,7 @@ cvTreeToNodeSeq( const void* first, int header_size, CvMemStorage* storage )
CvTreeNodeIterator iterator;
if( !storage )
CV_Error( CV_StsNullPtr, "NULL storage pointer" );
CV_Error( cv::Error::StsNullPtr, "NULL storage pointer" );
allseq = cvCreateSeq( 0, header_size, sizeof(first), storage );
@@ -3389,7 +3389,7 @@ cvInsertNodeIntoTree( void* _node, void* _parent, void* _frame )
CvTreeNode* parent = (CvTreeNode*)_parent;
if( !node || !parent )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
node->v_prev = _parent != _frame ? parent : 0;
node->h_next = parent->v_next;
@@ -3410,10 +3410,10 @@ cvRemoveNodeFromTree( void* _node, void* _frame )
CvTreeNode* frame = (CvTreeNode*)_frame;
if( !node )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( node == frame )
CV_Error( CV_StsBadArg, "frame node could not be deleted" );
CV_Error( cv::Error::StsBadArg, "frame node could not be deleted" );
if( node->h_next )
node->h_next->h_prev = node->h_prev;
@@ -3440,10 +3440,10 @@ cvInitTreeNodeIterator( CvTreeNodeIterator* treeIterator,
const void* first, int max_level )
{
if( !treeIterator || !first )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
if( max_level < 0 )
CV_Error( CV_StsOutOfRange, "" );
CV_Error( cv::Error::StsOutOfRange, "" );
treeIterator->node = (void*)first;
treeIterator->level = 0;
@@ -3459,7 +3459,7 @@ cvNextTreeNode( CvTreeNodeIterator* treeIterator )
int level;
if( !treeIterator )
CV_Error( CV_StsNullPtr, "NULL iterator pointer" );
CV_Error( cv::Error::StsNullPtr, "NULL iterator pointer" );
prevNode = node = (CvTreeNode*)treeIterator->node;
level = treeIterator->level;
@@ -3500,7 +3500,7 @@ cvPrevTreeNode( CvTreeNodeIterator* treeIterator )
int level;
if( !treeIterator )
CV_Error( CV_StsNullPtr, "" );
CV_Error( cv::Error::StsNullPtr, "" );
prevNode = node = (CvTreeNode*)treeIterator->node;
level = treeIterator->level;
+2 -2
View File
@@ -3469,7 +3469,7 @@ Ptr<DFT2D> DFT2D::create(int width, int height, int depth,
{
if(width == 1 && nonzero_rows > 0 )
{
CV_Error( CV_StsNotImplemented,
CV_Error( cv::Error::StsNotImplemented,
"This mode (using nonzero_rows with a single-column matrix) breaks the function's logic, so it is prohibited.\n"
"For fast convolution/correlation use 2-column matrix or single-row matrix instead" );
}
@@ -4317,7 +4317,7 @@ public:
if( len != prev_len )
{
if( len > 1 && (len & 1) )
CV_Error( CV_StsNotImplemented, "Odd-size DCT\'s are not implemented" );
CV_Error( cv::Error::StsNotImplemented, "Odd-size DCT\'s are not implemented" );
opt.nf = DFTFactorize( len, opt.factors );
bool inplace_transform = opt.factors[0] == opt.factors[opt.nf-1];
+1 -1
View File
@@ -276,7 +276,7 @@ static void glob_rec(const cv::String& directory, const cv::String& wildchart, s
}
else
{
CV_Error_(CV_StsObjectNotFound, ("could not open directory: %s", directory.c_str()));
CV_Error_(cv::Error::StsObjectNotFound, ("could not open directory: %s", directory.c_str()));
}
}
#endif // OPENCV_HAVE_FILESYSTEM_SUPPORT
+2 -2
View File
@@ -1191,7 +1191,7 @@ bool solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int method )
Mat dst = _dst.getMat();
if( m < n )
CV_Error(CV_StsBadArg, "The function can not solve under-determined linear systems" );
CV_Error(cv::Error::StsBadArg, "The function can not solve under-determined linear systems" );
if( m == n )
is_normal = false;
@@ -1515,7 +1515,7 @@ void SVD::backSubst( InputArray _w, InputArray _u, InputArray _vt,
vt.ptr<double>(), vt.step, true, rhs.ptr<double>(), rhs.step, nb,
dst.ptr<double>(), dst.step, buffer.data());
else
CV_Error( CV_StsUnsupportedFormat, "" );
CV_Error( cv::Error::StsUnsupportedFormat, "" );
}
+1 -1
View File
@@ -1566,7 +1566,7 @@ bool checkRange(InputArray _src, bool quiet, Point* pt, double minVal, double ma
{
cv::String value_str;
value_str << src(cv::Range(badPt.y, badPt.y + 1), cv::Range(badPt.x, badPt.x + 1));
CV_Error_( CV_StsOutOfRange,
CV_Error_( cv::Error::StsOutOfRange,
("the value at (%d, %d)=%s is out of range [%f, %f)", badPt.x, badPt.y, value_str.c_str(), minVal, maxVal));
}
return false;
+1 -1
View File
@@ -921,7 +921,7 @@ void mulTransposed(InputArray _src, OutputArray _dst, bool ata,
{
MulTransposedFunc func = getMulTransposedFunc(stype, dtype, ata);
if( !func )
CV_Error( CV_StsUnsupportedFormat, "" );
CV_Error( cv::Error::StsUnsupportedFormat, "" );
func( src, dst, delta, scale );
completeSymm( dst, false );
+10 -10
View File
@@ -267,7 +267,7 @@ void setSize( Mat& m, int _dims, const int* _sz, const size_t* _steps, bool auto
m.step.p[i] = total;
uint64 total1 = (uint64)total*s;
if( (uint64)total1 != (size_t)total1 )
CV_Error( CV_StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
CV_Error( cv::Error::StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
total = (size_t)total1;
}
}
@@ -1072,9 +1072,9 @@ void Mat::push_back(const Mat& elems)
bool eq = size == elems.size;
size.p[0] = int(r);
if( !eq )
CV_Error(CV_StsUnmatchedSizes, "Pushed vector length is not equal to matrix row length");
CV_Error(cv::Error::StsUnmatchedSizes, "Pushed vector length is not equal to matrix row length");
if( type() != elems.type() )
CV_Error(CV_StsUnmatchedFormats, "Pushed vector type is not the same as matrix type");
CV_Error(cv::Error::StsUnmatchedFormats, "Pushed vector type is not the same as matrix type");
if( isSubmatrix() || dataend + step.p[0]*delta > datalimit )
reserve( std::max(r + delta, (r*3+1)/2) );
@@ -1170,16 +1170,16 @@ Mat Mat::reshape(int new_cn, int new_rows) const
{
int total_size = total_width * rows;
if( !isContinuous() )
CV_Error( CV_BadStep,
CV_Error( cv::Error::BadStep,
"The matrix is not continuous, thus its number of rows can not be changed" );
if( (unsigned)new_rows > (unsigned)total_size )
CV_Error( CV_StsOutOfRange, "Bad new number of rows" );
CV_Error( cv::Error::StsOutOfRange, "Bad new number of rows" );
total_width = total_size / new_rows;
if( total_width * new_rows != total_size )
CV_Error( CV_StsBadArg, "The total number of matrix elements "
CV_Error( cv::Error::StsBadArg, "The total number of matrix elements "
"is not divisible by the new number of rows" );
hdr.rows = new_rows;
@@ -1189,7 +1189,7 @@ Mat Mat::reshape(int new_cn, int new_rows) const
int new_width = total_width / new_cn;
if( new_width * new_cn != total_width )
CV_Error( CV_BadNumChannels,
CV_Error( cv::Error::BadNumChannels,
"The total width is not divisible by the new number of channels" );
hdr.cols = new_width;
@@ -1231,13 +1231,13 @@ Mat Mat::reshape(int _cn, int _newndims, const int* _newsz) const
else if (i < dims)
newsz_buf[i] = this->size[i];
else
CV_Error(CV_StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
CV_Error(cv::Error::StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
total_elem1 *= (size_t)newsz_buf[i];
}
if (total_elem1 != total_elem1_ref)
CV_Error(CV_StsUnmatchedSizes, "Requested and source matrices have different count of elements");
CV_Error(cv::Error::StsUnmatchedSizes, "Requested and source matrices have different count of elements");
Mat hdr = *this;
hdr.flags = (hdr.flags & ~CV_MAT_CN_MASK) | ((_cn-1) << CV_CN_SHIFT);
@@ -1246,7 +1246,7 @@ Mat Mat::reshape(int _cn, int _newndims, const int* _newsz) const
return hdr;
}
CV_Error(CV_StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
CV_Error(cv::Error::StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
// TBD
}
+6 -6
View File
@@ -163,7 +163,7 @@ Mat cvarrToMat(const CvArr* arr, bool copyData,
{
const IplImage* iplimg = (const IplImage*)arr;
if( coiMode == 0 && iplimg->roi && iplimg->roi->coi > 0 )
CV_Error(CV_BadCOI, "COI is not supported by the function");
CV_Error(cv::Error::BadCOI, "COI is not supported by the function");
return iplImageToMat(iplimg, copyData);
}
if( CV_IS_SEQ(arr) )
@@ -187,7 +187,7 @@ Mat cvarrToMat(const CvArr* arr, bool copyData,
cvCvtSeqToArray(seq, buf.ptr(), CV_WHOLE_SEQ);
return buf;
}
CV_Error(CV_StsBadArg, "Unknown array type");
CV_Error(cv::Error::StsBadArg, "Unknown array type");
}
void extractImageCOI(const CvArr* arr, OutputArray _ch, int coi)
@@ -269,14 +269,14 @@ cvReduce( const CvArr* srcarr, CvArr* dstarr, int dim, int op )
dim = src.rows > dst.rows ? 0 : src.cols > dst.cols ? 1 : dst.cols == 1;
if( dim > 1 )
CV_Error( CV_StsOutOfRange, "The reduced dimensionality index is out of range" );
CV_Error( cv::Error::StsOutOfRange, "The reduced dimensionality index is out of range" );
if( (dim == 0 && (dst.cols != src.cols || dst.rows != 1)) ||
(dim == 1 && (dst.rows != src.rows || dst.cols != 1)) )
CV_Error( CV_StsBadSize, "The output array size is incorrect" );
CV_Error( cv::Error::StsBadSize, "The output array size is incorrect" );
if( src.channels() != dst.channels() )
CV_Error( CV_StsUnmatchedFormats, "Input and output arrays must have the same number of channels" );
CV_Error( cv::Error::StsUnmatchedFormats, "Input and output arrays must have the same number of channels" );
cv::reduce(src, dst, dim, op, dst.type());
}
@@ -333,7 +333,7 @@ cvRange( CvArr* arr, double start, double end )
fdata[j] = (float)val;
}
else
CV_Error( CV_StsUnsupportedFormat, "The function only supports 32sC1 and 32fC1 datatypes" );
CV_Error( cv::Error::StsUnsupportedFormat, "The function only supports 32sC1 and 32fC1 datatypes" );
return arr;
}
+4 -4
View File
@@ -21,7 +21,7 @@ static void checkOperandsExist(const Mat& a)
{
if (a.empty())
{
CV_Error(CV_StsBadArg, "Matrix operand is an empty matrix.");
CV_Error(cv::Error::StsBadArg, "Matrix operand is an empty matrix.");
}
}
@@ -29,7 +29,7 @@ static void checkOperandsExist(const Mat& a, const Mat& b)
{
if (a.empty() || b.empty())
{
CV_Error(CV_StsBadArg, "One or more matrix operands are empty.");
CV_Error(cv::Error::StsBadArg, "One or more matrix operands are empty.");
}
}
@@ -1456,7 +1456,7 @@ void MatOp_Bin::assign(const MatExpr& e, Mat& m, int _type) const
else if( e.flags == 'a' && !e.b.data )
cv::absdiff(e.a, e.s, dst);
else
CV_Error(CV_StsError, "Unknown operation");
CV_Error(cv::Error::StsError, "Unknown operation");
if( dst.data != m.data )
dst.convertTo(m, _type);
@@ -1691,7 +1691,7 @@ void MatOp_Initializer::assign(const MatExpr& e, Mat& m, int _type) const
else if( e.flags == '1' )
m = Scalar(e.alpha);
else
CV_Error(CV_StsError, "Invalid matrix initializer type");
CV_Error(cv::Error::StsError, "Invalid matrix initializer type");
}
void MatOp_Initializer::multiply(const MatExpr& e, double s, MatExpr& res) const
+1 -1
View File
@@ -954,7 +954,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
}
if( !func )
CV_Error( CV_StsUnsupportedFormat,
CV_Error( cv::Error::StsUnsupportedFormat,
"Unsupported combination of input and output array formats" );
func( src, temp );
+3 -3
View File
@@ -758,7 +758,7 @@ double norm( const SparseMat& src, int normType )
}
}
else
CV_Error( CV_StsUnsupportedFormat, "Only 32f and 64f are supported" );
CV_Error( cv::Error::StsUnsupportedFormat, "Only 32f and 64f are supported" );
if( normType == NORM_L2 )
result = std::sqrt(result);
@@ -821,7 +821,7 @@ void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _mi
*_maxval = maxval;
}
else
CV_Error( CV_StsUnsupportedFormat, "Only 32f and 64f are supported" );
CV_Error( cv::Error::StsUnsupportedFormat, "Only 32f and 64f are supported" );
if( _minidx && minidx )
for( i = 0; i < d; i++ )
@@ -843,7 +843,7 @@ void normalize( const SparseMat& src, SparseMat& dst, double a, int norm_type )
scale = scale > DBL_EPSILON ? a/scale : 0.;
}
else
CV_Error( CV_StsBadArg, "Unknown/unsupported norm type" );
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported norm type" );
src.convertTo( dst, -1, scale );
}
+4 -4
View File
@@ -948,7 +948,7 @@ bool _InputArray::isContinuous(int i) const
if( k == CUDA_GPU_MAT )
return i < 0 ? ((const cuda::GpuMat*)obj)->isContinuous() : true;
CV_Error(CV_StsNotImplemented, "Unknown/unsupported array type");
CV_Error(cv::Error::StsNotImplemented, "Unknown/unsupported array type");
}
bool _InputArray::isSubmatrix(int i) const
@@ -986,7 +986,7 @@ bool _InputArray::isSubmatrix(int i) const
return vv[i].isSubmatrix();
}
CV_Error(CV_StsNotImplemented, "");
CV_Error(cv::Error::StsNotImplemented, "");
}
size_t _InputArray::offset(int i) const
@@ -1466,14 +1466,14 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
((std::vector<Vec<int, 128> >*)v)->resize(len);
break;
default:
CV_Error_(CV_StsBadArg, ("Vectors with element size %d are not supported. Please, modify OutputArray::create()\n", esz));
CV_Error_(cv::Error::StsBadArg, ("Vectors with element size %d are not supported. Please, modify OutputArray::create()\n", esz));
}
return;
}
if( k == NONE )
{
CV_Error(CV_StsNullPtr, "create() called for the missing output array" );
CV_Error(cv::Error::StsNullPtr, "create() called for the missing output array" );
}
if( k == STD_VECTOR_MAT )
+1 -1
View File
@@ -1392,7 +1392,7 @@ void normalize(InputArray _src, InputOutputArray _dst, double a, double b,
shift = 0;
}
else
CV_Error( CV_StsBadArg, "Unknown/unsupported norm type" );
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported norm type" );
CV_OCL_RUN(_dst.isUMat(),
ocl_normalize(_src, _dst, _mask, rtype, scale, shift))
+1 -1
View File
@@ -574,7 +574,7 @@ void RNG::fill( InputOutputArray _mat, int disttype,
CV_Assert( scaleFunc != 0 );
}
else
CV_Error( CV_StsBadArg, "Unknown distribution type" );
CV_Error( cv::Error::StsBadArg, "Unknown distribution type" );
const Mat* arrays[] = {&mat, 0};
uchar* ptr;
+53 -53
View File
@@ -1377,38 +1377,38 @@ CV_IMPL const char* cvErrorStr( int status )
switch (status)
{
case CV_StsOk : return "No Error";
case CV_StsBackTrace : return "Backtrace";
case CV_StsError : return "Unspecified error";
case CV_StsInternal : return "Internal error";
case CV_StsNoMem : return "Insufficient memory";
case CV_StsBadArg : return "Bad argument";
case CV_StsNoConv : return "Iterations do not converge";
case CV_StsAutoTrace : return "Autotrace call";
case CV_StsBadSize : return "Incorrect size of input array";
case CV_StsNullPtr : return "Null pointer";
case CV_StsDivByZero : return "Division by zero occurred";
case CV_BadStep : return "Image step is wrong";
case CV_StsInplaceNotSupported : return "Inplace operation is not supported";
case CV_StsObjectNotFound : return "Requested object was not found";
case CV_BadDepth : return "Input image depth is not supported by function";
case CV_StsUnmatchedFormats : return "Formats of input arguments do not match";
case CV_StsUnmatchedSizes : return "Sizes of input arguments do not match";
case CV_StsOutOfRange : return "One of the arguments\' values is out of range";
case CV_StsUnsupportedFormat : return "Unsupported format or combination of formats";
case CV_BadCOI : return "Input COI is not supported";
case CV_BadNumChannels : return "Bad number of channels";
case CV_StsBadFlag : return "Bad flag (parameter or structure field)";
case CV_StsBadPoint : return "Bad parameter of type CvPoint";
case CV_StsBadMask : return "Bad type of mask argument";
case CV_StsParseError : return "Parsing error";
case CV_StsNotImplemented : return "The function/feature is not implemented";
case CV_StsBadMemBlock : return "Memory block has been corrupted";
case CV_StsAssert : return "Assertion failed";
case CV_GpuNotSupported : return "No CUDA support";
case CV_GpuApiCallError : return "Gpu API call";
case CV_OpenGlNotSupported : return "No OpenGL support";
case CV_OpenGlApiCallError : return "OpenGL API call";
case cv::Error::StsOk : return "No Error";
case cv::Error::StsBackTrace : return "Backtrace";
case cv::Error::StsError : return "Unspecified error";
case cv::Error::StsInternal : return "Internal error";
case cv::Error::StsNoMem : return "Insufficient memory";
case cv::Error::StsBadArg : return "Bad argument";
case cv::Error::StsNoConv : return "Iterations do not converge";
case cv::Error::StsAutoTrace : return "Autotrace call";
case cv::Error::StsBadSize : return "Incorrect size of input array";
case cv::Error::StsNullPtr : return "Null pointer";
case cv::Error::StsDivByZero : return "Division by zero occurred";
case cv::Error::BadStep : return "Image step is wrong";
case cv::Error::StsInplaceNotSupported : return "Inplace operation is not supported";
case cv::Error::StsObjectNotFound : return "Requested object was not found";
case cv::Error::BadDepth : return "Input image depth is not supported by function";
case cv::Error::StsUnmatchedFormats : return "Formats of input arguments do not match";
case cv::Error::StsUnmatchedSizes : return "Sizes of input arguments do not match";
case cv::Error::StsOutOfRange : return "One of the arguments\' values is out of range";
case cv::Error::StsUnsupportedFormat : return "Unsupported format or combination of formats";
case cv::Error::BadCOI : return "Input COI is not supported";
case cv::Error::BadNumChannels : return "Bad number of channels";
case cv::Error::StsBadFlag : return "Bad flag (parameter or structure field)";
case cv::Error::StsBadPoint : return "Bad parameter of type CvPoint";
case cv::Error::StsBadMask : return "Bad type of mask argument";
case cv::Error::StsParseError : return "Parsing error";
case cv::Error::StsNotImplemented : return "The function/feature is not implemented";
case cv::Error::StsBadMemBlock : return "Memory block has been corrupted";
case cv::Error::StsAssert : return "Assertion failed";
case cv::Error::GpuNotSupported : return "No CUDA support";
case cv::Error::GpuApiCallError : return "Gpu API call";
case cv::Error::OpenGlNotSupported : return "No OpenGL support";
case cv::Error::OpenGlApiCallError : return "OpenGL API call";
};
snprintf(buf, sizeof(buf), "Unknown %s code %d", status >= 0 ? "status":"error", status);
@@ -1448,29 +1448,29 @@ cvErrorFromIppStatus( int status )
{
switch (status)
{
case CV_BADSIZE_ERR: return CV_StsBadSize;
case CV_BADMEMBLOCK_ERR: return CV_StsBadMemBlock;
case CV_NULLPTR_ERR: return CV_StsNullPtr;
case CV_DIV_BY_ZERO_ERR: return CV_StsDivByZero;
case CV_BADSTEP_ERR: return CV_BadStep;
case CV_OUTOFMEM_ERR: return CV_StsNoMem;
case CV_BADARG_ERR: return CV_StsBadArg;
case CV_NOTDEFINED_ERR: return CV_StsError;
case CV_INPLACE_NOT_SUPPORTED_ERR: return CV_StsInplaceNotSupported;
case CV_NOTFOUND_ERR: return CV_StsObjectNotFound;
case CV_BADCONVERGENCE_ERR: return CV_StsNoConv;
case CV_BADDEPTH_ERR: return CV_BadDepth;
case CV_UNMATCHED_FORMATS_ERR: return CV_StsUnmatchedFormats;
case CV_UNSUPPORTED_COI_ERR: return CV_BadCOI;
case CV_UNSUPPORTED_CHANNELS_ERR: return CV_BadNumChannels;
case CV_BADFLAG_ERR: return CV_StsBadFlag;
case CV_BADRANGE_ERR: return CV_StsBadArg;
case CV_BADCOEF_ERR: return CV_StsBadArg;
case CV_BADFACTOR_ERR: return CV_StsBadArg;
case CV_BADPOINT_ERR: return CV_StsBadPoint;
case CV_BADSIZE_ERR: return cv::Error::StsBadSize;
case CV_BADMEMBLOCK_ERR: return cv::Error::StsBadMemBlock;
case CV_NULLPTR_ERR: return cv::Error::StsNullPtr;
case CV_DIV_BY_ZERO_ERR: return cv::Error::StsDivByZero;
case CV_BADSTEP_ERR: return cv::Error::BadStep;
case CV_OUTOFMEM_ERR: return cv::Error::StsNoMem;
case CV_BADARG_ERR: return cv::Error::StsBadArg;
case CV_NOTDEFINED_ERR: return cv::Error::StsError;
case CV_INPLACE_NOT_SUPPORTED_ERR: return cv::Error::StsInplaceNotSupported;
case CV_NOTFOUND_ERR: return cv::Error::StsObjectNotFound;
case CV_BADCONVERGENCE_ERR: return cv::Error::StsNoConv;
case CV_BADDEPTH_ERR: return cv::Error::BadDepth;
case CV_UNMATCHED_FORMATS_ERR: return cv::Error::StsUnmatchedFormats;
case CV_UNSUPPORTED_COI_ERR: return cv::Error::BadCOI;
case CV_UNSUPPORTED_CHANNELS_ERR: return cv::Error::BadNumChannels;
case CV_BADFLAG_ERR: return cv::Error::StsBadFlag;
case CV_BADRANGE_ERR: return cv::Error::StsBadArg;
case CV_BADCOEF_ERR: return cv::Error::StsBadArg;
case CV_BADFACTOR_ERR: return cv::Error::StsBadArg;
case CV_BADPOINT_ERR: return cv::Error::StsBadPoint;
default:
return CV_StsError;
return cv::Error::StsError;
}
}
+1 -1
View File
@@ -83,7 +83,7 @@ void KeyPoint::convert(const std::vector<KeyPoint>& keypoints, std::vector<Point
points2f[i] = keypoints[idx].pt;
else
{
CV_Error( CV_StsBadArg, "keypointIndexes has element < 0. TODO: process this case" );
CV_Error( cv::Error::StsBadArg, "keypointIndexes has element < 0. TODO: process this case" );
//points2f[i] = Point2f(-1, -1);
}
}
+8 -8
View File
@@ -539,7 +539,7 @@ void setSize( UMat& m, int _dims, const int* _sz,
m.step.p[i] = total;
int64 total1 = (int64)total*s;
if( (uint64)total1 != (size_t)total1 )
CV_Error( CV_StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
CV_Error( cv::Error::StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
total = (size_t)total1;
}
}
@@ -965,16 +965,16 @@ UMat UMat::reshape(int new_cn, int new_rows) const
{
int total_size = total_width * rows;
if( !isContinuous() )
CV_Error( CV_BadStep,
CV_Error( cv::Error::BadStep,
"The matrix is not continuous, thus its number of rows can not be changed" );
if( (unsigned)new_rows > (unsigned)total_size )
CV_Error( CV_StsOutOfRange, "Bad new number of rows" );
CV_Error( cv::Error::StsOutOfRange, "Bad new number of rows" );
total_width = total_size / new_rows;
if( total_width * new_rows != total_size )
CV_Error( CV_StsBadArg, "The total number of matrix elements "
CV_Error( cv::Error::StsBadArg, "The total number of matrix elements "
"is not divisible by the new number of rows" );
hdr.rows = new_rows;
@@ -984,7 +984,7 @@ UMat UMat::reshape(int new_cn, int new_rows) const
int new_width = total_width / new_cn;
if( new_width * new_cn != total_width )
CV_Error( CV_BadNumChannels,
CV_Error( cv::Error::BadNumChannels,
"The total width is not divisible by the new number of channels" );
hdr.cols = new_width;
@@ -1050,13 +1050,13 @@ UMat UMat::reshape(int _cn, int _newndims, const int* _newsz) const
else if (i < dims)
newsz_buf[i] = this->size[i];
else
CV_Error(CV_StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
CV_Error(cv::Error::StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
total_elem1 *= (size_t)newsz_buf[i];
}
if (total_elem1 != total_elem1_ref)
CV_Error(CV_StsUnmatchedSizes, "Requested and source matrices have different count of elements");
CV_Error(cv::Error::StsUnmatchedSizes, "Requested and source matrices have different count of elements");
UMat hdr = *this;
hdr.flags = (hdr.flags & ~CV_MAT_CN_MASK) | ((_cn-1) << CV_CN_SHIFT);
@@ -1065,7 +1065,7 @@ UMat UMat::reshape(int _cn, int _newndims, const int* _newsz) const
return hdr;
}
CV_Error(CV_StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
CV_Error(cv::Error::StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
}
Mat UMat::getMat(AccessFlag accessFlags) const
+2 -2
View File
@@ -593,7 +593,7 @@ static void inRange(const Mat& src, const Mat& lb, const Mat& rb, Mat& dst)
inRange_((const double*)sptr, (const double*)aptr, (const double*)bptr, dptr, total, cn);
break;
default:
CV_Error(CV_StsUnsupportedFormat, "");
CV_Error(cv::Error::StsUnsupportedFormat, "");
}
}
}
@@ -642,7 +642,7 @@ static void inRangeS(const Mat& src, const Scalar& lb, const Scalar& rb, Mat& ds
inRangeS_((const double*)sptr, lbuf.d, rbuf.d, dptr, total, cn);
break;
default:
CV_Error(CV_StsUnsupportedFormat, "");
CV_Error(cv::Error::StsUnsupportedFormat, "");
}
}
}
+2 -2
View File
@@ -97,7 +97,7 @@ static void DFT_1D( const Mat& _src, Mat& _dst, int flags, const Mat& _wave=Mat(
}
}
else
CV_Error(CV_StsUnsupportedFormat, "");
CV_Error(cv::Error::StsUnsupportedFormat, "");
}
@@ -878,7 +878,7 @@ protected:
{
cout << "actual:\n" << dst << endl << endl;
cout << "reference:\n" << dstz << endl << endl;
CV_Error(CV_StsError, "");
CV_Error(cv::Error::StsError, "");
}
}
}
+1 -1
View File
@@ -598,7 +598,7 @@ static void setValue(SparseMat& M, const int* idx, double value, RNG& rng)
else if( M.type() == CV_64F )
*(double*)ptr = value;
else
CV_Error(CV_StsUnsupportedFormat, "");
CV_Error(cv::Error::StsUnsupportedFormat, "");
}
#if defined(__GNUC__) && (__GNUC__ == 11 || __GNUC__ == 12 || __GNUC__ == 13)
+1 -1
View File
@@ -438,7 +438,7 @@ void Image2BlobParams::blobRectsToImageRects(const std::vector<Rect> &rBlob, std
}
}
else
CV_Error(CV_StsBadArg, "Unknown padding mode");
CV_Error(cv::Error::StsBadArg, "Unknown padding mode");
}
}
@@ -548,7 +548,7 @@ public:
{
// for Conv1d
if (group != 1)
CV_Error( CV_StsNotImplemented, " Grouped Conv1d or Depth-Wise Conv1d are not supported by "
CV_Error( cv::Error::StsNotImplemented, " Grouped Conv1d or Depth-Wise Conv1d are not supported by "
"TimVX Backend. Please try OpenCV Backend.");
tvConv = graph->CreateOperation<tim::vx::ops::Conv1d>(
tvConvWeightShape[2], tvPadType, (uint32_t)kernel_size[0],
@@ -450,7 +450,7 @@ Ptr<FastConv> initFastConv(
}
}
else
CV_Error(CV_StsUnsupportedFormat, "Unknown convolution type.");
CV_Error(cv::Error::StsUnsupportedFormat, "Unknown convolution type.");
// store bias; append some zero's to make sure that
// we can always read MR elements starting from any valid index
+4 -4
View File
@@ -225,7 +225,7 @@ void Context::createInstance()
if (result != VK_SUCCESS)
{
CV_Error(CV_StsError, "Vulkan: vkEnumerateInstanceLayerProperties failed!");
CV_Error(cv::Error::StsError, "Vulkan: vkEnumerateInstanceLayerProperties failed!");
return;
}
@@ -234,7 +234,7 @@ void Context::createInstance()
if (result != VK_SUCCESS)
{
CV_Error(CV_StsError, "Vulkan: vkEnumerateInstanceLayerProperties failed!");
CV_Error(cv::Error::StsError, "Vulkan: vkEnumerateInstanceLayerProperties failed!");
return;
}
@@ -388,7 +388,7 @@ Context::Context()
vkEnumeratePhysicalDevices(kInstance, &deviceCount, NULL);
if (deviceCount == 0)
{
CV_Error(CV_StsError, "Vulkan Backend: could not find a device with vulkan support!");
CV_Error(cv::Error::StsError, "Vulkan Backend: could not find a device with vulkan support!");
}
std::vector<VkPhysicalDevice> devices(deviceCount);
@@ -442,7 +442,7 @@ Context::Context()
if (!cmdPoolPtr)
cmdPoolPtr = CommandPool::create(kQueue, kQueueFamilyIndex);
else
CV_Error(CV_StsError, "cmdPoolPtr has been created before!!");
CV_Error(cv::Error::StsError, "cmdPoolPtr has been created before!!");
pipelineFactoryPtr = PipelineFactory::create();
}
+1 -1
View File
@@ -244,7 +244,7 @@ bool OpConv::computeGroupCount()
group_z_ = 1;
}
else
CV_Error(CV_StsNotImplemented, "shader type is not supported at compute GroupCount.");
CV_Error(cv::Error::StsNotImplemented, "shader type is not supported at compute GroupCount.");
CV_Assert(group_x_ <= MAX_GROUP_COUNT_X);
CV_Assert(group_y_ <= MAX_GROUP_COUNT_Y);
+1 -1
View File
@@ -182,7 +182,7 @@ bool OpNary::computeGroupCount()
}
else
{
CV_Error(CV_StsNotImplemented, "shader type is not supported at compute GroupCount.");
CV_Error(cv::Error::StsNotImplemented, "shader type is not supported at compute GroupCount.");
}
CV_Assert(group_x_ <= MAX_GROUP_COUNT_X);
+2 -2
View File
@@ -279,7 +279,7 @@ Ptr<Pipeline> PipelineFactory::getPipeline(const std::string& key, const std::ve
// retrieve spv from SPVMaps with given key
auto iterSPV = SPVMaps.find(key);
if (iterSPV == SPVMaps.end())
CV_Error(CV_StsError, "Can not create SPV with the given name:"+key+"!");
CV_Error(cv::Error::StsError, "Can not create SPV with the given name:"+key+"!");
const uint32_t* spv = iterSPV->second.first;
size_t length = iterSPV->second.second;
@@ -292,7 +292,7 @@ Ptr<Pipeline> PipelineFactory::getPipeline(const std::string& key, const std::ve
}
else
{
CV_Error(CV_StsError, "Can not Created the VkPipeline "+key);
CV_Error(cv::Error::StsError, "Can not Created the VkPipeline "+key);
}
return pipeline;
+13 -13
View File
@@ -1097,17 +1097,17 @@ void cv::imshow(const String& winname, const ogl::Texture2D& _tex)
CV_IMPL void cvSetOpenGlDrawCallback(const char*, CvOpenGlDrawCallback, void*)
{
CV_Error(CV_OpenGlNotSupported, "The library is compiled without OpenGL support");
CV_Error(cv::Error::OpenGlNotSupported, "The library is compiled without OpenGL support");
}
CV_IMPL void cvSetOpenGlContext(const char*)
{
CV_Error(CV_OpenGlNotSupported, "The library is compiled without OpenGL support");
CV_Error(cv::Error::OpenGlNotSupported, "The library is compiled without OpenGL support");
}
CV_IMPL void cvUpdateWindow(const char*)
{
CV_Error(CV_OpenGlNotSupported, "The library is compiled without OpenGL support");
CV_Error(cv::Error::OpenGlNotSupported, "The library is compiled without OpenGL support");
}
#endif // !HAVE_OPENGL
@@ -1176,52 +1176,52 @@ static const char* NO_QT_ERR_MSG = "The library is compiled without QT support";
cv::QtFont cv::fontQt(const String&, int, Scalar, int, int, int)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
void cv::addText( const Mat&, const String&, Point, const QtFont&)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
void cv::addText(const Mat&, const String&, Point, const String&, int, Scalar, int, int, int)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
void cv::displayStatusBar(const String&, const String&, int)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
void cv::displayOverlay(const String&, const String&, int )
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
int cv::startLoop(int (*)(int argc, char *argv[]), int , char**)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
void cv::stopLoop()
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
void cv::saveWindowParameters(const String&)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
void cv::loadWindowParameters(const String&)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
int cv::createButton(const String&, ButtonCallback, void*, int , bool )
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
CV_Error(cv::Error::StsNotImplemented, NO_QT_ERR_MSG);
}
#endif
+36 -36
View File
@@ -147,7 +147,7 @@ CV_IMPL CvFont cvFontQt(const char* nameFont, int pointSize,CvScalar color,int w
CV_IMPL void cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont* font)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"putText",
@@ -162,7 +162,7 @@ CV_IMPL void cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont*
double cvGetRatioWindow_QT(const char* name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
double result = -1;
QMetaObject::invokeMethod(guiMainThread,
@@ -176,7 +176,7 @@ double cvGetRatioWindow_QT(const char* name)
double cvGetPropVisible_QT(const char* name) {
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
double result = 0;
@@ -193,7 +193,7 @@ void cvSetRatioWindow_QT(const char* name,double prop_value)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"setRatioWindow",
@@ -205,7 +205,7 @@ void cvSetRatioWindow_QT(const char* name,double prop_value)
double cvGetPropWindow_QT(const char* name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
double result = -1;
QMetaObject::invokeMethod(guiMainThread,
@@ -221,7 +221,7 @@ double cvGetPropWindow_QT(const char* name)
void cvSetPropWindow_QT(const char* name,double prop_value)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"setPropWindow",
@@ -246,7 +246,7 @@ void setWindowTitle_QT(const String& winname, const String& title)
void cvSetModeWindow_QT(const char* name, double prop_value)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"toggleFullScreen",
@@ -258,7 +258,7 @@ void cvSetModeWindow_QT(const char* name, double prop_value)
CvRect cvGetWindowRect_QT(const char* name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
CvRect result = cvRect(-1, -1, -1, -1);
@@ -274,7 +274,7 @@ CvRect cvGetWindowRect_QT(const char* name)
double cvGetModeWindow_QT(const char* name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
double result = -1;
@@ -291,7 +291,7 @@ double cvGetModeWindow_QT(const char* name)
CV_IMPL void cvDisplayOverlay(const char* name, const char* text, int delayms)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"displayInfo",
@@ -305,7 +305,7 @@ CV_IMPL void cvDisplayOverlay(const char* name, const char* text, int delayms)
CV_IMPL void cvSaveWindowParameters(const char* name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"saveWindowParameters",
@@ -317,7 +317,7 @@ CV_IMPL void cvSaveWindowParameters(const char* name)
CV_IMPL void cvLoadWindowParameters(const char* name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"loadWindowParameters",
@@ -329,7 +329,7 @@ CV_IMPL void cvLoadWindowParameters(const char* name)
CV_IMPL void cvDisplayStatusBar(const char* name, const char* text, int delayms)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"displayStatusBar",
@@ -492,7 +492,7 @@ static CvTrackbar* icvFindTrackBarByName(const char* name_trackbar, const char*
QPointer<CvWindow> w = icvFindWindowByName(nameWinQt);
if (!w)
CV_Error(CV_StsNullPtr, "NULL window handler");
CV_Error(cv::Error::StsNullPtr, "NULL window handler");
if (w->param_gui_mode == CV_GUI_NORMAL)
return (CvTrackbar*) icvFindBarByName(w->myBarLayout, nameQt, type_CvTrackbar);
@@ -575,7 +575,7 @@ CV_IMPL int cvNamedWindow(const char* name, int flags)
CV_IMPL void cvDestroyWindow(const char* name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"destroyWindow",
@@ -598,7 +598,7 @@ CV_IMPL void cvDestroyAllWindows()
CV_IMPL void* cvGetWindowHandle(const char* name)
{
if (!name)
CV_Error( CV_StsNullPtr, "NULL name string" );
CV_Error( cv::Error::StsNullPtr, "NULL name string" );
return (void*) icvFindWindowByName(QLatin1String(name));
}
@@ -607,7 +607,7 @@ CV_IMPL void* cvGetWindowHandle(const char* name)
CV_IMPL const char* cvGetWindowName(void* window_handle)
{
if( !window_handle )
CV_Error( CV_StsNullPtr, "NULL window handler" );
CV_Error( cv::Error::StsNullPtr, "NULL window handler" );
return ((CvWindow*)window_handle)->objectName().toLatin1().data();
}
@@ -616,7 +616,7 @@ CV_IMPL const char* cvGetWindowName(void* window_handle)
CV_IMPL void cvMoveWindow(const char* name, int x, int y)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"moveWindow",
autoBlockingConnection(),
@@ -628,7 +628,7 @@ CV_IMPL void cvMoveWindow(const char* name, int x, int y)
CV_IMPL void cvResizeWindow(const char* name, int width, int height)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"resizeWindow",
autoBlockingConnection(),
@@ -641,7 +641,7 @@ CV_IMPL void cvResizeWindow(const char* name, int width, int height)
CV_IMPL int cvCreateTrackbar2(const char* name_bar, const char* window_name, int* val, int count, CvTrackbarCallback2 on_notify, void* userdata)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"addSlider2",
@@ -666,7 +666,7 @@ CV_IMPL int cvStartWindowThread()
CV_IMPL int cvCreateTrackbar(const char* name_bar, const char* window_name, int* value, int count, CvTrackbarCallback on_change)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"addSlider",
@@ -684,7 +684,7 @@ CV_IMPL int cvCreateTrackbar(const char* name_bar, const char* window_name, int*
CV_IMPL int cvCreateButton(const char* button_name, CvButtonCallback on_change, void* userdata, int button_type, int initial_button_state)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
if (initial_button_state < 0 || initial_button_state > 1)
return 0;
@@ -750,7 +750,7 @@ CV_IMPL void cvSetMouseCallback(const char* window_name, CvMouseCallback on_mous
QPointer<CvWindow> w = icvFindWindowByName(QLatin1String(window_name));
if (!w)
CV_Error(CV_StsNullPtr, "NULL window handler");
CV_Error(cv::Error::StsNullPtr, "NULL window handler");
w->setMouseCallBack(on_mouse, param);
@@ -780,7 +780,7 @@ CV_IMPL void cvShowImage(const char* name, const CvArr* arr)
CV_IMPL void cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"setOpenGlDrawCallback",
@@ -794,7 +794,7 @@ CV_IMPL void cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallba
CV_IMPL void cvSetOpenGlContext(const char* window_name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"setOpenGlContext",
@@ -806,7 +806,7 @@ CV_IMPL void cvSetOpenGlContext(const char* window_name)
CV_IMPL void cvUpdateWindow(const char* window_name)
{
if (!guiMainThread)
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
CV_Error( cv::Error::StsNullPtr, "NULL guiReceiver (please create a window)" );
QMetaObject::invokeMethod(guiMainThread,
"updateWindow",
@@ -1036,7 +1036,7 @@ void GuiReceiver::toggleFullScreen(QString name, double arg2)
void GuiReceiver::createWindow(QString name, int flags)
{
if (!qApp)
CV_Error(CV_StsNullPtr, "NULL session handler" );
CV_Error(cv::Error::StsNullPtr, "NULL session handler" );
// Check the name in the storage
if (icvFindWindowByName(name.toLatin1().data()))
@@ -1127,7 +1127,7 @@ void GuiReceiver::destroyWindow(QString name)
void GuiReceiver::destroyAllWindow()
{
if (!qApp)
CV_Error(CV_StsNullPtr, "NULL session handler" );
CV_Error(cv::Error::StsNullPtr, "NULL session handler" );
if (multiThreads)
{
@@ -1256,7 +1256,7 @@ void GuiReceiver::addSlider2(QString bar_name, QString window_name, void* value,
return;
if (count <= 0) //count is the max value of the slider, so must be bigger than 0
CV_Error(CV_StsNullPtr, "Max value of the slider must be bigger than 0" );
CV_Error(cv::Error::StsNullPtr, "Max value of the slider must be bigger than 0" );
CvWindow::addSlider2(w, bar_name, (int*)value, count, (CvTrackbarCallback2) on_change, userdata);
}
@@ -1286,10 +1286,10 @@ void GuiReceiver::addSlider(QString bar_name, QString window_name, void* value,
return;
if (!value)
CV_Error(CV_StsNullPtr, "NULL value pointer" );
CV_Error(cv::Error::StsNullPtr, "NULL value pointer" );
if (count <= 0) //count is the max value of the slider, so must be bigger than 0
CV_Error(CV_StsNullPtr, "Max value of the slider must be bigger than 0" );
CV_Error(cv::Error::StsNullPtr, "Max value of the slider must be bigger than 0" );
CvWindow::addSlider(w, bar_name, (int*)value, count, (CvTrackbarCallback) on_change);
}
@@ -1703,7 +1703,7 @@ CvWindow::CvWindow(QString name, int arg2)
//3: my view
#ifndef HAVE_QT_OPENGL
if (arg2 & CV_WINDOW_OPENGL)
CV_Error( CV_OpenGlNotSupported, "Library was built without OpenGL support" );
CV_Error( cv::Error::OpenGlNotSupported, "Library was built without OpenGL support" );
mode_display = CV_MODE_NORMAL;
#else
mode_display = arg2 & CV_WINDOW_OPENGL ? CV_MODE_OPENGL : CV_MODE_NORMAL;
@@ -2662,19 +2662,19 @@ void DefaultViewPort::startDisplayInfo(QString text, int delayms)
void DefaultViewPort::setOpenGlDrawCallback(CvOpenGlDrawCallback /*callback*/, void* /*userdata*/)
{
CV_Error(CV_OpenGlNotSupported, "Window doesn't support OpenGL");
CV_Error(cv::Error::OpenGlNotSupported, "Window doesn't support OpenGL");
}
void DefaultViewPort::makeCurrentOpenGlContext()
{
CV_Error(CV_OpenGlNotSupported, "Window doesn't support OpenGL");
CV_Error(cv::Error::OpenGlNotSupported, "Window doesn't support OpenGL");
}
void DefaultViewPort::updateGl()
{
CV_Error(CV_OpenGlNotSupported, "Window doesn't support OpenGL");
CV_Error(cv::Error::OpenGlNotSupported, "Window doesn't support OpenGL");
}
@@ -2777,7 +2777,7 @@ void DefaultViewPort::saveView()
return;
}
CV_Error(CV_StsNullPtr, "file extension not recognized, please choose between JPG, JPEG, BMP or PNG");
CV_Error(cv::Error::StsNullPtr, "file extension not recognized, please choose between JPG, JPEG, BMP or PNG");
}
}
+13 -13
View File
@@ -744,7 +744,7 @@ CvRect cvGetWindowRect_GTK(const char* name)
CV_LOCK_MUTEX();
const auto window = icvFindWindowByName(name);
if (!window)
CV_Error( CV_StsNullPtr, "NULL window" );
CV_Error( cv::Error::StsNullPtr, "NULL window" );
return cvRect(getImageRect_(window));
}
@@ -786,7 +786,7 @@ double cvGetModeWindow_GTK(const char* name)//YV
CV_LOCK_MUTEX();
const auto window = icvFindWindowByName(name);
if (!window)
CV_Error( CV_StsNullPtr, "NULL window" );
CV_Error( cv::Error::StsNullPtr, "NULL window" );
double result = window->status;
return result;
@@ -801,7 +801,7 @@ void cvSetModeWindow_GTK( const char* name, double prop_value)//Yannick Verdie
const auto window = icvFindWindowByName(name);
if (!window)
CV_Error( CV_StsNullPtr, "NULL window" );
CV_Error( cv::Error::StsNullPtr, "NULL window" );
setModeWindow_(window, (int)prop_value);
}
@@ -917,11 +917,11 @@ namespace
// Try double-buffered visual
glconfig = gdk_gl_config_new_by_mode((GdkGLConfigMode)(GDK_GL_MODE_RGB | GDK_GL_MODE_DEPTH | GDK_GL_MODE_DOUBLE));
if (!glconfig)
CV_Error( CV_OpenGlApiCallError, "Can't Create A GL Device Context" );
CV_Error( cv::Error::OpenGlApiCallError, "Can't Create A GL Device Context" );
// Set OpenGL-capability to the widget
if (!gtk_widget_set_gl_capability(window->widget, glconfig, NULL, TRUE, GDK_GL_RGBA_TYPE))
CV_Error( CV_OpenGlApiCallError, "Can't Create A GL Device Context" );
CV_Error( cv::Error::OpenGlApiCallError, "Can't Create A GL Device Context" );
window->useGl = true;
}
@@ -932,7 +932,7 @@ namespace
GdkGLDrawable* gldrawable = gtk_widget_get_gl_drawable(window->widget);
if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext))
CV_Error( CV_OpenGlApiCallError, "Can't Activate The GL Rendering Context" );
CV_Error( cv::Error::OpenGlApiCallError, "Can't Activate The GL Rendering Context" );
glViewport(0, 0, gtk_widget_get_allocated_width(window->widget), gtk_widget_get_allocated_height(window->widget));
@@ -1050,7 +1050,7 @@ static std::shared_ptr<CvWindow> namedWindow_(const std::string& name, int flags
#ifndef HAVE_OPENGL
if (flags & CV_WINDOW_OPENGL)
CV_Error( CV_OpenGlNotSupported, "Library was built without OpenGL support" );
CV_Error( cv::Error::OpenGlNotSupported, "Library was built without OpenGL support" );
#else
if (flags & CV_WINDOW_OPENGL)
createGlContext(window);
@@ -1131,16 +1131,16 @@ CV_IMPL void cvSetOpenGlContext(const char* name)
auto window = icvFindWindowByName(name);
if (!window)
CV_Error( CV_StsNullPtr, "NULL window" );
CV_Error( cv::Error::StsNullPtr, "NULL window" );
if (!window->useGl)
CV_Error( CV_OpenGlNotSupported, "Window doesn't support OpenGL" );
CV_Error( cv::Error::OpenGlNotSupported, "Window doesn't support OpenGL" );
glcontext = gtk_widget_get_gl_context(window->widget);
gldrawable = gtk_widget_get_gl_drawable(window->widget);
if (!gdk_gl_drawable_make_current(gldrawable, glcontext))
CV_Error( CV_OpenGlApiCallError, "Can't Activate The GL Rendering Context" );
CV_Error( cv::Error::OpenGlApiCallError, "Can't Activate The GL Rendering Context" );
}
CV_IMPL void cvUpdateWindow(const char* name)
@@ -1168,7 +1168,7 @@ CV_IMPL void cvSetOpenGlDrawCallback(const char* name, CvOpenGlDrawCallback call
return;
if (!window->useGl)
CV_Error( CV_OpenGlNotSupported, "Window was created without OpenGL context" );
CV_Error( cv::Error::OpenGlNotSupported, "Window was created without OpenGL context" );
window->glDrawCallback = callback;
window->glDrawData = userdata;
@@ -1384,7 +1384,7 @@ icvCreateTrackbar( const char* trackbar_name, const char* window_name,
CV_Assert(trackbar_name && "NULL trackbar name");
if( count <= 0 )
CV_Error( CV_StsOutOfRange, "Bad trackbar maximal value" );
CV_Error( cv::Error::StsOutOfRange, "Bad trackbar maximal value" );
CV_LOCK_MUTEX();
@@ -1557,7 +1557,7 @@ CV_IMPL void cvSetTrackbarPos( const char* trackbar_name, const char* window_nam
const auto trackbar = icvFindTrackbarByName(window, trackbar_name);
if (!trackbar)
{
CV_Error( CV_StsNullPtr, "No trackbar found" );
CV_Error( cv::Error::StsNullPtr, "No trackbar found" );
}
return setTrackbarPos_(trackbar, pos);
+17 -17
View File
@@ -36,7 +36,7 @@
#define CV_WINRT_NO_GUI_ERROR( funcname ) \
{ \
cvError( CV_StsNotImplemented, funcname, \
cvError( cv::Error::StsNotImplemented, funcname, \
"The function is not implemented. ", \
__FILE__, __LINE__ ); \
}
@@ -65,7 +65,7 @@ CV_IMPL void cvShowImage(const char* name, const CvArr* arr)
CvMat stub, *image;
if (!name)
CV_ERROR(CV_StsNullPtr, "NULL name");
CV_ERROR(cv::Error::StsNullPtr, "NULL name");
CvWindow* window = HighguiBridge::getInstance().namedWindow(name);
@@ -89,7 +89,7 @@ CV_IMPL int cvNamedWindow(const char* name, int flags)
CV_FUNCNAME("cvNamedWindow");
if (!name)
CV_ERROR(CV_StsNullPtr, "NULL name");
CV_ERROR(cv::Error::StsNullPtr, "NULL name");
HighguiBridge::getInstance().namedWindow(name);
@@ -101,7 +101,7 @@ CV_IMPL void cvDestroyWindow(const char* name)
CV_FUNCNAME("cvDestroyWindow");
if (!name)
CV_ERROR(CV_StsNullPtr, "NULL name string");
CV_ERROR(cv::Error::StsNullPtr, "NULL name string");
HighguiBridge::getInstance().destroyWindow(name);
}
@@ -119,16 +119,16 @@ CV_IMPL int cvCreateTrackbar2(const char* trackbar_name, const char* window_name
int pos = 0;
if (!window_name || !trackbar_name)
CV_ERROR(CV_StsNullPtr, "NULL window or trackbar name");
CV_ERROR(cv::Error::StsNullPtr, "NULL window or trackbar name");
if (count < 0)
CV_ERROR(CV_StsOutOfRange, "Bad trackbar max value");
CV_ERROR(cv::Error::StsOutOfRange, "Bad trackbar max value");
CvWindow* window = HighguiBridge::getInstance().namedWindow(window_name);
if (!window)
{
CV_ERROR(CV_StsNullPtr, "NULL window");
CV_ERROR(cv::Error::StsNullPtr, "NULL window");
}
window->createSlider(trackbar_name, val, count, on_notify, userdata);
@@ -143,7 +143,7 @@ CV_IMPL void cvSetTrackbarPos(const char* trackbar_name, const char* window_name
CvTrackbar* trackbar = 0;
if (trackbar_name == 0 || window_name == 0)
CV_ERROR(CV_StsNullPtr, "NULL trackbar or window name");
CV_ERROR(cv::Error::StsNullPtr, "NULL trackbar or window name");
CvWindow* window = HighguiBridge::getInstance().findWindowByName(window_name);
if (window)
@@ -160,7 +160,7 @@ CV_IMPL void cvSetTrackbarMax(const char* trackbar_name, const char* window_name
if (maxval >= 0)
{
if (trackbar_name == 0 || window_name == 0)
CV_ERROR(CV_StsNullPtr, "NULL trackbar or window name");
CV_ERROR(cv::Error::StsNullPtr, "NULL trackbar or window name");
CvTrackbar* trackbar = HighguiBridge::getInstance().findTrackbarByName(trackbar_name, window_name);
@@ -176,7 +176,7 @@ CV_IMPL void cvSetTrackbarMin(const char* trackbar_name, const char* window_name
if (minval >= 0)
{
if (trackbar_name == 0 || window_name == 0)
CV_ERROR(CV_StsNullPtr, "NULL trackbar or window name");
CV_ERROR(cv::Error::StsNullPtr, "NULL trackbar or window name");
CvTrackbar* trackbar = HighguiBridge::getInstance().findTrackbarByName(trackbar_name, window_name);
@@ -192,7 +192,7 @@ CV_IMPL int cvGetTrackbarPos(const char* trackbar_name, const char* window_name)
CV_FUNCNAME("cvGetTrackbarPos");
if (trackbar_name == 0 || window_name == 0)
CV_ERROR(CV_StsNullPtr, "NULL trackbar or window name");
CV_ERROR(cv::Error::StsNullPtr, "NULL trackbar or window name");
CvTrackbar* trackbar = HighguiBridge::getInstance().findTrackbarByName(trackbar_name, window_name);
@@ -229,7 +229,7 @@ CV_IMPL void cvSetMouseCallback(const char* window_name, CvMouseCallback on_mous
CV_FUNCNAME("cvSetMouseCallback");
if (!window_name)
CV_ERROR(CV_StsNullPtr, "NULL window name");
CV_ERROR(cv::Error::StsNullPtr, "NULL window name");
CvWindow* window = HighguiBridge::getInstance().findWindowByName(window_name);
if (!window)
@@ -253,19 +253,19 @@ CV_IMPL void cvResizeWindow(const char* name, int width, int height)
CV_IMPL int cvInitSystem(int, char**)
{
CV_WINRT_NO_GUI_ERROR("cvInitSystem");
return CV_StsNotImplemented;
return cv::Error::StsNotImplemented;
}
CV_IMPL void* cvGetWindowHandle(const char*)
{
CV_WINRT_NO_GUI_ERROR("cvGetWindowHandle");
return (void*) CV_StsNotImplemented;
return (void*) cv::Error::StsNotImplemented;
}
CV_IMPL const char* cvGetWindowName(void*)
{
CV_WINRT_NO_GUI_ERROR("cvGetWindowName");
return (const char*) CV_StsNotImplemented;
return (const char*) cv::Error::StsNotImplemented;
}
void cvSetModeWindow_WinRT(const char* name, double prop_value) {
@@ -274,10 +274,10 @@ void cvSetModeWindow_WinRT(const char* name, double prop_value) {
double cvGetModeWindow_WinRT(const char* name) {
CV_WINRT_NO_GUI_ERROR("cvGetModeWindow");
return CV_StsNotImplemented;
return cv::Error::StsNotImplemented;
}
CV_IMPL int cvStartWindowThread() {
CV_WINRT_NO_GUI_ERROR("cvStartWindowThread");
return CV_StsNotImplemented;
return cv::Error::StsNotImplemented;
}
+15 -15
View File
@@ -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" );
}
+3 -3
View File
@@ -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));
}
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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);
+3 -3
View File
@@ -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;
}
}
+16 -16
View File
@@ -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 );
+14 -14
View File
@@ -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
+4 -4
View File
@@ -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" );
}
}
+1 -1
View File
@@ -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 );
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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
View File
@@ -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;
+3 -3
View File
@@ -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));
}
+7 -7
View File
@@ -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;
+1 -1
View File
@@ -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);
}
+7 -7
View File
@@ -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 );
+49 -49
View File
@@ -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)
+5 -5
View File
@@ -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,
+8 -8
View File
@@ -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)
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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;
}
+7 -7
View File
@@ -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;
+3 -3
View File
@@ -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 );
}
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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*" );
}
+5 -5
View File
@@ -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;
}
+1 -1
View File
@@ -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 );
+1 -1
View File
@@ -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 */
+2 -2
View File
@@ -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 )
{
+4 -4
View File
@@ -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;
+8 -8
View File
@@ -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;
+1 -1
View File
@@ -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. */
+5 -5
View 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;
+2 -2
View File
@@ -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;
+7 -7
View File
@@ -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() )
{
+3 -3
View File
@@ -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" );
+1 -1
View File
@@ -1824,7 +1824,7 @@ void CV_ColorBayerTest::prepare_to_validation( int /*test_case_idx*/ )
else if( depth == CV_16U )
bayer2BGR_<ushort>(src, dst, fwd_code);
else
CV_Error(CV_StsUnsupportedFormat, "");
CV_Error(cv::Error::StsUnsupportedFormat, "");
}
+1 -1
View File
@@ -307,7 +307,7 @@ void CV_MorphologyBaseTest::prepare_to_validation( int /*test_case_idx*/ )
cvtest::add( dst, 1, src, -1, Scalar::all(0), dst, dst.type() );
}
else
CV_Error( CV_StsBadArg, "Unknown operation" );
CV_Error( cv::Error::StsBadArg, "Unknown operation" );
}
cvReleaseStructuringElement( &element );
+10 -10
View File
@@ -223,7 +223,7 @@ public:
void setActivationFunction(int _activ_func, double _f_param1, double _f_param2) CV_OVERRIDE
{
if( _activ_func < 0 || _activ_func > LEAKYRELU)
CV_Error( CV_StsOutOfRange, "Unknown activation function" );
CV_Error( cv::Error::StsOutOfRange, "Unknown activation function" );
activ_func = _activ_func;
@@ -322,7 +322,7 @@ public:
{
int n = layer_sizes[i];
if( n < 1 + (0 < i && i < l_count-1))
CV_Error( CV_StsOutOfRange,
CV_Error( cv::Error::StsOutOfRange,
"there should be at least one input and one output "
"and every hidden layer must have more than 1 neuron" );
max_lsize = std::max( max_lsize, n );
@@ -341,7 +341,7 @@ public:
float predict( InputArray _inputs, OutputArray _outputs, int ) const CV_OVERRIDE
{
if( !trained )
CV_Error( CV_StsError, "The network has not been trained or loaded" );
CV_Error( cv::Error::StsError, "The network has not been trained or loaded" );
Mat inputs = _inputs.getMat();
int type = inputs.type(), l_count = layer_count();
@@ -790,7 +790,7 @@ public:
{
t = t*inv_scale[j*2] + inv_scale[2*j+1];
if( t < m1 || t > M1 )
CV_Error( CV_StsOutOfRange,
CV_Error( cv::Error::StsOutOfRange,
"Some of new output training vector components run exceed the original range too much" );
}
}
@@ -817,25 +817,25 @@ public:
Mat& sample_weights, int flags )
{
if( layer_sizes.empty() )
CV_Error( CV_StsError,
CV_Error( cv::Error::StsError,
"The network has not been created. Use method create or the appropriate constructor" );
if( (inputs.type() != CV_32F && inputs.type() != CV_64F) ||
inputs.cols != layer_sizes[0] )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"input training data should be a floating-point matrix with "
"the number of rows equal to the number of training samples and "
"the number of columns equal to the size of 0-th (input) layer" );
if( (outputs.type() != CV_32F && outputs.type() != CV_64F) ||
outputs.cols != layer_sizes.back() )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"output training data should be a floating-point matrix with "
"the number of rows equal to the number of training samples and "
"the number of columns equal to the size of last (output) layer" );
if( inputs.rows != outputs.rows )
CV_Error( CV_StsUnmatchedSizes, "The numbers of input and output samples do not match" );
CV_Error( cv::Error::StsUnmatchedSizes, "The numbers of input and output samples do not match" );
Mat temp;
double s = sum(sample_weights)[0];
@@ -1323,7 +1323,7 @@ public:
fs << "itePerStep" << params.itePerStep;
}
else
CV_Error(CV_StsError, "Unknown training method");
CV_Error(cv::Error::StsError, "Unknown training method");
fs << "term_criteria" << "{";
if( params.termCrit.type & TermCriteria::EPS )
@@ -1421,7 +1421,7 @@ public:
params.itePerStep = tpn["itePerStep"];
}
else
CV_Error(CV_StsParseError, "Unknown training method (should be BACKPROP or RPROP)");
CV_Error(cv::Error::StsParseError, "Unknown training method (should be BACKPROP or RPROP)");
FileNode tcn = tpn["term_criteria"];
if( !tcn.empty() )
+2 -2
View File
@@ -308,7 +308,7 @@ public:
}
}
else
CV_Error(CV_StsNotImplemented, "Unknown boosting type");
CV_Error(cv::Error::StsNotImplemented, "Unknown boosting type");
/*if( bparams.boostType != Boost::LOGIT )
{
@@ -387,7 +387,7 @@ public:
void write( FileStorage& fs ) const CV_OVERRIDE
{
if( roots.empty() )
CV_Error( CV_StsBadArg, "RTrees have not been trained" );
CV_Error( cv::Error::StsBadArg, "RTrees have not been trained" );
writeFormat(fs);
writeParams(fs);
+7 -7
View File
@@ -574,7 +574,7 @@ public:
if( nvars == 0 )
{
if( rowvals.empty() )
CV_Error(CV_StsBadArg, "invalid CSV format; no data found");
CV_Error(cv::Error::StsBadArg, "invalid CSV format; no data found");
nvars = (int)rowvals.size();
if( !varTypeSpec.empty() && varTypeSpec.size() > 0 )
{
@@ -637,7 +637,7 @@ public:
{
for( i = ninputvars; i < nvars; i++ )
if( vtypes[i] == VAR_CATEGORICAL )
CV_Error(CV_StsBadArg,
CV_Error(cv::Error::StsBadArg,
"If responses are vector values, not scalars, they must be marked as ordered responses");
}
}
@@ -724,14 +724,14 @@ public:
}
if ( ptr[3] != '[')
CV_Error( CV_StsBadArg, errmsg );
CV_Error( cv::Error::StsBadArg, errmsg );
ptr += 4; // pass "ord["
do
{
int b1 = (int)strtod( ptr, &stopstring );
if( *stopstring == 0 || (*stopstring != ',' && *stopstring != ']' && *stopstring != '-') )
CV_Error( CV_StsBadArg, errmsg );
CV_Error( cv::Error::StsBadArg, errmsg );
ptr = stopstring + 1;
if( (stopstring[0] == ',') || (stopstring[0] == ']'))
{
@@ -745,7 +745,7 @@ public:
{
int b2 = (int)strtod( ptr, &stopstring);
if ( (*stopstring == 0) || (*stopstring != ',' && *stopstring != ']') )
CV_Error( CV_StsBadArg, errmsg );
CV_Error( cv::Error::StsBadArg, errmsg );
ptr = stopstring + 1;
CV_Assert( 0 <= b1 && b1 <= b2 && b2 < nvars );
for (int i = b1; i <= b2; i++)
@@ -753,7 +753,7 @@ public:
specCounter += b2 - b1 + 1;
}
else
CV_Error( CV_StsBadArg, errmsg );
CV_Error( cv::Error::StsBadArg, errmsg );
}
}
@@ -762,7 +762,7 @@ public:
}
if( specCounter != nvars )
CV_Error( CV_StsBadArg, "type of some variables is not specified" );
CV_Error( cv::Error::StsBadArg, "type of some variables is not specified" );
}
void setTrainTestSplitRatio(double ratio, bool shuffle) CV_OVERRIDE
+7 -7
View File
@@ -218,7 +218,7 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag,
orig_response->data.fl[i] = (float) _responses->data.i[i*step];
}; break;
default:
CV_Error(CV_StsUnmatchedFormats, "Response should be a 32fC1 or 32sC1 vector.");
CV_Error(cv::Error::StsUnmatchedFormats, "Response should be a 32fC1 or 32sC1 vector.");
}
if (!is_regression)
@@ -283,7 +283,7 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag,
sample_idx->data.i[active_samples_count++] = i;
} break;
default: CV_Error(CV_StsUnmatchedFormats, "_sample_idx should be a 32sC1, 8sC1 or 8uC1 vector.");
default: CV_Error(cv::Error::StsUnmatchedFormats, "_sample_idx should be a 32sC1, 8sC1 or 8uC1 vector.");
}
}
else
@@ -1072,7 +1072,7 @@ void CvGBTrees::read_params( CvFileStorage* fs, CvFileNode* fnode )
if( params.loss_function_type < SQUARED_LOSS || params.loss_function_type > DEVIANCE_LOSS || params.loss_function_type == 2)
CV_ERROR( CV_StsBadArg, "Unknown loss function" );
CV_ERROR( cv::Error::StsBadArg, "Unknown loss function" );
params.weak_count = cvReadIntByName( fs, fnode, "ensemble_length" );
params.shrinkage = (float)cvReadRealByName( fs, fnode, "shrinkage", 0.1 );
@@ -1082,7 +1082,7 @@ void CvGBTrees::read_params( CvFileStorage* fs, CvFileNode* fnode )
{
class_labels = (CvMat*)cvReadByName( fs, fnode, "class_labels" );
if( class_labels && !CV_IS_MAT(class_labels))
CV_ERROR( CV_StsParseError, "class_labels must stored as a matrix");
CV_ERROR( cv::Error::StsParseError, "class_labels must stored as a matrix");
}
data->is_classifier = 0;
@@ -1105,7 +1105,7 @@ void CvGBTrees::write( CvFileStorage* fs, const char* name ) const
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_ML_GBT );
if( !weak )
CV_ERROR( CV_StsBadArg, "The model has not been trained yet" );
CV_ERROR( cv::Error::StsBadArg, "The model has not been trained yet" );
write_params( fs );
cvWriteReal( fs, "base_value", base_value);
@@ -1170,13 +1170,13 @@ void CvGBTrees::read( CvFileStorage* fs, CvFileNode* node )
trees_fnode = cvGetFileNodeByName( fs, node, s.c_str() );
if( !trees_fnode || !CV_NODE_IS_SEQ(trees_fnode->tag) )
CV_ERROR( CV_StsParseError, "<trees_x> tag is missing" );
CV_ERROR( cv::Error::StsParseError, "<trees_x> tag is missing" );
cvStartReadSeq( trees_fnode->data.seq, &reader );
ntrees = trees_fnode->data.seq->total;
if( ntrees != params.weak_count )
CV_ERROR( CV_StsUnmatchedSizes,
CV_ERROR( cv::Error::StsUnmatchedSizes,
"The number of trees stored does not match <ntrees> tag value" );
CV_CALL( storage = cvCreateMemStorage() );
+1 -1
View File
@@ -63,7 +63,7 @@ bool StatModel::train(const Ptr<TrainData>& trainData, int )
{
CV_TRACE_FUNCTION();
CV_Assert(!trainData.empty());
CV_Error(CV_StsNotImplemented, "");
CV_Error(cv::Error::StsNotImplemented, "");
return false;
}
+14 -14
View File
@@ -109,15 +109,15 @@ bool LogisticRegressionImpl::train(const Ptr<TrainData>& trainData, int)
CV_Assert( !_labels_i.empty() && !_data_i.empty());
if(_labels_i.cols != 1)
{
CV_Error( CV_StsBadArg, "labels should be a column matrix" );
CV_Error( cv::Error::StsBadArg, "labels should be a column matrix" );
}
if(_data_i.type() != CV_32FC1 || _labels_i.type() != CV_32FC1)
{
CV_Error( CV_StsBadArg, "data and labels must be a floating point matrix" );
CV_Error( cv::Error::StsBadArg, "data and labels must be a floating point matrix" );
}
if(_labels_i.rows != _data_i.rows)
{
CV_Error( CV_StsBadArg, "number of rows in data and labels should be equal" );
CV_Error( cv::Error::StsBadArg, "number of rows in data and labels should be equal" );
}
// class labels
@@ -126,7 +126,7 @@ bool LogisticRegressionImpl::train(const Ptr<TrainData>& trainData, int)
int num_classes = (int) this->forward_mapper.size();
if(num_classes < 2)
{
CV_Error( CV_StsBadArg, "data should have at least 2 classes" );
CV_Error( cv::Error::StsBadArg, "data should have at least 2 classes" );
}
// add a column of ones to the data (bias/intercept term)
@@ -174,7 +174,7 @@ bool LogisticRegressionImpl::train(const Ptr<TrainData>& trainData, int)
this->learnt_thetas = thetas.clone();
if( cvIsNaN( (double)sum(this->learnt_thetas)[0] ) )
{
CV_Error( CV_StsBadArg, "check training parameters. Invalid training classifier" );
CV_Error( cv::Error::StsBadArg, "check training parameters. Invalid training classifier" );
}
// success
@@ -187,7 +187,7 @@ float LogisticRegressionImpl::predict(InputArray samples, OutputArray results, i
// check if learnt_mats array is populated
if(!this->isTrained())
{
CV_Error( CV_StsBadArg, "classifier should be trained first" );
CV_Error( cv::Error::StsBadArg, "classifier should be trained first" );
}
// coefficient matrix
@@ -206,7 +206,7 @@ float LogisticRegressionImpl::predict(InputArray samples, OutputArray results, i
Mat data = samples.getMat();
if(data.type() != CV_32F)
{
CV_Error( CV_StsBadArg, "data must be of floating type" );
CV_Error( cv::Error::StsBadArg, "data must be of floating type" );
}
// add a column of ones to the data (bias/intercept term)
@@ -327,7 +327,7 @@ double LogisticRegressionImpl::compute_cost(const Mat& _data, const Mat& _labels
if(cvIsNaN( cost ) == 1)
{
CV_Error( CV_StsBadArg, "check training parameters. Invalid training classifier" );
CV_Error( cv::Error::StsBadArg, "check training parameters. Invalid training classifier" );
}
return cost;
@@ -398,12 +398,12 @@ Mat LogisticRegressionImpl::batch_gradient_descent(const Mat& _data, const Mat&
// implements batch gradient descent
if(this->params.alpha<=0)
{
CV_Error( CV_StsBadArg, "check training parameters (learning rate) for the classifier" );
CV_Error( cv::Error::StsBadArg, "check training parameters (learning rate) for the classifier" );
}
if(this->params.num_iters <= 0)
{
CV_Error( CV_StsBadArg, "number of iterations cannot be zero or a negative number" );
CV_Error( cv::Error::StsBadArg, "number of iterations cannot be zero or a negative number" );
}
int llambda = 0;
@@ -439,12 +439,12 @@ Mat LogisticRegressionImpl::mini_batch_gradient_descent(const Mat& _data, const
if(this->params.mini_batch_size <= 0 || this->params.alpha == 0)
{
CV_Error( CV_StsBadArg, "check training parameters for the classifier" );
CV_Error( cv::Error::StsBadArg, "check training parameters for the classifier" );
}
if(this->params.num_iters <= 0)
{
CV_Error( CV_StsBadArg, "number of iterations cannot be zero or a negative number" );
CV_Error( cv::Error::StsBadArg, "number of iterations cannot be zero or a negative number" );
}
Mat theta_p = _init_theta.clone();
@@ -551,7 +551,7 @@ void LogisticRegressionImpl::write(FileStorage& fs) const
// check if open
if(fs.isOpened() == 0)
{
CV_Error(CV_StsBadArg,"file can't open. Check file path");
CV_Error(cv::Error::StsBadArg,"file can't open. Check file path");
}
writeFormat(fs);
string desc = "Logistic Regression Classifier";
@@ -574,7 +574,7 @@ void LogisticRegressionImpl::read(const FileNode& fn)
// check if empty
if(fn.empty())
{
CV_Error( CV_StsBadArg, "empty FileNode object" );
CV_Error( cv::Error::StsBadArg, "empty FileNode object" );
}
this->params.alpha = (double)fn["alpha"];
+5 -5
View File
@@ -101,7 +101,7 @@ public:
norm(var_idx, __var_idx, NORM_INF) != 0 ||
cls_labels.size() != __cls_labels.size() ||
norm(cls_labels, __cls_labels, NORM_INF) != 0 )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"The new training data is inconsistent with the original training data; varIdx and the class labels should be the same" );
}
@@ -312,11 +312,11 @@ public:
bool rawOutput = (flags & RAW_OUTPUT) != 0;
if( samples.type() != CV_32F || samples.cols != nallvars )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"The input samples must be 32f matrix with the number of columns = nallvars" );
if( (samples.rows > 1) && (! _results.needed()) )
CV_Error( CV_StsNullPtr,
CV_Error( cv::Error::StsNullPtr,
"When the number of input samples is >1, the output vector of results must be passed" );
if( _results.needed() )
@@ -388,7 +388,7 @@ public:
fn["var_all"] >> nallvars;
if( nallvars <= 0 )
CV_Error( CV_StsParseError,
CV_Error( cv::Error::StsParseError,
"The field \"var_count\" of NBayes classifier is missing or non-positive" );
fn["var_idx"] >> var_idx;
@@ -397,7 +397,7 @@ public:
int nclasses = (int)cls_labels.total(), i;
if( cls_labels.empty() || nclasses < 1 )
CV_Error( CV_StsParseError, "No or invalid \"cls_labels\" in NBayes classifier" );
CV_Error( cv::Error::StsParseError, "No or invalid \"cls_labels\" in NBayes classifier" );
FileNodeIterator
count_it = fn["count"].begin(),
+5 -5
View File
@@ -131,13 +131,13 @@ namespace ml
inline void setMaxCategories(int val)
{
if( val < 2 )
CV_Error( CV_StsOutOfRange, "max_categories should be >= 2" );
CV_Error( cv::Error::StsOutOfRange, "max_categories should be >= 2" );
maxCategories = std::min(val, 15 );
}
inline void setMaxDepth(int val)
{
if( val < 0 )
CV_Error( CV_StsOutOfRange, "max_depth should be >= 0" );
CV_Error( cv::Error::StsOutOfRange, "max_depth should be >= 0" );
maxDepth = std::min( val, 25 );
}
inline void setMinSampleCount(int val)
@@ -147,11 +147,11 @@ namespace ml
inline void setCVFolds(int val)
{
if( val < 0 )
CV_Error( CV_StsOutOfRange,
CV_Error( cv::Error::StsOutOfRange,
"params.CVFolds should be =0 (the tree is not pruned) "
"or n>0 (tree is pruned using n-fold cross-validation)" );
if(val > 1)
CV_Error( CV_StsNotImplemented,
CV_Error( cv::Error::StsNotImplemented,
"tree pruning using cross-validation is not implemented."
"Set CVFolds to 1");
@@ -162,7 +162,7 @@ namespace ml
inline void setRegressionAccuracy(float val)
{
if( val < 0 )
CV_Error( CV_StsOutOfRange, "params.regression_accuracy should be >= 0" );
CV_Error( cv::Error::StsOutOfRange, "params.regression_accuracy should be >= 0" );
regressionAccuracy = val;
}
+1 -1
View File
@@ -309,7 +309,7 @@ public:
{
CV_TRACE_FUNCTION();
if( roots.empty() )
CV_Error( CV_StsBadArg, "RTrees have not been trained" );
CV_Error( cv::Error::StsBadArg, "RTrees have not been trained" );
writeFormat(fs);
writeParams(fs);
+23 -23
View File
@@ -95,11 +95,11 @@ const int QFLOAT_TYPE = DataDepth<Qfloat>::value;
static void checkParamGrid(const ParamGrid& pg)
{
if( pg.minVal > pg.maxVal )
CV_Error( CV_StsBadArg, "Lower bound of the grid must be less then the upper one" );
CV_Error( cv::Error::StsBadArg, "Lower bound of the grid must be less then the upper one" );
if( pg.minVal < DBL_EPSILON )
CV_Error( CV_StsBadArg, "Lower bound of the grid must be positive" );
CV_Error( cv::Error::StsBadArg, "Lower bound of the grid must be positive" );
if( pg.logStep < 1. + FLT_EPSILON )
CV_Error( CV_StsBadArg, "Grid step must greater than 1" );
CV_Error( cv::Error::StsBadArg, "Grid step must greater than 1" );
}
// SVM training parameters
@@ -325,7 +325,7 @@ public:
calc_intersec(vcount, var_count, vecs, another, results);
break;
default:
CV_Error(CV_StsBadArg, "Unknown kernel type");
CV_Error(cv::Error::StsBadArg, "Unknown kernel type");
}
const Qfloat max_val = (Qfloat)(FLT_MAX*1e-3);
for( int j = 0; j < vcount; j++ )
@@ -410,7 +410,7 @@ ParamGrid SVM::getDefaultGrid( int param_id )
grid.logStep = 7; // total iterations = 3
}
else
cvError( CV_StsBadArg, "SVM::getDefaultGrid", "Invalid type of parameter "
cvError( cv::Error::StsBadArg, "SVM::getDefaultGrid", "Invalid type of parameter "
"(use one of SVM::C, SVM::GAMMA et al.)", __FILE__, __LINE__ );
return grid;
}
@@ -1297,12 +1297,12 @@ public:
if( kernelType != LINEAR && kernelType != POLY &&
kernelType != SIGMOID && kernelType != RBF &&
kernelType != INTER && kernelType != CHI2)
CV_Error( CV_StsBadArg, "Unknown/unsupported kernel type" );
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported kernel type" );
if( kernelType == LINEAR )
params.gamma = 1;
else if( params.gamma <= 0 )
CV_Error( CV_StsOutOfRange, "gamma parameter of the kernel must be positive" );
CV_Error( cv::Error::StsOutOfRange, "gamma parameter of the kernel must be positive" );
if( kernelType != SIGMOID && kernelType != POLY )
params.coef0 = 0;
@@ -1310,14 +1310,14 @@ public:
if( kernelType != POLY )
params.degree = 0;
else if( params.degree <= 0 )
CV_Error( CV_StsOutOfRange, "The kernel parameter <degree> must be positive" );
CV_Error( cv::Error::StsOutOfRange, "The kernel parameter <degree> must be positive" );
kernel = makePtr<SVMKernelImpl>(params);
}
else
{
if (!kernel)
CV_Error( CV_StsBadArg, "Custom kernel is not set" );
CV_Error( cv::Error::StsBadArg, "Custom kernel is not set" );
}
int svmType = params.svmType;
@@ -1325,22 +1325,22 @@ public:
if( svmType != C_SVC && svmType != NU_SVC &&
svmType != ONE_CLASS && svmType != EPS_SVR &&
svmType != NU_SVR )
CV_Error( CV_StsBadArg, "Unknown/unsupported SVM type" );
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported SVM type" );
if( svmType == ONE_CLASS || svmType == NU_SVC )
params.C = 0;
else if( params.C <= 0 )
CV_Error( CV_StsOutOfRange, "The parameter C must be positive" );
CV_Error( cv::Error::StsOutOfRange, "The parameter C must be positive" );
if( svmType == C_SVC || svmType == EPS_SVR )
params.nu = 0;
else if( params.nu <= 0 || params.nu >= 1 )
CV_Error( CV_StsOutOfRange, "The parameter nu must be between 0 and 1" );
CV_Error( cv::Error::StsOutOfRange, "The parameter nu must be between 0 and 1" );
if( svmType != EPS_SVR )
params.p = 0;
else if( params.p <= 0 )
CV_Error( CV_StsOutOfRange, "The parameter p must be positive" );
CV_Error( cv::Error::StsOutOfRange, "The parameter p must be positive" );
if( svmType != C_SVC )
params.classWeights.release();
@@ -1431,7 +1431,7 @@ public:
if( (cw.cols != 1 && cw.rows != 1) ||
(int)cw.total() != class_count ||
(cw.type() != CV_32F && cw.type() != CV_64F) )
CV_Error( CV_StsBadArg, "params.class_weights must be 1d floating-point vector "
CV_Error( cv::Error::StsBadArg, "params.class_weights must be 1d floating-point vector "
"containing as many elements as the number of classes" );
cw.convertTo(class_weights, CV_64F, params.C);
@@ -1446,7 +1446,7 @@ public:
//check that while cross-validation there were the samples from all the classes
if ((int)class_ranges.size() < class_count + 1)
CV_Error( CV_StsBadArg, "While cross-validation one or more of the classes have "
CV_Error( cv::Error::StsBadArg, "While cross-validation one or more of the classes have "
"been fell out of the sample. Try to reduce <Params::k_fold>" );
if( svmType == NU_SVC )
@@ -1620,7 +1620,7 @@ public:
{
responses = data->getTrainNormCatResponses();
if( responses.empty() )
CV_Error(CV_StsBadArg, "in the case of classification problem the responses must be categorical; "
CV_Error(cv::Error::StsBadArg, "in the case of classification problem the responses must be categorical; "
"either specify varType when creating TrainData, or pass integer responses");
class_labels = data->getClassLabels();
}
@@ -1969,7 +1969,7 @@ public:
}
}
else
CV_Error( CV_StsBadArg, "INTERNAL ERROR: Unknown SVM type, "
CV_Error( cv::Error::StsBadArg, "INTERNAL ERROR: Unknown SVM type, "
"the SVM structure is probably corrupted" );
}
@@ -2112,7 +2112,7 @@ public:
int class_count = !class_labels.empty() ? (int)class_labels.total() :
params.svmType == ONE_CLASS ? 1 : 0;
if( !isTrained() )
CV_Error( CV_StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
CV_Error( cv::Error::StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
writeFormat(fs);
write_params( fs );
@@ -2197,11 +2197,11 @@ public:
svm_type_str == "NU_SVR" ? NU_SVR : -1;
if( svmType < 0 )
CV_Error( CV_StsParseError, "Missing or invalid SVM type" );
CV_Error( cv::Error::StsParseError, "Missing or invalid SVM type" );
FileNode kernel_node = fn["kernel"];
if( kernel_node.empty() )
CV_Error( CV_StsParseError, "SVM kernel tag is not found" );
CV_Error( cv::Error::StsParseError, "SVM kernel tag is not found" );
String kernel_type_str = (String)kernel_node["type"];
int kernelType =
@@ -2213,7 +2213,7 @@ public:
kernel_type_str == "INTER" ? INTER : CUSTOM;
if( kernelType == CUSTOM )
CV_Error( CV_StsParseError, "Invalid SVM kernel type (or custom kernel)" );
CV_Error( cv::Error::StsParseError, "Invalid SVM kernel type (or custom kernel)" );
_params.svmType = svmType;
_params.kernelType = kernelType;
@@ -2253,7 +2253,7 @@ public:
int class_count = (int)fn["class_count"];
if( sv_total <= 0 || var_count <= 0 )
CV_Error( CV_StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
CV_Error( cv::Error::StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
FileNode m = fn["class_labels"];
if( !m.empty() )
@@ -2263,7 +2263,7 @@ public:
m >> params.classWeights;
if( class_count > 1 && (class_labels.empty() || (int)class_labels.total() != class_count))
CV_Error( CV_StsParseError, "Array of class labels is missing or invalid" );
CV_Error( cv::Error::StsParseError, "Array of class labels is missing or invalid" );
// read support vectors
FileNode sv_node = fn["support_vectors"];
+4 -4
View File
@@ -375,7 +375,7 @@ bool SVMSGDImpl::isTrained() const
void SVMSGDImpl::write(FileStorage& fs) const
{
if( !isTrained() )
CV_Error( CV_StsParseError, "SVMSGD model data is invalid, it hasn't been trained" );
CV_Error( cv::Error::StsParseError, "SVMSGD model data is invalid, it hasn't been trained" );
writeFormat(fs);
writeParams( fs );
@@ -437,7 +437,7 @@ void SVMSGDImpl::readParams( const FileNode& fn )
svmsgdTypeStr == "ASGD" ? ASGD : -1;
if( svmsgdType < 0 )
CV_Error( CV_StsParseError, "Missing or invalid SVMSGD type" );
CV_Error( cv::Error::StsParseError, "Missing or invalid SVMSGD type" );
params.svmsgdType = svmsgdType;
@@ -447,7 +447,7 @@ void SVMSGDImpl::readParams( const FileNode& fn )
marginTypeStr == "HARD_MARGIN" ? HARD_MARGIN : -1;
if( marginType < 0 )
CV_Error( CV_StsParseError, "Missing or invalid margin type" );
CV_Error( cv::Error::StsParseError, "Missing or invalid margin type" );
params.marginType = marginType;
@@ -517,7 +517,7 @@ void SVMSGDImpl::setOptimalParameters(int svmsgdType, int marginType)
break;
default:
CV_Error( CV_StsParseError, "SVMSGD model data is invalid" );
CV_Error( cv::Error::StsParseError, "SVMSGD model data is invalid" );
}
}
} //ml
+3 -3
View File
@@ -60,13 +60,13 @@ void createConcentricSpheresTestSet( int num_samples, int num_features, int num_
OutputArray _samples, OutputArray _responses)
{
if( num_samples < 1 )
CV_Error( CV_StsBadArg, "num_samples parameter must be positive" );
CV_Error( cv::Error::StsBadArg, "num_samples parameter must be positive" );
if( num_features < 1 )
CV_Error( CV_StsBadArg, "num_features parameter must be positive" );
CV_Error( cv::Error::StsBadArg, "num_features parameter must be positive" );
if( num_classes < 1 )
CV_Error( CV_StsBadArg, "num_classes parameter must be positive" );
CV_Error( cv::Error::StsBadArg, "num_classes parameter must be positive" );
int i, cur_class;
+2 -2
View File
@@ -404,7 +404,7 @@ int DTreesImpl::addNodeAndTrySplit( int parent, const vector<int>& sidx )
{
node.defaultDir = calcDir( node.split, sidx, sleft, sright );
if( params.useSurrogates )
CV_Error( CV_StsNotImplemented, "surrogate splits are not implemented yet");
CV_Error( cv::Error::StsNotImplemented, "surrogate splits are not implemented yet");
int left = addNodeAndTrySplit( nidx, sleft );
int right = addNodeAndTrySplit( nidx, sright );
@@ -1445,7 +1445,7 @@ float DTreesImpl::predictTrees( const Range& range, const Mat& sample, int flags
int ival = cvRound(val);
if( ival != val )
CV_Error( CV_StsBadArg,
CV_Error( cv::Error::StsBadArg,
"one of input categorical variable is not an integer" );
CV_Assert(cmap != NULL);
+3 -3
View File
@@ -693,18 +693,18 @@ icvInpaint( const CvArr* _input_img, const CvArr* _inpaint_mask, CvArr* _output_
output_img = cvGetMat( _output_img, &output_hdr );
if( !CV_ARE_SIZES_EQ(input_img,output_img) || !CV_ARE_SIZES_EQ(input_img,inpaint_mask))
CV_Error( CV_StsUnmatchedSizes, "All the input and output images must have the same size" );
CV_Error( cv::Error::StsUnmatchedSizes, "All the input and output images must have the same size" );
if( (CV_MAT_TYPE(input_img->type) != CV_8U &&
CV_MAT_TYPE(input_img->type) != CV_16U &&
CV_MAT_TYPE(input_img->type) != CV_32F &&
CV_MAT_TYPE(input_img->type) != CV_8UC3) ||
!CV_ARE_TYPES_EQ(input_img,output_img) )
CV_Error( CV_StsUnsupportedFormat,
CV_Error( cv::Error::StsUnsupportedFormat,
"8-bit, 16-bit unsigned or 32-bit float 1-channel and 8-bit 3-channel input/output images are supported" );
if( CV_MAT_TYPE(inpaint_mask->type) != CV_8UC1 )
CV_Error( CV_StsUnsupportedFormat, "The mask must be 8-bit 1-channel image" );
CV_Error( cv::Error::StsUnsupportedFormat, "The mask must be 8-bit 1-channel image" );
range = MAX(range,1);
range = MIN(range,100);
+1 -1
View File
@@ -962,7 +962,7 @@ void waveCorrect(std::vector<Mat> &rmats, WaveCorrectKind kind)
else if (kind == WAVE_CORRECT_VERT)
rg1 = eigen_vecs.row(0).t();
else
CV_Error(CV_StsBadArg, "unsupported kind of wave correction");
CV_Error(cv::Error::StsBadArg, "unsupported kind of wave correction");
Mat img_k = Mat::zeros(3, 1, CV_32F);
for (size_t i = 0; i < rmats.size(); ++i)
+1 -1
View File
@@ -643,7 +643,7 @@ void TS::update_context( BaseTest* test, int test_case_idx, bool update_ts_conte
current_test_info.test = test;
current_test_info.test_case_idx = test_case_idx;
current_test_info.code = 0;
cvSetErrStatus( CV_StsOk );
cvSetErrStatus( cv::Error::StsOk );
}

Some files were not shown because too many files have changed in this diff Show More