mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Partially back-port #25075 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;
|
||||
@@ -644,7 +644,7 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
|
||||
oclop = OCL_OP_RDIV_SCALE;
|
||||
}
|
||||
else if( !checkScalar(*psrc2, type1, kind2, kind1) )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The operation is neither 'array op array' "
|
||||
"(where arrays have the same size and the same number of channels), "
|
||||
"nor 'array op scalar', nor 'scalar op array'" );
|
||||
@@ -669,7 +669,7 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
|
||||
else
|
||||
{
|
||||
if( !haveScalar && type1 != type2 )
|
||||
CV_Error(CV_StsBadArg,
|
||||
CV_Error(cv::Error::StsBadArg,
|
||||
"When the input arrays in add/subtract/multiply/divide functions have different types, "
|
||||
"the output array type must be explicitly specified");
|
||||
dtype = type1;
|
||||
@@ -1206,7 +1206,7 @@ void cv::compare(InputArray _src1, InputArray _src2, OutputArray _dst, int op)
|
||||
return;
|
||||
}
|
||||
else if(is_src1_scalar == is_src2_scalar)
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The operation is neither 'array op array' (where arrays have the same size and the same type), "
|
||||
"nor 'array op scalar', nor 'scalar op array'" );
|
||||
haveScalar = true;
|
||||
@@ -1615,7 +1615,7 @@ static bool ocl_inRange( InputArray _src, InputArray _lowerb,
|
||||
ssize != lsize || stype != ltype )
|
||||
{
|
||||
if( !checkScalar(_lowerb, stype, lkind, skind) )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The lower boundary is neither an array of the same size and same type as src, nor a scalar");
|
||||
lbScalar = true;
|
||||
}
|
||||
@@ -1624,7 +1624,7 @@ static bool ocl_inRange( InputArray _src, InputArray _lowerb,
|
||||
ssize != usize || stype != utype )
|
||||
{
|
||||
if( !checkScalar(_upperb, stype, ukind, skind) )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The upper boundary is neither an array of the same size and same type as src, nor a scalar");
|
||||
ubScalar = true;
|
||||
}
|
||||
@@ -1738,7 +1738,7 @@ void cv::inRange(InputArray _src, InputArray _lowerb,
|
||||
src.size != lb.size || src.type() != lb.type() )
|
||||
{
|
||||
if( !checkScalar(lb, src.type(), lkind, skind) )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The lower boundary is neither an array of the same size and same type as src, nor a scalar");
|
||||
lbScalar = true;
|
||||
}
|
||||
@@ -1747,7 +1747,7 @@ void cv::inRange(InputArray _src, InputArray _lowerb,
|
||||
src.size != ub.size || src.type() != ub.type() )
|
||||
{
|
||||
if( !checkScalar(ub, src.type(), ukind, skind) )
|
||||
CV_Error( CV_StsUnmatchedSizes,
|
||||
CV_Error( cv::Error::StsUnmatchedSizes,
|
||||
"The upper boundary is neither an array of the same size and same type as src, nor a scalar");
|
||||
ubScalar = true;
|
||||
}
|
||||
|
||||
+160
-160
File diff suppressed because it is too large
Load Diff
@@ -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(", ")
|
||||
|
||||
@@ -96,7 +96,7 @@ void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to)
|
||||
scalarToRawData_<float16_t>(s, (float16_t*)_buf, cn, unroll_to);
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsUnsupportedFormat,"");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat,"");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ int cv::borderInterpolate( int p, int len, int borderType )
|
||||
else if( borderType == BORDER_CONSTANT )
|
||||
p = -1;
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown/unsupported border type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported border type" );
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
+107
-107
@@ -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;
|
||||
@@ -1515,7 +1515,7 @@ void SVD::backSubst( InputArray _w, InputArray _u, InputArray _vt,
|
||||
vt.ptr<double>(), vt.step, true, rhs.ptr<double>(), rhs.step, nb,
|
||||
dst.ptr<double>(), dst.step, buffer.data());
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
+10
-10
@@ -267,7 +267,7 @@ void setSize( Mat& m, int _dims, const int* _sz, const size_t* _steps, bool auto
|
||||
m.step.p[i] = total;
|
||||
uint64 total1 = (uint64)total*s;
|
||||
if( (uint64)total1 != (size_t)total1 )
|
||||
CV_Error( CV_StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
|
||||
total = (size_t)total1;
|
||||
}
|
||||
}
|
||||
@@ -1072,9 +1072,9 @@ void Mat::push_back(const Mat& elems)
|
||||
bool eq = size == elems.size;
|
||||
size.p[0] = int(r);
|
||||
if( !eq )
|
||||
CV_Error(CV_StsUnmatchedSizes, "Pushed vector length is not equal to matrix row length");
|
||||
CV_Error(cv::Error::StsUnmatchedSizes, "Pushed vector length is not equal to matrix row length");
|
||||
if( type() != elems.type() )
|
||||
CV_Error(CV_StsUnmatchedFormats, "Pushed vector type is not the same as matrix type");
|
||||
CV_Error(cv::Error::StsUnmatchedFormats, "Pushed vector type is not the same as matrix type");
|
||||
|
||||
if( isSubmatrix() || dataend + step.p[0]*delta > datalimit )
|
||||
reserve( std::max(r + delta, (r*3+1)/2) );
|
||||
@@ -1170,16 +1170,16 @@ Mat Mat::reshape(int new_cn, int new_rows) const
|
||||
{
|
||||
int total_size = total_width * rows;
|
||||
if( !isContinuous() )
|
||||
CV_Error( CV_BadStep,
|
||||
CV_Error( cv::Error::BadStep,
|
||||
"The matrix is not continuous, thus its number of rows can not be changed" );
|
||||
|
||||
if( (unsigned)new_rows > (unsigned)total_size )
|
||||
CV_Error( CV_StsOutOfRange, "Bad new number of rows" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "Bad new number of rows" );
|
||||
|
||||
total_width = total_size / new_rows;
|
||||
|
||||
if( total_width * new_rows != total_size )
|
||||
CV_Error( CV_StsBadArg, "The total number of matrix elements "
|
||||
CV_Error( cv::Error::StsBadArg, "The total number of matrix elements "
|
||||
"is not divisible by the new number of rows" );
|
||||
|
||||
hdr.rows = new_rows;
|
||||
@@ -1189,7 +1189,7 @@ Mat Mat::reshape(int new_cn, int new_rows) const
|
||||
int new_width = total_width / new_cn;
|
||||
|
||||
if( new_width * new_cn != total_width )
|
||||
CV_Error( CV_BadNumChannels,
|
||||
CV_Error( cv::Error::BadNumChannels,
|
||||
"The total width is not divisible by the new number of channels" );
|
||||
|
||||
hdr.cols = new_width;
|
||||
@@ -1231,13 +1231,13 @@ Mat Mat::reshape(int _cn, int _newndims, const int* _newsz) const
|
||||
else if (i < dims)
|
||||
newsz_buf[i] = this->size[i];
|
||||
else
|
||||
CV_Error(CV_StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
|
||||
CV_Error(cv::Error::StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
|
||||
|
||||
total_elem1 *= (size_t)newsz_buf[i];
|
||||
}
|
||||
|
||||
if (total_elem1 != total_elem1_ref)
|
||||
CV_Error(CV_StsUnmatchedSizes, "Requested and source matrices have different count of elements");
|
||||
CV_Error(cv::Error::StsUnmatchedSizes, "Requested and source matrices have different count of elements");
|
||||
|
||||
Mat hdr = *this;
|
||||
hdr.flags = (hdr.flags & ~CV_MAT_CN_MASK) | ((_cn-1) << CV_CN_SHIFT);
|
||||
@@ -1246,7 +1246,7 @@ Mat Mat::reshape(int _cn, int _newndims, const int* _newsz) const
|
||||
return hdr;
|
||||
}
|
||||
|
||||
CV_Error(CV_StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
|
||||
CV_Error(cv::Error::StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
|
||||
// TBD
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ Mat cvarrToMat(const CvArr* arr, bool copyData,
|
||||
{
|
||||
const IplImage* iplimg = (const IplImage*)arr;
|
||||
if( coiMode == 0 && iplimg->roi && iplimg->roi->coi > 0 )
|
||||
CV_Error(CV_BadCOI, "COI is not supported by the function");
|
||||
CV_Error(cv::Error::BadCOI, "COI is not supported by the function");
|
||||
return iplImageToMat(iplimg, copyData);
|
||||
}
|
||||
if( CV_IS_SEQ(arr) )
|
||||
@@ -187,7 +187,7 @@ Mat cvarrToMat(const CvArr* arr, bool copyData,
|
||||
cvCvtSeqToArray(seq, buf.ptr(), CV_WHOLE_SEQ);
|
||||
return buf;
|
||||
}
|
||||
CV_Error(CV_StsBadArg, "Unknown array type");
|
||||
CV_Error(cv::Error::StsBadArg, "Unknown array type");
|
||||
}
|
||||
|
||||
void extractImageCOI(const CvArr* arr, OutputArray _ch, int coi)
|
||||
@@ -269,14 +269,14 @@ cvReduce( const CvArr* srcarr, CvArr* dstarr, int dim, int op )
|
||||
dim = src.rows > dst.rows ? 0 : src.cols > dst.cols ? 1 : dst.cols == 1;
|
||||
|
||||
if( dim > 1 )
|
||||
CV_Error( CV_StsOutOfRange, "The reduced dimensionality index is out of range" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The reduced dimensionality index is out of range" );
|
||||
|
||||
if( (dim == 0 && (dst.cols != src.cols || dst.rows != 1)) ||
|
||||
(dim == 1 && (dst.rows != src.rows || dst.cols != 1)) )
|
||||
CV_Error( CV_StsBadSize, "The output array size is incorrect" );
|
||||
CV_Error( cv::Error::StsBadSize, "The output array size is incorrect" );
|
||||
|
||||
if( src.channels() != dst.channels() )
|
||||
CV_Error( CV_StsUnmatchedFormats, "Input and output arrays must have the same number of channels" );
|
||||
CV_Error( cv::Error::StsUnmatchedFormats, "Input and output arrays must have the same number of channels" );
|
||||
|
||||
cv::reduce(src, dst, dim, op, dst.type());
|
||||
}
|
||||
@@ -333,7 +333,7 @@ cvRange( CvArr* arr, double start, double end )
|
||||
fdata[j] = (float)val;
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "The function only supports 32sC1 and 32fC1 datatypes" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "The function only supports 32sC1 and 32fC1 datatypes" );
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ static void checkOperandsExist(const Mat& a)
|
||||
{
|
||||
if (a.empty())
|
||||
{
|
||||
CV_Error(CV_StsBadArg, "Matrix operand is an empty matrix.");
|
||||
CV_Error(cv::Error::StsBadArg, "Matrix operand is an empty matrix.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ static void checkOperandsExist(const Mat& a, const Mat& b)
|
||||
{
|
||||
if (a.empty() || b.empty())
|
||||
{
|
||||
CV_Error(CV_StsBadArg, "One or more matrix operands are empty.");
|
||||
CV_Error(cv::Error::StsBadArg, "One or more matrix operands are empty.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1456,7 +1456,7 @@ void MatOp_Bin::assign(const MatExpr& e, Mat& m, int _type) const
|
||||
else if( e.flags == 'a' && !e.b.data )
|
||||
cv::absdiff(e.a, e.s, dst);
|
||||
else
|
||||
CV_Error(CV_StsError, "Unknown operation");
|
||||
CV_Error(cv::Error::StsError, "Unknown operation");
|
||||
|
||||
if( dst.data != m.data )
|
||||
dst.convertTo(m, _type);
|
||||
@@ -1691,7 +1691,7 @@ void MatOp_Initializer::assign(const MatExpr& e, Mat& m, int _type) const
|
||||
else if( e.flags == '1' )
|
||||
m = Scalar(e.alpha);
|
||||
else
|
||||
CV_Error(CV_StsError, "Invalid matrix initializer type");
|
||||
CV_Error(cv::Error::StsError, "Invalid matrix initializer type");
|
||||
}
|
||||
|
||||
void MatOp_Initializer::multiply(const MatExpr& e, double s, MatExpr& res) const
|
||||
|
||||
@@ -954,7 +954,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
||||
}
|
||||
|
||||
if( !func )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
CV_Error( cv::Error::StsUnsupportedFormat,
|
||||
"Unsupported combination of input and output array formats" );
|
||||
|
||||
func( src, temp );
|
||||
|
||||
@@ -758,7 +758,7 @@ double norm( const SparseMat& src, int normType )
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "Only 32f and 64f are supported" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "Only 32f and 64f are supported" );
|
||||
|
||||
if( normType == NORM_L2 )
|
||||
result = std::sqrt(result);
|
||||
@@ -821,7 +821,7 @@ void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _mi
|
||||
*_maxval = maxval;
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsUnsupportedFormat, "Only 32f and 64f are supported" );
|
||||
CV_Error( cv::Error::StsUnsupportedFormat, "Only 32f and 64f are supported" );
|
||||
|
||||
if( _minidx && minidx )
|
||||
for( i = 0; i < d; i++ )
|
||||
@@ -843,7 +843,7 @@ void normalize( const SparseMat& src, SparseMat& dst, double a, int norm_type )
|
||||
scale = scale > DBL_EPSILON ? a/scale : 0.;
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown/unsupported norm type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported norm type" );
|
||||
|
||||
src.convertTo( dst, -1, scale );
|
||||
}
|
||||
|
||||
@@ -948,7 +948,7 @@ bool _InputArray::isContinuous(int i) const
|
||||
if( k == CUDA_GPU_MAT )
|
||||
return i < 0 ? ((const cuda::GpuMat*)obj)->isContinuous() : true;
|
||||
|
||||
CV_Error(CV_StsNotImplemented, "Unknown/unsupported array type");
|
||||
CV_Error(cv::Error::StsNotImplemented, "Unknown/unsupported array type");
|
||||
}
|
||||
|
||||
bool _InputArray::isSubmatrix(int i) const
|
||||
@@ -986,7 +986,7 @@ bool _InputArray::isSubmatrix(int i) const
|
||||
return vv[i].isSubmatrix();
|
||||
}
|
||||
|
||||
CV_Error(CV_StsNotImplemented, "");
|
||||
CV_Error(cv::Error::StsNotImplemented, "");
|
||||
}
|
||||
|
||||
size_t _InputArray::offset(int i) const
|
||||
@@ -1466,14 +1466,14 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
|
||||
((std::vector<Vec<int, 128> >*)v)->resize(len);
|
||||
break;
|
||||
default:
|
||||
CV_Error_(CV_StsBadArg, ("Vectors with element size %d are not supported. Please, modify OutputArray::create()\n", esz));
|
||||
CV_Error_(cv::Error::StsBadArg, ("Vectors with element size %d are not supported. Please, modify OutputArray::create()\n", esz));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if( k == NONE )
|
||||
{
|
||||
CV_Error(CV_StsNullPtr, "create() called for the missing output array" );
|
||||
CV_Error(cv::Error::StsNullPtr, "create() called for the missing output array" );
|
||||
}
|
||||
|
||||
if( k == STD_VECTOR_MAT )
|
||||
|
||||
@@ -1392,7 +1392,7 @@ void normalize(InputArray _src, InputOutputArray _dst, double a, double b,
|
||||
shift = 0;
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown/unsupported norm type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown/unsupported norm type" );
|
||||
|
||||
CV_OCL_RUN(_dst.isUMat(),
|
||||
ocl_normalize(_src, _dst, _mask, rtype, scale, shift))
|
||||
|
||||
@@ -574,7 +574,7 @@ void RNG::fill( InputOutputArray _mat, int disttype,
|
||||
CV_Assert( scaleFunc != 0 );
|
||||
}
|
||||
else
|
||||
CV_Error( CV_StsBadArg, "Unknown distribution type" );
|
||||
CV_Error( cv::Error::StsBadArg, "Unknown distribution type" );
|
||||
|
||||
const Mat* arrays[] = {&mat, 0};
|
||||
uchar* ptr;
|
||||
|
||||
+53
-53
@@ -1377,38 +1377,38 @@ CV_IMPL const char* cvErrorStr( int status )
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case CV_StsOk : return "No Error";
|
||||
case CV_StsBackTrace : return "Backtrace";
|
||||
case CV_StsError : return "Unspecified error";
|
||||
case CV_StsInternal : return "Internal error";
|
||||
case CV_StsNoMem : return "Insufficient memory";
|
||||
case CV_StsBadArg : return "Bad argument";
|
||||
case CV_StsNoConv : return "Iterations do not converge";
|
||||
case CV_StsAutoTrace : return "Autotrace call";
|
||||
case CV_StsBadSize : return "Incorrect size of input array";
|
||||
case CV_StsNullPtr : return "Null pointer";
|
||||
case CV_StsDivByZero : return "Division by zero occurred";
|
||||
case CV_BadStep : return "Image step is wrong";
|
||||
case CV_StsInplaceNotSupported : return "Inplace operation is not supported";
|
||||
case CV_StsObjectNotFound : return "Requested object was not found";
|
||||
case CV_BadDepth : return "Input image depth is not supported by function";
|
||||
case CV_StsUnmatchedFormats : return "Formats of input arguments do not match";
|
||||
case CV_StsUnmatchedSizes : return "Sizes of input arguments do not match";
|
||||
case CV_StsOutOfRange : return "One of the arguments\' values is out of range";
|
||||
case CV_StsUnsupportedFormat : return "Unsupported format or combination of formats";
|
||||
case CV_BadCOI : return "Input COI is not supported";
|
||||
case CV_BadNumChannels : return "Bad number of channels";
|
||||
case CV_StsBadFlag : return "Bad flag (parameter or structure field)";
|
||||
case CV_StsBadPoint : return "Bad parameter of type CvPoint";
|
||||
case CV_StsBadMask : return "Bad type of mask argument";
|
||||
case CV_StsParseError : return "Parsing error";
|
||||
case CV_StsNotImplemented : return "The function/feature is not implemented";
|
||||
case CV_StsBadMemBlock : return "Memory block has been corrupted";
|
||||
case CV_StsAssert : return "Assertion failed";
|
||||
case CV_GpuNotSupported : return "No CUDA support";
|
||||
case CV_GpuApiCallError : return "Gpu API call";
|
||||
case CV_OpenGlNotSupported : return "No OpenGL support";
|
||||
case CV_OpenGlApiCallError : return "OpenGL API call";
|
||||
case cv::Error::StsOk : return "No Error";
|
||||
case cv::Error::StsBackTrace : return "Backtrace";
|
||||
case cv::Error::StsError : return "Unspecified error";
|
||||
case cv::Error::StsInternal : return "Internal error";
|
||||
case cv::Error::StsNoMem : return "Insufficient memory";
|
||||
case cv::Error::StsBadArg : return "Bad argument";
|
||||
case cv::Error::StsNoConv : return "Iterations do not converge";
|
||||
case cv::Error::StsAutoTrace : return "Autotrace call";
|
||||
case cv::Error::StsBadSize : return "Incorrect size of input array";
|
||||
case cv::Error::StsNullPtr : return "Null pointer";
|
||||
case cv::Error::StsDivByZero : return "Division by zero occurred";
|
||||
case cv::Error::BadStep : return "Image step is wrong";
|
||||
case cv::Error::StsInplaceNotSupported : return "Inplace operation is not supported";
|
||||
case cv::Error::StsObjectNotFound : return "Requested object was not found";
|
||||
case cv::Error::BadDepth : return "Input image depth is not supported by function";
|
||||
case cv::Error::StsUnmatchedFormats : return "Formats of input arguments do not match";
|
||||
case cv::Error::StsUnmatchedSizes : return "Sizes of input arguments do not match";
|
||||
case cv::Error::StsOutOfRange : return "One of the arguments\' values is out of range";
|
||||
case cv::Error::StsUnsupportedFormat : return "Unsupported format or combination of formats";
|
||||
case cv::Error::BadCOI : return "Input COI is not supported";
|
||||
case cv::Error::BadNumChannels : return "Bad number of channels";
|
||||
case cv::Error::StsBadFlag : return "Bad flag (parameter or structure field)";
|
||||
case cv::Error::StsBadPoint : return "Bad parameter of type CvPoint";
|
||||
case cv::Error::StsBadMask : return "Bad type of mask argument";
|
||||
case cv::Error::StsParseError : return "Parsing error";
|
||||
case cv::Error::StsNotImplemented : return "The function/feature is not implemented";
|
||||
case cv::Error::StsBadMemBlock : return "Memory block has been corrupted";
|
||||
case cv::Error::StsAssert : return "Assertion failed";
|
||||
case cv::Error::GpuNotSupported : return "No CUDA support";
|
||||
case cv::Error::GpuApiCallError : return "Gpu API call";
|
||||
case cv::Error::OpenGlNotSupported : return "No OpenGL support";
|
||||
case cv::Error::OpenGlApiCallError : return "OpenGL API call";
|
||||
};
|
||||
|
||||
snprintf(buf, sizeof(buf), "Unknown %s code %d", status >= 0 ? "status":"error", status);
|
||||
@@ -1448,29 +1448,29 @@ cvErrorFromIppStatus( int status )
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case CV_BADSIZE_ERR: return CV_StsBadSize;
|
||||
case CV_BADMEMBLOCK_ERR: return CV_StsBadMemBlock;
|
||||
case CV_NULLPTR_ERR: return CV_StsNullPtr;
|
||||
case CV_DIV_BY_ZERO_ERR: return CV_StsDivByZero;
|
||||
case CV_BADSTEP_ERR: return CV_BadStep;
|
||||
case CV_OUTOFMEM_ERR: return CV_StsNoMem;
|
||||
case CV_BADARG_ERR: return CV_StsBadArg;
|
||||
case CV_NOTDEFINED_ERR: return CV_StsError;
|
||||
case CV_INPLACE_NOT_SUPPORTED_ERR: return CV_StsInplaceNotSupported;
|
||||
case CV_NOTFOUND_ERR: return CV_StsObjectNotFound;
|
||||
case CV_BADCONVERGENCE_ERR: return CV_StsNoConv;
|
||||
case CV_BADDEPTH_ERR: return CV_BadDepth;
|
||||
case CV_UNMATCHED_FORMATS_ERR: return CV_StsUnmatchedFormats;
|
||||
case CV_UNSUPPORTED_COI_ERR: return CV_BadCOI;
|
||||
case CV_UNSUPPORTED_CHANNELS_ERR: return CV_BadNumChannels;
|
||||
case CV_BADFLAG_ERR: return CV_StsBadFlag;
|
||||
case CV_BADRANGE_ERR: return CV_StsBadArg;
|
||||
case CV_BADCOEF_ERR: return CV_StsBadArg;
|
||||
case CV_BADFACTOR_ERR: return CV_StsBadArg;
|
||||
case CV_BADPOINT_ERR: return CV_StsBadPoint;
|
||||
case CV_BADSIZE_ERR: return cv::Error::StsBadSize;
|
||||
case CV_BADMEMBLOCK_ERR: return cv::Error::StsBadMemBlock;
|
||||
case CV_NULLPTR_ERR: return cv::Error::StsNullPtr;
|
||||
case CV_DIV_BY_ZERO_ERR: return cv::Error::StsDivByZero;
|
||||
case CV_BADSTEP_ERR: return cv::Error::BadStep;
|
||||
case CV_OUTOFMEM_ERR: return cv::Error::StsNoMem;
|
||||
case CV_BADARG_ERR: return cv::Error::StsBadArg;
|
||||
case CV_NOTDEFINED_ERR: return cv::Error::StsError;
|
||||
case CV_INPLACE_NOT_SUPPORTED_ERR: return cv::Error::StsInplaceNotSupported;
|
||||
case CV_NOTFOUND_ERR: return cv::Error::StsObjectNotFound;
|
||||
case CV_BADCONVERGENCE_ERR: return cv::Error::StsNoConv;
|
||||
case CV_BADDEPTH_ERR: return cv::Error::BadDepth;
|
||||
case CV_UNMATCHED_FORMATS_ERR: return cv::Error::StsUnmatchedFormats;
|
||||
case CV_UNSUPPORTED_COI_ERR: return cv::Error::BadCOI;
|
||||
case CV_UNSUPPORTED_CHANNELS_ERR: return cv::Error::BadNumChannels;
|
||||
case CV_BADFLAG_ERR: return cv::Error::StsBadFlag;
|
||||
case CV_BADRANGE_ERR: return cv::Error::StsBadArg;
|
||||
case CV_BADCOEF_ERR: return cv::Error::StsBadArg;
|
||||
case CV_BADFACTOR_ERR: return cv::Error::StsBadArg;
|
||||
case CV_BADPOINT_ERR: return cv::Error::StsBadPoint;
|
||||
|
||||
default:
|
||||
return CV_StsError;
|
||||
return cv::Error::StsError;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ void setSize( UMat& m, int _dims, const int* _sz,
|
||||
m.step.p[i] = total;
|
||||
int64 total1 = (int64)total*s;
|
||||
if( (uint64)total1 != (size_t)total1 )
|
||||
CV_Error( CV_StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "The total matrix size does not fit to \"size_t\" type" );
|
||||
total = (size_t)total1;
|
||||
}
|
||||
}
|
||||
@@ -965,16 +965,16 @@ UMat UMat::reshape(int new_cn, int new_rows) const
|
||||
{
|
||||
int total_size = total_width * rows;
|
||||
if( !isContinuous() )
|
||||
CV_Error( CV_BadStep,
|
||||
CV_Error( cv::Error::BadStep,
|
||||
"The matrix is not continuous, thus its number of rows can not be changed" );
|
||||
|
||||
if( (unsigned)new_rows > (unsigned)total_size )
|
||||
CV_Error( CV_StsOutOfRange, "Bad new number of rows" );
|
||||
CV_Error( cv::Error::StsOutOfRange, "Bad new number of rows" );
|
||||
|
||||
total_width = total_size / new_rows;
|
||||
|
||||
if( total_width * new_rows != total_size )
|
||||
CV_Error( CV_StsBadArg, "The total number of matrix elements "
|
||||
CV_Error( cv::Error::StsBadArg, "The total number of matrix elements "
|
||||
"is not divisible by the new number of rows" );
|
||||
|
||||
hdr.rows = new_rows;
|
||||
@@ -984,7 +984,7 @@ UMat UMat::reshape(int new_cn, int new_rows) const
|
||||
int new_width = total_width / new_cn;
|
||||
|
||||
if( new_width * new_cn != total_width )
|
||||
CV_Error( CV_BadNumChannels,
|
||||
CV_Error( cv::Error::BadNumChannels,
|
||||
"The total width is not divisible by the new number of channels" );
|
||||
|
||||
hdr.cols = new_width;
|
||||
@@ -1050,13 +1050,13 @@ UMat UMat::reshape(int _cn, int _newndims, const int* _newsz) const
|
||||
else if (i < dims)
|
||||
newsz_buf[i] = this->size[i];
|
||||
else
|
||||
CV_Error(CV_StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
|
||||
CV_Error(cv::Error::StsOutOfRange, "Copy dimension (which has zero size) is not present in source matrix");
|
||||
|
||||
total_elem1 *= (size_t)newsz_buf[i];
|
||||
}
|
||||
|
||||
if (total_elem1 != total_elem1_ref)
|
||||
CV_Error(CV_StsUnmatchedSizes, "Requested and source matrices have different count of elements");
|
||||
CV_Error(cv::Error::StsUnmatchedSizes, "Requested and source matrices have different count of elements");
|
||||
|
||||
UMat hdr = *this;
|
||||
hdr.flags = (hdr.flags & ~CV_MAT_CN_MASK) | ((_cn-1) << CV_CN_SHIFT);
|
||||
@@ -1065,7 +1065,7 @@ UMat UMat::reshape(int _cn, int _newndims, const int* _newsz) const
|
||||
return hdr;
|
||||
}
|
||||
|
||||
CV_Error(CV_StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
|
||||
CV_Error(cv::Error::StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
|
||||
}
|
||||
|
||||
Mat UMat::getMat(AccessFlag accessFlags) const
|
||||
|
||||
@@ -593,7 +593,7 @@ static void inRange(const Mat& src, const Mat& lb, const Mat& rb, Mat& dst)
|
||||
inRange_((const double*)sptr, (const double*)aptr, (const double*)bptr, dptr, total, cn);
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -642,7 +642,7 @@ static void inRangeS(const Mat& src, const Scalar& lb, const Scalar& rb, Mat& ds
|
||||
inRangeS_((const double*)sptr, lbuf.d, rbuf.d, dptr, total, cn);
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ static void DFT_1D( const Mat& _src, Mat& _dst, int flags, const Mat& _wave=Mat(
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
}
|
||||
|
||||
|
||||
@@ -878,7 +878,7 @@ protected:
|
||||
{
|
||||
cout << "actual:\n" << dst << endl << endl;
|
||||
cout << "reference:\n" << dstz << endl << endl;
|
||||
CV_Error(CV_StsError, "");
|
||||
CV_Error(cv::Error::StsError, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ static void setValue(SparseMat& M, const int* idx, double value, RNG& rng)
|
||||
else if( M.type() == CV_64F )
|
||||
*(double*)ptr = value;
|
||||
else
|
||||
CV_Error(CV_StsUnsupportedFormat, "");
|
||||
CV_Error(cv::Error::StsUnsupportedFormat, "");
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ == 11 || __GNUC__ == 12 || __GNUC__ == 13)
|
||||
|
||||
Reference in New Issue
Block a user