mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #25075 from mshabunin:cleanup-imgproc-1
C-API cleanup: apps, imgproc_c and some constants #25075 Merge with https://github.com/opencv/opencv_contrib/pull/3642 * Removed obsolete apps - traincascade and createsamples (please use older OpenCV versions if you need them). These apps relied heavily on C-API * removed all mentions of imgproc C-API headers (imgproc_c.h, types_c.h) - they were empty, included core C-API headers * replaced usage of several C constants with C++ ones (error codes, norm modes, RNG modes, PCA modes, ...) - most part of this PR (split into two parts - all modules and calib+3d - for easier backporting) * removed imgproc C-API headers (as separate commit, so that other changes could be backported to 4.x) Most of these changes can be backported to 4.x.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
@@ -673,7 +673,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'" );
|
||||
@@ -698,7 +698,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;
|
||||
@@ -1289,7 +1289,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;
|
||||
@@ -1791,7 +1791,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;
|
||||
}
|
||||
@@ -1800,7 +1800,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;
|
||||
}
|
||||
@@ -1914,7 +1914,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;
|
||||
}
|
||||
@@ -1923,7 +1923,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;
|
||||
}
|
||||
|
||||
+131
-127
@@ -79,7 +79,7 @@ cvSetIPLAllocators( Cv_iplCreateImageHeader createHeader,
|
||||
(createROI != 0) + (cloneImage != 0);
|
||||
|
||||
if( count != 0 && count != 5 )
|
||||
CV_Error( CV_StsBadArg, "Either all the pointers should be null or "
|
||||
CV_Error( cv::Error::StsBadArg, "Either all the pointers should be null or "
|
||||
"they all should be non-null" );
|
||||
|
||||
CvIPL.createHeader = createHeader;
|
||||
@@ -118,11 +118,11 @@ cvCreateMatHeader( int rows, int cols, int type )
|
||||
type = CV_MAT_TYPE(type);
|
||||
|
||||
if( rows < 0 || cols < 0 )
|
||||
CV_Error( CV_StsBadSize, "Non-positive width or height" );
|
||||
CV_Error( cv::Error::StsBadSize, "Non-positive width or height" );
|
||||
|
||||
int min_step = CV_ELEM_SIZE(type);
|
||||
if( min_step <= 0 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "Invalid matrix type" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "Invalid matrix type" );
|
||||
min_step *= cols;
|
||||
|
||||
CvMat* arr = (CvMat*)cvAlloc( sizeof(*arr));
|
||||
@@ -146,13 +146,13 @@ cvInitMatHeader( CvMat* arr, int rows, int cols,
|
||||
int type, void* data, int step )
|
||||
{
|
||||
if( !arr )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( (unsigned)CV_MAT_DEPTH(type) > CV_DEPTH_MAX )
|
||||
CV_Error( CV_BadNumChannels, "" );
|
||||
CV_Error( cv::Error::BadNumChannels, "" );
|
||||
|
||||
if( rows < 0 || cols < 0 )
|
||||
CV_Error( CV_StsBadSize, "Non-positive cols or rows" );
|
||||
CV_Error( cv::Error::StsBadSize, "Non-positive cols or rows" );
|
||||
|
||||
type = CV_MAT_TYPE( type );
|
||||
arr->type = type | CV_MAT_MAGIC_VAL;
|
||||
@@ -168,7 +168,7 @@ cvInitMatHeader( CvMat* arr, int rows, int cols,
|
||||
if( step != CV_AUTOSTEP && step != 0 )
|
||||
{
|
||||
if( step < min_step )
|
||||
CV_Error( CV_BadStep, "" );
|
||||
CV_Error( cv::Error::BadStep, "" );
|
||||
arr->step = step;
|
||||
}
|
||||
else
|
||||
@@ -196,7 +196,7 @@ cvReleaseMat( CvMat** array )
|
||||
CvMat* arr = *array;
|
||||
|
||||
if( !CV_IS_MAT_HDR_Z(arr) && !CV_IS_MATND_HDR(arr) )
|
||||
CV_Error( CV_StsBadFlag, "" );
|
||||
CV_Error( cv::Error::StsBadFlag, "" );
|
||||
|
||||
*array = 0;
|
||||
|
||||
@@ -211,7 +211,7 @@ CV_IMPL CvMat*
|
||||
cvCloneMat( const CvMat* src )
|
||||
{
|
||||
if( !CV_IS_MAT_HDR( src ))
|
||||
CV_Error( CV_StsBadArg, "Bad CvMat header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Bad CvMat header" );
|
||||
|
||||
CvMat* dst = cvCreateMatHeader( src->rows, src->cols, src->type );
|
||||
|
||||
@@ -237,25 +237,25 @@ cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes,
|
||||
int64 esz = CV_ELEM_SIZE(type), step = esz;
|
||||
|
||||
if( !mat )
|
||||
CV_Error( CV_StsNullPtr, "NULL matrix header pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL matrix header pointer" );
|
||||
|
||||
if( step == 0 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "invalid array data type" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "invalid array data type" );
|
||||
|
||||
if( !sizes )
|
||||
CV_Error( CV_StsNullPtr, "NULL <sizes> pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL <sizes> pointer" );
|
||||
|
||||
if( dims <= 0 || dims > CV_MAX_DIM )
|
||||
CV_Error( CV_StsOutOfRange,
|
||||
CV_Error( cv::Error::StsOutOfRange,
|
||||
"non-positive or too large number of dimensions" );
|
||||
|
||||
for( int i = dims - 1; i >= 0; i-- )
|
||||
{
|
||||
if( sizes[i] < 0 )
|
||||
CV_Error( CV_StsBadSize, "one of dimension sizes is non-positive" );
|
||||
CV_Error( cv::Error::StsBadSize, "one of dimension sizes is non-positive" );
|
||||
mat->dim[i].size = sizes[i];
|
||||
if( step > INT_MAX )
|
||||
CV_Error( CV_StsOutOfRange, "The array is too big" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The array is too big" );
|
||||
mat->dim[i].step = (int)step;
|
||||
step *= sizes[i];
|
||||
}
|
||||
@@ -292,7 +292,7 @@ CV_IMPL CvMatND*
|
||||
cvCreateMatNDHeader( int dims, const int* sizes, int type )
|
||||
{
|
||||
if( dims <= 0 || dims > CV_MAX_DIM )
|
||||
CV_Error( CV_StsOutOfRange,
|
||||
CV_Error( cv::Error::StsOutOfRange,
|
||||
"non-positive or too large number of dimensions" );
|
||||
|
||||
CvMatND* arr = (CvMatND*)cvAlloc( sizeof(*arr) );
|
||||
@@ -308,7 +308,7 @@ CV_IMPL CvMatND*
|
||||
cvCloneMatND( const CvMatND* src )
|
||||
{
|
||||
if( !CV_IS_MATND_HDR( src ))
|
||||
CV_Error( CV_StsBadArg, "Bad CvMatND header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Bad CvMatND header" );
|
||||
|
||||
CV_Assert( src->dims <= CV_MAX_DIM );
|
||||
int sizes[CV_MAX_DIM];
|
||||
@@ -349,18 +349,18 @@ cvCreateSparseMat( int dims, const int* sizes, int type )
|
||||
CvMemStorage* storage;
|
||||
|
||||
if( pix_size == 0 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "invalid array data type" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "invalid array data type" );
|
||||
|
||||
if( dims <= 0 || dims > CV_MAX_DIM )
|
||||
CV_Error( CV_StsOutOfRange, "bad number of dimensions" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "bad number of dimensions" );
|
||||
|
||||
if( !sizes )
|
||||
CV_Error( CV_StsNullPtr, "NULL <sizes> pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL <sizes> pointer" );
|
||||
|
||||
for( i = 0; i < dims; i++ )
|
||||
{
|
||||
if( sizes[i] <= 0 )
|
||||
CV_Error( CV_StsBadSize, "one of dimension sizes is non-positive" );
|
||||
CV_Error( cv::Error::StsBadSize, "one of dimension sizes is non-positive" );
|
||||
}
|
||||
|
||||
CvSparseMat* arr = (CvSparseMat*)cvAlloc(sizeof(*arr)+MAX(0,dims-CV_MAX_DIM)*sizeof(arr->size[0]));
|
||||
@@ -400,7 +400,7 @@ cvReleaseSparseMat( CvSparseMat** array )
|
||||
CvSparseMat* arr = *array;
|
||||
|
||||
if( !CV_IS_SPARSE_MAT_HDR(arr) )
|
||||
CV_Error( CV_StsBadFlag, "" );
|
||||
CV_Error( cv::Error::StsBadFlag, "" );
|
||||
|
||||
*array = 0;
|
||||
|
||||
@@ -417,7 +417,7 @@ CV_IMPL CvSparseMat*
|
||||
cvCloneSparseMat( const CvSparseMat* src )
|
||||
{
|
||||
if( !CV_IS_SPARSE_MAT_HDR(src) )
|
||||
CV_Error( CV_StsBadArg, "Invalid sparse array header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid sparse array header" );
|
||||
|
||||
CvSparseMat* dst = cvCreateSparseMat( src->dims, src->size, src->type );
|
||||
cvCopy( src, dst );
|
||||
@@ -432,10 +432,10 @@ cvInitSparseMatIterator( const CvSparseMat* mat, CvSparseMatIterator* iterator )
|
||||
int idx;
|
||||
|
||||
if( !CV_IS_SPARSE_MAT( mat ))
|
||||
CV_Error( CV_StsBadArg, "Invalid sparse matrix header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Invalid sparse matrix header" );
|
||||
|
||||
if( !iterator )
|
||||
CV_Error( CV_StsNullPtr, "NULL iterator pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL iterator pointer" );
|
||||
|
||||
iterator->mat = (CvSparseMat*)mat;
|
||||
iterator->node = 0;
|
||||
@@ -469,7 +469,7 @@ icvGetNodePtr( CvSparseMat* mat, const int* idx, int* _type,
|
||||
{
|
||||
int t = idx[i];
|
||||
if( (unsigned)t >= (unsigned)mat->size[i] )
|
||||
CV_Error( CV_StsOutOfRange, "One of indices is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "One of indices is out of range" );
|
||||
hashval = hashval*ICV_SPARSE_MAT_HASH_MULTIPLIER + t;
|
||||
}
|
||||
}
|
||||
@@ -563,7 +563,7 @@ icvDeleteNode( CvSparseMat* mat, const int* idx, unsigned* precalc_hashval )
|
||||
{
|
||||
int t = idx[i];
|
||||
if( (unsigned)t >= (unsigned)mat->size[i] )
|
||||
CV_Error( CV_StsOutOfRange, "One of indices is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "One of indices is out of range" );
|
||||
hashval = hashval*ICV_SPARSE_MAT_HASH_MULTIPLIER + t;
|
||||
}
|
||||
}
|
||||
@@ -618,7 +618,7 @@ cvCreateData( CvArr* arr )
|
||||
return;
|
||||
|
||||
if( mat->data.ptr != 0 )
|
||||
CV_Error( CV_StsError, "Data is already allocated" );
|
||||
CV_Error( cv::Error::StsError, "Data is already allocated" );
|
||||
|
||||
if( step == 0 )
|
||||
step = CV_ELEM_SIZE(mat->type)*mat->cols;
|
||||
@@ -626,7 +626,7 @@ cvCreateData( CvArr* arr )
|
||||
int64 _total_size = (int64)step*mat->rows + sizeof(int) + CV_MALLOC_ALIGN;
|
||||
total_size = (size_t)_total_size;
|
||||
if(_total_size != (int64)total_size)
|
||||
CV_Error(CV_StsNoMem, "Too big buffer is allocated" );
|
||||
CV_Error(cv::Error::StsNoMem, "Too big buffer is allocated" );
|
||||
mat->refcount = (int*)cvAlloc( (size_t)total_size );
|
||||
mat->data.ptr = (uchar*)cvAlignPtr( mat->refcount + 1, CV_MALLOC_ALIGN );
|
||||
*mat->refcount = 1;
|
||||
@@ -636,13 +636,13 @@ cvCreateData( CvArr* arr )
|
||||
IplImage* img = (IplImage*)arr;
|
||||
|
||||
if( img->imageData != 0 )
|
||||
CV_Error( CV_StsError, "Data is already allocated" );
|
||||
CV_Error( cv::Error::StsError, "Data is already allocated" );
|
||||
|
||||
if( !CvIPL.allocateData )
|
||||
{
|
||||
const int64 imageSize_tmp = (int64)img->widthStep*(int64)img->height;
|
||||
if( (int64)img->imageSize != imageSize_tmp )
|
||||
CV_Error( CV_StsNoMem, "Overflow for imageSize" );
|
||||
CV_Error( cv::Error::StsNoMem, "Overflow for imageSize" );
|
||||
img->imageData = img->imageDataOrigin =
|
||||
(char*)cvAlloc( (size_t)img->imageSize );
|
||||
}
|
||||
@@ -672,7 +672,7 @@ cvCreateData( CvArr* arr )
|
||||
return;
|
||||
|
||||
if( mat->data.ptr != 0 )
|
||||
CV_Error( CV_StsError, "Data is already allocated" );
|
||||
CV_Error( cv::Error::StsError, "Data is already allocated" );
|
||||
|
||||
if( CV_IS_MAT_CONT( mat->type ))
|
||||
{
|
||||
@@ -697,7 +697,7 @@ cvCreateData( CvArr* arr )
|
||||
*mat->refcount = 1;
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
}
|
||||
|
||||
|
||||
@@ -721,7 +721,7 @@ cvSetData( CvArr* arr, void* data, int step )
|
||||
if( step != CV_AUTOSTEP && step != 0 )
|
||||
{
|
||||
if( step < min_step && data != 0 )
|
||||
CV_Error( CV_BadStep, "" );
|
||||
CV_Error( cv::Error::BadStep, "" );
|
||||
mat->step = step;
|
||||
}
|
||||
else
|
||||
@@ -742,7 +742,7 @@ cvSetData( CvArr* arr, void* data, int step )
|
||||
if( step != CV_AUTOSTEP && img->height > 1 )
|
||||
{
|
||||
if( step < min_step && data != 0 )
|
||||
CV_Error( CV_BadStep, "" );
|
||||
CV_Error( cv::Error::BadStep, "" );
|
||||
img->widthStep = step;
|
||||
}
|
||||
else
|
||||
@@ -753,7 +753,7 @@ cvSetData( CvArr* arr, void* data, int step )
|
||||
const int64 imageSize_tmp = (int64)img->widthStep*(int64)img->height;
|
||||
img->imageSize = (int)imageSize_tmp;
|
||||
if( (int64)img->imageSize != imageSize_tmp )
|
||||
CV_Error( CV_StsNoMem, "Overflow for imageSize" );
|
||||
CV_Error( cv::Error::StsNoMem, "Overflow for imageSize" );
|
||||
img->imageData = img->imageDataOrigin = (char*)data;
|
||||
|
||||
if( (((int)(size_t)data | step) & 7) == 0 &&
|
||||
@@ -769,7 +769,7 @@ cvSetData( CvArr* arr, void* data, int step )
|
||||
int64 cur_step;
|
||||
|
||||
if( step != CV_AUTOSTEP )
|
||||
CV_Error( CV_BadStep,
|
||||
CV_Error( cv::Error::BadStep,
|
||||
"For multidimensional array only CV_AUTOSTEP is allowed here" );
|
||||
|
||||
mat->data.ptr = (uchar*)data;
|
||||
@@ -778,13 +778,13 @@ cvSetData( CvArr* arr, void* data, int step )
|
||||
for( i = mat->dims - 1; i >= 0; i-- )
|
||||
{
|
||||
if( cur_step > INT_MAX )
|
||||
CV_Error( CV_StsOutOfRange, "The array is too big" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The array is too big" );
|
||||
mat->dim[i].step = (int)cur_step;
|
||||
cur_step *= mat->dim[i].size;
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
}
|
||||
|
||||
|
||||
@@ -813,9 +813,13 @@ cvReleaseData( CvArr* arr )
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
}
|
||||
|
||||
static inline cv::Size cvGetMatSize( const CvMat* mat )
|
||||
{
|
||||
return cv::Size(mat->cols, mat->rows);
|
||||
}
|
||||
|
||||
// Retrieves essential information about image ROI or CvMat data
|
||||
CV_IMPL void
|
||||
@@ -861,7 +865,7 @@ cvGetRawData( const CvArr* arr, uchar** data, int* step, CvSize* roi_size )
|
||||
CvMatND* mat = (CvMatND*)arr;
|
||||
|
||||
if( !CV_IS_MAT_CONT( mat->type ))
|
||||
CV_Error( CV_StsBadArg, "Only continuous nD arrays are supported here" );
|
||||
CV_Error( cv::Error::StsBadArg, "Only continuous nD arrays are supported here" );
|
||||
|
||||
if( data )
|
||||
*data = mat->data.ptr;
|
||||
@@ -890,7 +894,7 @@ cvGetRawData( const CvArr* arr, uchar** data, int* step, CvSize* roi_size )
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
}
|
||||
|
||||
|
||||
@@ -906,7 +910,7 @@ cvGetElemType( const CvArr* arr )
|
||||
type = CV_MAKETYPE( IPL2CV_DEPTH(img->depth), img->nChannels );
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
|
||||
return type;
|
||||
}
|
||||
@@ -960,7 +964,7 @@ cvGetDims( const CvArr* arr, int* sizes )
|
||||
memcpy( sizes, mat->size, dims*sizeof(sizes[0]));
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
|
||||
return dims;
|
||||
}
|
||||
@@ -985,7 +989,7 @@ cvGetDimSize( const CvArr* arr, int index )
|
||||
size = mat->cols;
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsOutOfRange, "bad dimension index" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "bad dimension index" );
|
||||
}
|
||||
}
|
||||
else if( CV_IS_IMAGE( arr ))
|
||||
@@ -1001,7 +1005,7 @@ cvGetDimSize( const CvArr* arr, int index )
|
||||
size = !img->roi ? img->width : img->roi->width;
|
||||
break;
|
||||
default:
|
||||
CV_Error( CV_StsOutOfRange, "bad dimension index" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "bad dimension index" );
|
||||
}
|
||||
}
|
||||
else if( CV_IS_MATND_HDR( arr ))
|
||||
@@ -1009,7 +1013,7 @@ cvGetDimSize( const CvArr* arr, int index )
|
||||
CvMatND* mat = (CvMatND*)arr;
|
||||
|
||||
if( (unsigned)index >= (unsigned)mat->dims )
|
||||
CV_Error( CV_StsOutOfRange, "bad dimension index" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "bad dimension index" );
|
||||
|
||||
size = mat->dim[index].size;
|
||||
}
|
||||
@@ -1018,12 +1022,12 @@ cvGetDimSize( const CvArr* arr, int index )
|
||||
CvSparseMat* mat = (CvSparseMat*)arr;
|
||||
|
||||
if( (unsigned)index >= (unsigned)mat->dims )
|
||||
CV_Error( CV_StsOutOfRange, "bad dimension index" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "bad dimension index" );
|
||||
|
||||
size = mat->size[index];
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -1058,7 +1062,7 @@ cvGetSize( const CvArr* arr )
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Array should be CvMat or IplImage" );
|
||||
CV_Error( cv::Error::StsBadArg, "Array should be CvMat or IplImage" );
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -1075,14 +1079,14 @@ cvGetSubRect( const CvArr* arr, CvMat* submat, CvRect rect )
|
||||
mat = cvGetMat( mat, &stub );
|
||||
|
||||
if( !submat )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( (rect.x|rect.y|rect.width|rect.height) < 0 )
|
||||
CV_Error( CV_StsBadSize, "" );
|
||||
CV_Error( cv::Error::StsBadSize, "" );
|
||||
|
||||
if( rect.x + rect.width > mat->cols ||
|
||||
rect.y + rect.height > mat->rows )
|
||||
CV_Error( CV_StsBadSize, "" );
|
||||
CV_Error( cv::Error::StsBadSize, "" );
|
||||
|
||||
{
|
||||
/*
|
||||
@@ -1120,11 +1124,11 @@ cvGetRows( const CvArr* arr, CvMat* submat,
|
||||
mat = cvGetMat( mat, &stub );
|
||||
|
||||
if( !submat )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( (unsigned)start_row >= (unsigned)mat->rows ||
|
||||
(unsigned)end_row > (unsigned)mat->rows || delta_row <= 0 )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
{
|
||||
/*
|
||||
@@ -1172,12 +1176,12 @@ cvGetCols( const CvArr* arr, CvMat* submat, int start_col, int end_col )
|
||||
mat = cvGetMat( mat, &stub );
|
||||
|
||||
if( !submat )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
cols = mat->cols;
|
||||
if( (unsigned)start_col >= (unsigned)cols ||
|
||||
(unsigned)end_col > (unsigned)cols )
|
||||
CV_Error( CV_StsOutOfRange, "" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "" );
|
||||
|
||||
{
|
||||
/*
|
||||
@@ -1216,7 +1220,7 @@ cvScalarToRawData( const CvScalar* scalar, void* data, int type, int extend_to_1
|
||||
|
||||
CV_Assert( scalar && data );
|
||||
if( (unsigned)(cn - 1) >= 4 )
|
||||
CV_Error( CV_StsOutOfRange, "The number of channels must be 1, 2, 3 or 4" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The number of channels must be 1, 2, 3 or 4" );
|
||||
|
||||
switch( depth )
|
||||
{
|
||||
@@ -1262,7 +1266,7 @@ cvScalarToRawData( const CvScalar* scalar, void* data, int type, int extend_to_1
|
||||
break;
|
||||
default:
|
||||
CV_Assert(0);
|
||||
CV_Error( CV_BadDepth, "" );
|
||||
CV_Error( cv::Error::BadDepth, "" );
|
||||
}
|
||||
|
||||
if( extend_to_12 )
|
||||
@@ -1289,7 +1293,7 @@ cvRawDataToScalar( const void* data, int flags, CvScalar* scalar )
|
||||
CV_Assert( scalar && data );
|
||||
|
||||
if( (unsigned)(cn - 1) >= 4 )
|
||||
CV_Error( CV_StsOutOfRange, "The number of channels must be 1, 2, 3 or 4" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The number of channels must be 1, 2, 3 or 4" );
|
||||
|
||||
memset( scalar->val, 0, sizeof(scalar->val));
|
||||
|
||||
@@ -1325,7 +1329,7 @@ cvRawDataToScalar( const void* data, int flags, CvScalar* scalar )
|
||||
break;
|
||||
default:
|
||||
CV_Assert(0);
|
||||
CV_Error( CV_BadDepth, "" );
|
||||
CV_Error( cv::Error::BadDepth, "" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1412,7 +1416,7 @@ cvPtr1D( const CvArr* arr, int idx, int* _type )
|
||||
// that the index is within the matrix
|
||||
if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) &&
|
||||
(unsigned)idx >= (unsigned)(mat->rows*mat->cols))
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
if( CV_IS_MAT_CONT(mat->type))
|
||||
{
|
||||
@@ -1449,7 +1453,7 @@ cvPtr1D( const CvArr* arr, int idx, int* _type )
|
||||
size *= mat->dim[j].size;
|
||||
|
||||
if((unsigned)idx >= (unsigned)size )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
if( CV_IS_MAT_CONT(mat->type))
|
||||
{
|
||||
@@ -1493,7 +1497,7 @@ cvPtr1D( const CvArr* arr, int idx, int* _type )
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
}
|
||||
|
||||
return ptr;
|
||||
@@ -1512,7 +1516,7 @@ cvPtr2D( const CvArr* arr, int y, int x, int* _type )
|
||||
|
||||
if( (unsigned)y >= (unsigned)(mat->rows) ||
|
||||
(unsigned)x >= (unsigned)(mat->cols) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
type = CV_MAT_TYPE(mat->type);
|
||||
if( _type )
|
||||
@@ -1542,7 +1546,7 @@ cvPtr2D( const CvArr* arr, int y, int x, int* _type )
|
||||
{
|
||||
int coi = img->roi->coi;
|
||||
if( !coi )
|
||||
CV_Error( CV_BadCOI,
|
||||
CV_Error( cv::Error::BadCOI,
|
||||
"COI must be non-null in case of planar images" );
|
||||
ptr += (coi - 1)*img->imageSize;
|
||||
}
|
||||
@@ -1555,7 +1559,7 @@ cvPtr2D( const CvArr* arr, int y, int x, int* _type )
|
||||
|
||||
if( (unsigned)y >= (unsigned)height ||
|
||||
(unsigned)x >= (unsigned)width )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
ptr += y*img->widthStep + x*pix_size;
|
||||
|
||||
@@ -1563,7 +1567,7 @@ cvPtr2D( const CvArr* arr, int y, int x, int* _type )
|
||||
{
|
||||
int type = IPL2CV_DEPTH(img->depth);
|
||||
if( type < 0 || (unsigned)(img->nChannels - 1) > 3 )
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
|
||||
*_type = CV_MAKETYPE( type, img->nChannels );
|
||||
}
|
||||
@@ -1575,7 +1579,7 @@ cvPtr2D( const CvArr* arr, int y, int x, int* _type )
|
||||
if( mat->dims != 2 ||
|
||||
(unsigned)y >= (unsigned)(mat->dim[0].size) ||
|
||||
(unsigned)x >= (unsigned)(mat->dim[1].size) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
ptr = mat->data.ptr + (size_t)y*mat->dim[0].step + x*mat->dim[1].step;
|
||||
if( _type )
|
||||
@@ -1589,7 +1593,7 @@ cvPtr2D( const CvArr* arr, int y, int x, int* _type )
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
}
|
||||
|
||||
return ptr;
|
||||
@@ -1609,7 +1613,7 @@ cvPtr3D( const CvArr* arr, int z, int y, int x, int* _type )
|
||||
(unsigned)z >= (unsigned)(mat->dim[0].size) ||
|
||||
(unsigned)y >= (unsigned)(mat->dim[1].size) ||
|
||||
(unsigned)x >= (unsigned)(mat->dim[2].size) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
ptr = mat->data.ptr + (size_t)z*mat->dim[0].step +
|
||||
(size_t)y*mat->dim[1].step + x*mat->dim[2].step;
|
||||
@@ -1624,7 +1628,7 @@ cvPtr3D( const CvArr* arr, int z, int y, int x, int* _type )
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
}
|
||||
|
||||
return ptr;
|
||||
@@ -1638,7 +1642,7 @@ cvPtrND( const CvArr* arr, const int* idx, int* _type,
|
||||
{
|
||||
uchar* ptr = 0;
|
||||
if( !idx )
|
||||
CV_Error( CV_StsNullPtr, "NULL pointer to indices" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL pointer to indices" );
|
||||
|
||||
if( CV_IS_SPARSE_MAT( arr ))
|
||||
ptr = icvGetNodePtr( (CvSparseMat*)arr, idx,
|
||||
@@ -1652,7 +1656,7 @@ cvPtrND( const CvArr* arr, const int* idx, int* _type,
|
||||
for( i = 0; i < mat->dims; i++ )
|
||||
{
|
||||
if( (unsigned)idx[i] >= (unsigned)(mat->dim[i].size) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
ptr += (size_t)idx[i]*mat->dim[i].step;
|
||||
}
|
||||
|
||||
@@ -1662,7 +1666,7 @@ cvPtrND( const CvArr* arr, const int* idx, int* _type,
|
||||
else if( CV_IS_MAT_HDR(arr) || CV_IS_IMAGE_HDR(arr) )
|
||||
ptr = cvPtr2D( arr, idx[0], idx[1], _type );
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadArg, "unrecognized or unsupported array type" );
|
||||
|
||||
return ptr;
|
||||
}
|
||||
@@ -1687,7 +1691,7 @@ cvGet1D( const CvArr* arr, int idx )
|
||||
// that the index is within the matrix
|
||||
if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) &&
|
||||
(unsigned)idx >= (unsigned)(mat->rows*mat->cols))
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
ptr = mat->data.ptr + (size_t)idx*pix_size;
|
||||
}
|
||||
@@ -1717,7 +1721,7 @@ cvGet2D( const CvArr* arr, int y, int x )
|
||||
|
||||
if( (unsigned)y >= (unsigned)(mat->rows) ||
|
||||
(unsigned)x >= (unsigned)(mat->cols) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
type = CV_MAT_TYPE(mat->type);
|
||||
ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type);
|
||||
@@ -1798,7 +1802,7 @@ cvGetReal1D( const CvArr* arr, int idx )
|
||||
// that the index is within the matrix
|
||||
if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) &&
|
||||
(unsigned)idx >= (unsigned)(mat->rows*mat->cols))
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
ptr = mat->data.ptr + (size_t)idx*pix_size;
|
||||
}
|
||||
@@ -1810,7 +1814,7 @@ cvGetReal1D( const CvArr* arr, int idx )
|
||||
if( ptr )
|
||||
{
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
|
||||
value = icvGetReal( ptr, type );
|
||||
}
|
||||
@@ -1832,7 +1836,7 @@ cvGetReal2D( const CvArr* arr, int y, int x )
|
||||
|
||||
if( (unsigned)y >= (unsigned)(mat->rows) ||
|
||||
(unsigned)x >= (unsigned)(mat->cols) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
type = CV_MAT_TYPE(mat->type);
|
||||
ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type);
|
||||
@@ -1848,7 +1852,7 @@ cvGetReal2D( const CvArr* arr, int y, int x )
|
||||
if( ptr )
|
||||
{
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
|
||||
value = icvGetReal( ptr, type );
|
||||
}
|
||||
@@ -1876,7 +1880,7 @@ cvGetReal3D( const CvArr* arr, int z, int y, int x )
|
||||
if( ptr )
|
||||
{
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
|
||||
value = icvGetReal( ptr, type );
|
||||
}
|
||||
@@ -1901,7 +1905,7 @@ cvGetRealND( const CvArr* arr, const int* idx )
|
||||
if( ptr )
|
||||
{
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvGetReal* support only single-channel arrays" );
|
||||
|
||||
value = icvGetReal( ptr, type );
|
||||
}
|
||||
@@ -1928,7 +1932,7 @@ cvSet1D( CvArr* arr, int idx, CvScalar scalar )
|
||||
// that the index is within the matrix
|
||||
if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) &&
|
||||
(unsigned)idx >= (unsigned)(mat->rows*mat->cols))
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
ptr = mat->data.ptr + (size_t)idx*pix_size;
|
||||
}
|
||||
@@ -1954,7 +1958,7 @@ cvSet2D( CvArr* arr, int y, int x, CvScalar scalar )
|
||||
|
||||
if( (unsigned)y >= (unsigned)(mat->rows) ||
|
||||
(unsigned)x >= (unsigned)(mat->cols) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
type = CV_MAT_TYPE(mat->type);
|
||||
ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type);
|
||||
@@ -2020,7 +2024,7 @@ cvSetReal1D( CvArr* arr, int idx, double value )
|
||||
// that the index is within the matrix
|
||||
if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) &&
|
||||
(unsigned)idx >= (unsigned)(mat->rows*mat->cols))
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
ptr = mat->data.ptr + (size_t)idx*pix_size;
|
||||
}
|
||||
@@ -2030,7 +2034,7 @@ cvSetReal1D( CvArr* arr, int idx, double value )
|
||||
ptr = icvGetNodePtr( (CvSparseMat*)arr, &idx, &type, -1, 0 );
|
||||
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
|
||||
if( ptr )
|
||||
icvSetReal( value, ptr, type );
|
||||
@@ -2049,7 +2053,7 @@ cvSetReal2D( CvArr* arr, int y, int x, double value )
|
||||
|
||||
if( (unsigned)y >= (unsigned)(mat->rows) ||
|
||||
(unsigned)x >= (unsigned)(mat->cols) )
|
||||
CV_Error( CV_StsOutOfRange, "index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "index is out of range" );
|
||||
|
||||
type = CV_MAT_TYPE(mat->type);
|
||||
ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type);
|
||||
@@ -2064,7 +2068,7 @@ cvSetReal2D( CvArr* arr, int y, int x, double value )
|
||||
ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 );
|
||||
}
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
|
||||
if( ptr )
|
||||
icvSetReal( value, ptr, type );
|
||||
@@ -2085,7 +2089,7 @@ cvSetReal3D( CvArr* arr, int z, int y, int x, double value )
|
||||
ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 );
|
||||
}
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
|
||||
if( ptr )
|
||||
icvSetReal( value, ptr, type );
|
||||
@@ -2104,7 +2108,7 @@ cvSetRealND( CvArr* arr, const int* idx, double value )
|
||||
ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 );
|
||||
|
||||
if( CV_MAT_CN( type ) > 1 )
|
||||
CV_Error( CV_BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
CV_Error( cv::Error::BadNumChannels, "cvSetReal* support only single-channel arrays" );
|
||||
|
||||
if( ptr )
|
||||
icvSetReal( value, ptr, type );
|
||||
@@ -2141,12 +2145,12 @@ cvGetMat( const CvArr* array, CvMat* mat,
|
||||
int coi = 0;
|
||||
|
||||
if( !mat || !src )
|
||||
CV_Error( CV_StsNullPtr, "NULL array pointer is passed" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL array pointer is passed" );
|
||||
|
||||
if( CV_IS_MAT_HDR(src))
|
||||
{
|
||||
if( !src->data.ptr )
|
||||
CV_Error( CV_StsNullPtr, "The matrix has NULL data pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "The matrix has NULL data pointer" );
|
||||
|
||||
result = (CvMat*)src;
|
||||
}
|
||||
@@ -2156,11 +2160,11 @@ cvGetMat( const CvArr* array, CvMat* mat,
|
||||
int depth, order;
|
||||
|
||||
if( img->imageData == 0 )
|
||||
CV_Error( CV_StsNullPtr, "The image has NULL data pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "The image has NULL data pointer" );
|
||||
|
||||
depth = IPL2CV_DEPTH( img->depth );
|
||||
if( depth < 0 )
|
||||
CV_Error( CV_BadDepth, "" );
|
||||
CV_Error( cv::Error::BadDepth, "" );
|
||||
|
||||
order = img->dataOrder & (img->nChannels > 1 ? -1 : 0);
|
||||
|
||||
@@ -2171,7 +2175,7 @@ cvGetMat( const CvArr* array, CvMat* mat,
|
||||
int type = depth;
|
||||
|
||||
if( img->roi->coi == 0 )
|
||||
CV_Error( CV_StsBadFlag,
|
||||
CV_Error( cv::Error::StsBadFlag,
|
||||
"Images with planar data layout should be used with COI selected" );
|
||||
|
||||
cvInitMatHeader( mat, img->roi->height,
|
||||
@@ -2187,7 +2191,7 @@ cvGetMat( const CvArr* array, CvMat* mat,
|
||||
coi = img->roi->coi;
|
||||
|
||||
if( img->nChannels > CV_CN_MAX )
|
||||
CV_Error( CV_BadNumChannels,
|
||||
CV_Error( cv::Error::BadNumChannels,
|
||||
"The image is interleaved and has over CV_CN_MAX channels" );
|
||||
|
||||
cvInitMatHeader( mat, img->roi->height, img->roi->width,
|
||||
@@ -2202,7 +2206,7 @@ cvGetMat( const CvArr* array, CvMat* mat,
|
||||
int type = CV_MAKETYPE( depth, img->nChannels );
|
||||
|
||||
if( order != IPL_DATA_ORDER_PIXEL )
|
||||
CV_Error( CV_StsBadFlag, "Pixel order should be used with coi == 0" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Pixel order should be used with coi == 0" );
|
||||
|
||||
cvInitMatHeader( mat, img->height, img->width, type,
|
||||
img->imageData, img->widthStep );
|
||||
@@ -2216,10 +2220,10 @@ cvGetMat( const CvArr* array, CvMat* mat,
|
||||
int size1 = matnd->dim[0].size, size2 = 1;
|
||||
|
||||
if( !src->data.ptr )
|
||||
CV_Error( CV_StsNullPtr, "Input array has NULL data pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Input array has NULL data pointer" );
|
||||
|
||||
if( !CV_IS_MAT_CONT( matnd->type ))
|
||||
CV_Error( CV_StsBadArg, "Only continuous nD arrays are supported here" );
|
||||
CV_Error( cv::Error::StsBadArg, "Only continuous nD arrays are supported here" );
|
||||
|
||||
if( matnd->dims > 2 )
|
||||
{
|
||||
@@ -2243,7 +2247,7 @@ cvGetMat( const CvArr* array, CvMat* mat,
|
||||
result = mat;
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadFlag, "Unrecognized or unsupported array type" );
|
||||
CV_Error( cv::Error::StsBadFlag, "Unrecognized or unsupported array type" );
|
||||
|
||||
if( pCOI )
|
||||
*pCOI = coi;
|
||||
@@ -2261,20 +2265,20 @@ cvReshape( const CvArr* array, CvMat* header,
|
||||
int total_width, new_width;
|
||||
|
||||
if( !header )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( !CV_IS_MAT( mat ))
|
||||
{
|
||||
int coi = 0;
|
||||
mat = cvGetMat( mat, header, &coi, 1 );
|
||||
if( coi )
|
||||
CV_Error( CV_BadCOI, "COI is not supported" );
|
||||
CV_Error( cv::Error::BadCOI, "COI is not supported" );
|
||||
}
|
||||
|
||||
if( new_cn == 0 )
|
||||
new_cn = CV_MAT_CN(mat->type);
|
||||
else if( (unsigned)(new_cn - 1) > 3 )
|
||||
CV_Error( CV_BadNumChannels, "" );
|
||||
CV_Error( cv::Error::BadNumChannels, "" );
|
||||
|
||||
if( mat != header )
|
||||
{
|
||||
@@ -2298,16 +2302,16 @@ cvReshape( const CvArr* array, CvMat* header,
|
||||
{
|
||||
int total_size = total_width * mat->rows;
|
||||
if( !CV_IS_MAT_CONT( mat->type ))
|
||||
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" );
|
||||
|
||||
header->rows = new_rows;
|
||||
@@ -2317,7 +2321,7 @@ cvReshape( const CvArr* array, CvMat* header,
|
||||
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" );
|
||||
|
||||
header->cols = new_width;
|
||||
@@ -2336,17 +2340,17 @@ cvGetImage( const CvArr* array, IplImage* img )
|
||||
const IplImage* src = (const IplImage*)array;
|
||||
|
||||
if( !img )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( !CV_IS_IMAGE_HDR(src) )
|
||||
{
|
||||
const CvMat* mat = (const CvMat*)src;
|
||||
|
||||
if( !CV_IS_MAT_HDR(mat))
|
||||
CV_Error( CV_StsBadFlag, "" );
|
||||
CV_Error( cv::Error::StsBadFlag, "" );
|
||||
|
||||
if( mat->data.ptr == 0 )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
int depth = cvIplDepth(mat->type);
|
||||
|
||||
@@ -2479,19 +2483,19 @@ cvInitImageHeader( IplImage * image, CvSize size, int depth,
|
||||
}
|
||||
|
||||
if( size.width < 0 || size.height < 0 )
|
||||
CV_Error( CV_BadROISize, "Bad input roi" );
|
||||
CV_Error( cv::Error::BadROISize, "Bad input roi" );
|
||||
|
||||
if( (depth != (int)IPL_DEPTH_1U && depth != (int)IPL_DEPTH_8U &&
|
||||
depth != (int)IPL_DEPTH_8S && depth != (int)IPL_DEPTH_16U &&
|
||||
depth != (int)IPL_DEPTH_16S && depth != (int)IPL_DEPTH_32S &&
|
||||
depth != (int)IPL_DEPTH_32F && depth != (int)IPL_DEPTH_64F) ||
|
||||
channels < 0 )
|
||||
CV_Error( CV_BadDepth, "Unsupported format" );
|
||||
CV_Error( cv::Error::BadDepth, "Unsupported format" );
|
||||
if( origin != CV_ORIGIN_BL && origin != CV_ORIGIN_TL )
|
||||
CV_Error( CV_BadOrigin, "Bad input origin" );
|
||||
CV_Error( cv::Error::BadOrigin, "Bad input origin" );
|
||||
|
||||
if( align != 4 && align != 8 )
|
||||
CV_Error( CV_BadAlign, "Bad input align" );
|
||||
CV_Error( cv::Error::BadAlign, "Bad input align" );
|
||||
|
||||
image->width = size.width;
|
||||
image->height = size.height;
|
||||
@@ -2513,7 +2517,7 @@ cvInitImageHeader( IplImage * image, CvSize size, int depth,
|
||||
const int64 imageSize_tmp = (int64)image->widthStep*(int64)image->height;
|
||||
image->imageSize = (int)imageSize_tmp;
|
||||
if( (int64)image->imageSize != imageSize_tmp )
|
||||
CV_Error( CV_StsNoMem, "Overflow for imageSize" );
|
||||
CV_Error( cv::Error::StsNoMem, "Overflow for imageSize" );
|
||||
|
||||
return image;
|
||||
}
|
||||
@@ -2523,7 +2527,7 @@ CV_IMPL void
|
||||
cvReleaseImageHeader( IplImage** image )
|
||||
{
|
||||
if( !image )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( *image )
|
||||
{
|
||||
@@ -2547,7 +2551,7 @@ CV_IMPL void
|
||||
cvReleaseImage( IplImage ** image )
|
||||
{
|
||||
if( !image )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
CV_Error( cv::Error::StsNullPtr, "" );
|
||||
|
||||
if( *image )
|
||||
{
|
||||
@@ -2621,7 +2625,7 @@ cvGetImageROI( const IplImage* img )
|
||||
{
|
||||
CvRect rect = {0, 0, 0, 0};
|
||||
if( !img )
|
||||
CV_Error( CV_StsNullPtr, "Null pointer to image" );
|
||||
CV_Error( cv::Error::StsNullPtr, "Null pointer to image" );
|
||||
|
||||
if( img->roi )
|
||||
rect = cvRect( img->roi->xOffset, img->roi->yOffset,
|
||||
@@ -2640,7 +2644,7 @@ cvSetImageCOI( IplImage* image, int coi )
|
||||
CV_Error( CV_HeaderIsNull, "" );
|
||||
|
||||
if( (unsigned)coi > (unsigned)(image->nChannels) )
|
||||
CV_Error( CV_BadCOI, "" );
|
||||
CV_Error( cv::Error::BadCOI, "" );
|
||||
|
||||
if( image->roi || coi != 0 )
|
||||
{
|
||||
@@ -2672,7 +2676,7 @@ cvCloneImage( const IplImage* src )
|
||||
IplImage* dst = 0;
|
||||
|
||||
if( !CV_IS_IMAGE_HDR( src ))
|
||||
CV_Error( CV_StsBadArg, "Bad image header" );
|
||||
CV_Error( cv::Error::StsBadArg, "Bad image header" );
|
||||
|
||||
if( !CvIPL.cloneImage )
|
||||
{
|
||||
@@ -2718,13 +2722,13 @@ cvCheckTermCriteria( CvTermCriteria criteria, double default_eps,
|
||||
crit.epsilon = (float)default_eps;
|
||||
|
||||
if( (criteria.type & ~(CV_TERMCRIT_EPS | CV_TERMCRIT_ITER)) != 0 )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"Unknown type of term criteria" );
|
||||
|
||||
if( (criteria.type & CV_TERMCRIT_ITER) != 0 )
|
||||
{
|
||||
if( criteria.max_iter <= 0 )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"Iterations flag is set and maximum number of iterations is <= 0" );
|
||||
crit.max_iter = criteria.max_iter;
|
||||
}
|
||||
@@ -2732,13 +2736,13 @@ cvCheckTermCriteria( CvTermCriteria criteria, double default_eps,
|
||||
if( (criteria.type & CV_TERMCRIT_EPS) != 0 )
|
||||
{
|
||||
if( criteria.epsilon < 0 )
|
||||
CV_Error( CV_StsBadArg, "Accuracy flag is set and epsilon is < 0" );
|
||||
CV_Error( cv::Error::StsBadArg, "Accuracy flag is set and epsilon is < 0" );
|
||||
|
||||
crit.epsilon = criteria.epsilon;
|
||||
}
|
||||
|
||||
if( (criteria.type & (CV_TERMCRIT_EPS | CV_TERMCRIT_ITER)) == 0 )
|
||||
CV_Error( CV_StsBadArg,
|
||||
CV_Error( cv::Error::StsBadArg,
|
||||
"Neither accuracy nor maximum iterations "
|
||||
"number flags are set in criteria type" );
|
||||
|
||||
@@ -2765,7 +2769,7 @@ CV_IMPL void
|
||||
cvRelease( void** struct_ptr )
|
||||
{
|
||||
if( !struct_ptr )
|
||||
CV_Error( CV_StsNullPtr, "NULL double pointer" );
|
||||
CV_Error( cv::Error::StsNullPtr, "NULL double pointer" );
|
||||
|
||||
if( *struct_ptr )
|
||||
{
|
||||
@@ -2774,7 +2778,7 @@ cvRelease( void** struct_ptr )
|
||||
else if( CV_IS_IMAGE(*struct_ptr))
|
||||
cvReleaseImage((IplImage**)struct_ptr);
|
||||
else
|
||||
CV_Error( CV_StsError, "Unknown object type" );
|
||||
CV_Error( cv::Error::StsError, "Unknown object type" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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(", ")
|
||||
|
||||
@@ -111,7 +111,7 @@ void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to)
|
||||
scalarToRawData_(s, (double*)_buf, cn, unroll_to);
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsUnsupportedFormat,"");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat,"");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -826,7 +826,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
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
@@ -1516,7 +1516,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, "" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
@@ -1221,7 +1221,7 @@ cvCalcPCA( const CvArr* data_arr, CvArr* avg_arr, CvArr* eigenvals, CvArr* eigen
|
||||
pca.eigenvalues = evals;
|
||||
pca.eigenvectors = evects;
|
||||
|
||||
pca(data, (flags & CV_PCA_USE_AVG) ? mean : cv::Mat(),
|
||||
pca(data, (flags & cv::PCA::USE_AVG) ? mean : cv::Mat(),
|
||||
flags, !evals.empty() ? evals.rows + evals.cols - 1 : 0);
|
||||
|
||||
if( pca.mean.size() == mean.size() )
|
||||
|
||||
+10
-10
@@ -265,7 +265,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;
|
||||
}
|
||||
}
|
||||
@@ -1101,9 +1101,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) );
|
||||
@@ -1205,16 +1205,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;
|
||||
@@ -1224,7 +1224,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.dims = 2;
|
||||
@@ -1269,13 +1269,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);
|
||||
@@ -1284,7 +1284,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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -256,14 +256,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());
|
||||
}
|
||||
@@ -320,7 +320,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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -1688,7 +1688,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
|
||||
|
||||
@@ -965,7 +965,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 );
|
||||
|
||||
@@ -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++ )
|
||||
@@ -837,13 +837,13 @@ void normalize( const SparseMat& src, SparseMat& dst, double a, int norm_type )
|
||||
CV_INSTRUMENT_REGION();
|
||||
|
||||
double scale = 1;
|
||||
if( norm_type == CV_L2 || norm_type == CV_L1 || norm_type == CV_C )
|
||||
if( norm_type == NORM_L2 || norm_type == NORM_L1 || norm_type == NORM_INF )
|
||||
{
|
||||
scale = norm( src, 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 );
|
||||
}
|
||||
|
||||
@@ -964,7 +964,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
|
||||
@@ -1002,7 +1002,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
|
||||
@@ -1475,14 +1475,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 )
|
||||
|
||||
@@ -1412,7 +1412,7 @@ void normalize(InputArray _src, InputOutputArray _dst, double a, double b,
|
||||
if( rtype < 0 )
|
||||
rtype = _dst.fixedType() ? _dst.depth() : depth;
|
||||
|
||||
if( norm_type == CV_MINMAX )
|
||||
if( norm_type == NORM_MINMAX )
|
||||
{
|
||||
double smin = 0, smax = 0;
|
||||
double dmin = MIN( a, b ), dmax = MAX( a, b );
|
||||
@@ -1426,14 +1426,14 @@ void normalize(InputArray _src, InputOutputArray _dst, double a, double b,
|
||||
else
|
||||
shift = dmin - smin*scale;
|
||||
}
|
||||
else if( norm_type == CV_L2 || norm_type == CV_L1 || norm_type == CV_C )
|
||||
else if( norm_type == NORM_L2 || norm_type == NORM_L1 || norm_type == NORM_INF )
|
||||
{
|
||||
scale = norm( _src, norm_type, _mask );
|
||||
scale = scale > DBL_EPSILON ? a/scale : 0.;
|
||||
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))
|
||||
|
||||
@@ -70,7 +70,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, int maxComp
|
||||
Size mean_sz;
|
||||
|
||||
CV_Assert( data.channels() == 1 );
|
||||
if( flags & CV_PCA_DATA_AS_COL )
|
||||
if( flags & PCA::DATA_AS_COL )
|
||||
{
|
||||
len = data.rows;
|
||||
in_count = data.cols;
|
||||
@@ -111,8 +111,8 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, int maxComp
|
||||
|
||||
if( !(covar_flags & CV_COVAR_NORMAL) )
|
||||
{
|
||||
// CV_PCA_DATA_AS_ROW: cols(A)>rows(A). x=A'*y -> x'=y'*A
|
||||
// CV_PCA_DATA_AS_COL: rows(A)>cols(A). x=A''*y -> x'=y'*A'
|
||||
// PCA::DATA_AS_ROW: cols(A)>rows(A). x=A'*y -> x'=y'*A
|
||||
// PCA::DATA_AS_COL: rows(A)>cols(A). x=A''*y -> x'=y'*A'
|
||||
Mat tmp_data, tmp_mean = repeat(mean, data.rows/mean.rows, data.cols/mean.cols);
|
||||
if( data.type() != ctype || tmp_mean.data == mean.data )
|
||||
{
|
||||
@@ -127,7 +127,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, int maxComp
|
||||
|
||||
Mat evects1(count, len, ctype);
|
||||
gemm( eigenvectors, tmp_data, 1, Mat(), 0, evects1,
|
||||
(flags & CV_PCA_DATA_AS_COL) ? CV_GEMM_B_T : 0);
|
||||
(flags & PCA::DATA_AS_COL) ? CV_GEMM_B_T : 0);
|
||||
eigenvectors = evects1;
|
||||
|
||||
// normalize eigenvectors
|
||||
@@ -206,7 +206,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, double reta
|
||||
Size mean_sz;
|
||||
|
||||
CV_Assert( data.channels() == 1 );
|
||||
if( flags & CV_PCA_DATA_AS_COL )
|
||||
if( flags & PCA::DATA_AS_COL )
|
||||
{
|
||||
len = data.rows;
|
||||
in_count = data.cols;
|
||||
@@ -247,8 +247,8 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, double reta
|
||||
|
||||
if( !(covar_flags & CV_COVAR_NORMAL) )
|
||||
{
|
||||
// CV_PCA_DATA_AS_ROW: cols(A)>rows(A). x=A'*y -> x'=y'*A
|
||||
// CV_PCA_DATA_AS_COL: rows(A)>cols(A). x=A''*y -> x'=y'*A'
|
||||
// PCA::DATA_AS_ROW: cols(A)>rows(A). x=A'*y -> x'=y'*A
|
||||
// PCA::DATA_AS_COL: rows(A)>cols(A). x=A''*y -> x'=y'*A'
|
||||
Mat tmp_data, tmp_mean = repeat(mean, data.rows/mean.rows, data.cols/mean.cols);
|
||||
if( data.type() != ctype || tmp_mean.data == mean.data )
|
||||
{
|
||||
@@ -263,7 +263,7 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, double reta
|
||||
|
||||
Mat evects1(count, len, ctype);
|
||||
gemm( eigenvectors, tmp_data, 1, Mat(), 0, evects1,
|
||||
(flags & CV_PCA_DATA_AS_COL) ? CV_GEMM_B_T : 0);
|
||||
(flags & PCA::DATA_AS_COL) ? CV_GEMM_B_T : 0);
|
||||
eigenvectors = evects1;
|
||||
|
||||
// normalize all eigenvectors
|
||||
|
||||
@@ -670,7 +670,7 @@ void RNG::fill( InputOutputArray _mat, int disttype,
|
||||
}
|
||||
CV_Assert( func != 0 );
|
||||
}
|
||||
else if( disttype == CV_RAND_NORMAL )
|
||||
else if( disttype == RNG::NORMAL )
|
||||
{
|
||||
_parambuf.allocate(MAX(n1, cn) + MAX(n2, cn));
|
||||
double* parambuf = _parambuf.data();
|
||||
@@ -708,7 +708,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 = 0;
|
||||
|
||||
+57
-53
@@ -1325,38 +1325,42 @@ 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";
|
||||
case cv::Error::OpenCLApiCallError : return "OpenCL API call error";
|
||||
case cv::Error::OpenCLDoubleNotSupported:return "OpenCL device does not support double";
|
||||
case cv::Error::OpenCLInitError : return "OpenCL initialization error";
|
||||
case cv::Error::OpenCLNoAMDBlasFft : return "Missing OpenCL AMD BLAS FFT";
|
||||
};
|
||||
|
||||
snprintf(buf, sizeof(buf), "Unknown %s code %d", status >= 0 ? "status":"error", status);
|
||||
@@ -1396,29 +1400,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,7 +559,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;
|
||||
}
|
||||
}
|
||||
@@ -995,16 +995,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;
|
||||
@@ -1014,7 +1014,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.dims = 2;
|
||||
@@ -1083,13 +1083,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);
|
||||
@@ -1098,7 +1098,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
|
||||
|
||||
Reference in New Issue
Block a user