}
return (vertices.size() == largeHeight * largeWidth + smallHeight * smallWidth);
}
-
- default:
- CV_Error(0, "Unknown pattern type");
}
-
- return false;
+ CV_Error(Error::StsBadArg, "Unknown pattern type");
}
void CirclesGridFinder::findMCS(const std::vector<Point2f> &basis, std::vector<Graph> &basisGraphs)
static void* OutOfMemoryError(size_t size)
{
CV_Error_(CV_StsNoMem, ("Failed to allocate %llu bytes", (unsigned long long)size));
- return 0;
}
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
#include "precomp.hpp"
#include <sstream>
}
CV_Error_(Error::StsBadArg, ("undeclared key '%s' requested", name.c_str()));
- return false;
}
bool CommandLineParser::check() const
return func;
}
#else
+#if defined(_MSC_VER)
+ #pragma warning(disable : 4702) // unreachable code
+#endif
static void* IntGetProcAddress(const char*)
{
CV_Error(cv::Error::OpenGlNotSupported, "The library is compiled without OpenGL support");
CV_Error(CV_StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
// TBD
- return Mat();
}
Mat Mat::reshape(int _cn, const std::vector<int>& _newshape) const
return buf;
}
CV_Error(CV_StsBadArg, "Unknown array type");
- return Mat();
}
void extractImageCOI(const CvArr* arr, OutputArray _ch, int coi)
{
CV_Assert( i < 0 );
CV_Error(cv::Error::StsNotImplemented, "You should explicitly call mapHost/unmapHost methods for ogl::Buffer object");
- return Mat();
}
if( k == CUDA_GPU_MAT )
{
CV_Assert( i < 0 );
CV_Error(cv::Error::StsNotImplemented, "You should explicitly call download method for cuda::GpuMat object");
- return Mat();
}
if( k == CUDA_HOST_MEM )
}
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
- return Mat();
}
UMat _InputArray::getUMat(int i) const
if (k == OPENGL_BUFFER)
{
CV_Error(cv::Error::StsNotImplemented, "You should explicitly call mapDevice/unmapDevice methods for ogl::Buffer object");
- return cuda::GpuMat();
}
if (k == NONE)
return cuda::GpuMat();
CV_Error(cv::Error::StsNotImplemented, "getGpuMat is available only for cuda::GpuMat and cuda::HostMem");
- return cuda::GpuMat();
}
void _InputArray::getGpuMatVector(std::vector<cuda::GpuMat>& gpumv) const
{
}
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
- return Size();
}
int _InputArray::sizend(int* arrsz, int i) const
}
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
- return 0;
}
size_t _InputArray::total(int i) const
return ((const cuda::HostMem*)obj)->type();
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
- return 0;
}
int _InputArray::depth(int i) const
return ((const cuda::HostMem*)obj)->empty();
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
- return true;
}
bool _InputArray::isContinuous(int i) const
return i < 0 ? ((const cuda::GpuMat*)obj)->isContinuous() : true;
CV_Error(CV_StsNotImplemented, "Unknown/unsupported array type");
- return false;
}
bool _InputArray::isSubmatrix(int i) const
}
CV_Error(CV_StsNotImplemented, "");
- return false;
}
size_t _InputArray::offset(int i) const
}
CV_Error(Error::StsNotImplemented, "");
- return 0;
}
size_t _InputArray::step(int i) const
}
CV_Error(Error::StsNotImplemented, "");
- return 0;
}
void _InputArray::copyTo(const _OutputArray& arr) const
if( k == NONE )
{
CV_Error(CV_StsNullPtr, "create() called for the missing output array" );
- return;
}
if( k == STD_VECTOR_MAT )
void cv::ogl::Arrays::setAutoRelease(bool flag)
{
+#ifndef HAVE_OPENGL
+ CV_UNUSED(flag);
+ throw_no_ogl();
+#else
vertex_.setAutoRelease(flag);
color_.setAutoRelease(flag);
normal_.setAutoRelease(flag);
texCoord_.setAutoRelease(flag);
+#endif
}
void cv::ogl::Arrays::bind() const
}
CV_Error(CV_StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
- // TBD
- return UMat();
}
Mat UMat::getMat(int accessFlags) const
std::cout << "Number of rows: " << evalues.rows << " Number of cols: " << evalues.cols << endl;
std::cout << "Size of src symmetric matrix: " << src.rows << " * " << src.cols << endl; std::cout << endl;
CV_Error(CORE_EIGEN_ERROR_COUNT, MESSAGE_ERROR_COUNT);
- return false;
}
return true;
}
std::cout << "Number of rows: " << evectors.rows << " Number of cols: " << evectors.cols << endl;
std:: cout << "Size of src symmetric matrix: " << src.rows << " * " << src.cols << endl; std::cout << endl;
CV_Error (CORE_EIGEN_ERROR_SIZE, MESSAGE_ERROR_SIZE);
- return false;
}
if (!(evalues.rows == right_eigen_pair_count && evalues.cols == 1))
std::cout << "Number of rows: " << evalues.rows << " Number of cols: " << evalues.cols << endl;
std:: cout << "Size of src symmetric matrix: " << src.rows << " * " << src.cols << endl; std::cout << endl;
CV_Error (CORE_EIGEN_ERROR_COUNT, MESSAGE_ERROR_COUNT);
- return false;
}
return true;
std::cout << endl; std::cout << "Checking orthogonality of matrix " << U << ": ";
print_information(i, U, diff, eps_vec);
CV_Error(CORE_EIGEN_ERROR_ORTHO, MESSAGE_ERROR_ORTHO);
- return false;
}
}
std::cout << "Pair of indexes with non descending of eigen values: (" << i << ", " << i+1 << ")." << endl;
std::cout << endl;
CV_Error(CORE_EIGEN_ERROR_ORDER, MESSAGE_ERROR_ORDER);
- return false;
}
break;
std::cout << "Pair of indexes with non descending of eigen values: (" << i << ", " << i+1 << ")." << endl;
std::cout << endl;
CV_Error(CORE_EIGEN_ERROR_ORDER, "Eigen values are not sorted in descending order.");
- return false;
}
break;
std::cout << endl; std::cout << "Checking accuracy of eigen vectors computing for matrix " << src << ": ";
print_information(i, src, diff, eps_vec);
CV_Error(CORE_EIGEN_ERROR_DIFF, MESSAGE_ERROR_DIFF_2);
- return false;
}
}
std::cout << endl; std::cout << "Checking accuracy of eigen values computing for matrix " << src << ": ";
print_information(i, src, diff, eps_val);
CV_Error(CORE_EIGEN_ERROR_DIFF, MESSAGE_ERROR_DIFF_1);
- return false;
}
}
{
case Param::INT:
return (int)pi->size();
- break;
case Param::STRING:
return (int)ps->size();
- break;
case Param::REAL:
return (int)pd->size();
- break;
- default:
- CV_Error(Error::StsInternal, "");
- return -1;
}
+#ifdef __OPENCV_BUILD
+ CV_Error(Error::StsInternal, "");
+#else
+ CV_ErrorNoReturn(Error::StsInternal, "");
+#endif
}
inline std::ostream &operator<<(std::ostream &stream, const DictValue &dictv)
{
CV_Error( Error::StsNotImplemented, "deep clone functionality is not implemented, because "
"Flann::Index has not copy constructor or clone method ");
+#if 0
//matcher->flannIndex;
matcher->addedDescCount = addedDescCount;
matcher->mergedDescriptors = DescriptorCollection( mergedDescriptors );
std::transform( trainDescCollection.begin(), trainDescCollection.end(),
matcher->trainDescCollection.begin(), clone_op );
+#endif
}
return matcher;
}
cv::QtFont cv::fontQt(const String&, int, Scalar, int, int, int)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
- return QtFont();
}
void cv::addText( const Mat&, const String&, Point, const QtFont&)
int cv::startLoop(int (*)(int argc, char *argv[]), int , char**)
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
- return 0;
}
void cv::stopLoop()
int cv::createButton(const String&, ButtonCallback, void*, int , bool )
{
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
- return 0;
}
#endif
}
#define CV_NO_GUI_ERROR(funcname) \
- cvError( CV_StsError, funcname, \
+ cv::errorNoReturn(cv::Error::StsError, \
"The function is not implemented. " \
"Rebuild the library with Windows, GTK+ 2.x or Carbon support. "\
"If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script", \
- __FILE__, __LINE__ )
+ funcname, __FILE__, __LINE__)
CV_IMPL int cvNamedWindow( const char*, int )
{
CV_NO_GUI_ERROR("cvNamedWindow");
- return -1;
}
CV_IMPL void cvDestroyWindow( const char* )
int*, int, CvTrackbarCallback )
{
CV_NO_GUI_ERROR( "cvCreateTrackbar" );
- return -1;
}
CV_IMPL int
void* /*userdata*/ )
{
CV_NO_GUI_ERROR( "cvCreateTrackbar2" );
- return -1;
}
CV_IMPL void
CV_IMPL int cvGetTrackbarPos( const char*, const char* )
{
CV_NO_GUI_ERROR( "cvGetTrackbarPos" );
- return -1;
}
CV_IMPL void cvSetTrackbarPos( const char*, const char*, int )
CV_IMPL void* cvGetWindowHandle( const char* )
{
CV_NO_GUI_ERROR( "cvGetWindowHandle" );
- return 0;
}
CV_IMPL const char* cvGetWindowName( void* )
{
CV_NO_GUI_ERROR( "cvGetWindowName" );
- return 0;
}
CV_IMPL int cvWaitKey( int )
{
CV_NO_GUI_ERROR( "cvWaitKey" );
- return -1;
}
CV_IMPL int cvInitSystem( int , char** )
{
CV_NO_GUI_ERROR( "cvInitSystem" );
- return -1;
}
CV_IMPL int cvStartWindowThread()
{
CV_NO_GUI_ERROR( "cvStartWindowThread" );
- return -1;
}
//-------- Qt ---------
{
(void)argv;
CV_NO_GUI_ERROR("cvStartLoop");
- return -1;
}
CV_IMPL void cvStopLoop()
CV_IMPL int cvCreateButton(const char*, void (*)(int, void*), void*, int, int)
{
CV_NO_GUI_ERROR("cvCreateButton");
- return -1;
}
CV_Error(cv::Error::StsError, cv::String("RGBE error: \n") +
cv::String(msg));
}
- return RGBE_RETURN_FAILURE;
}
/* standard conversion from float pixels to rgbe pixels */
case CV_32SC1: return interp1_<int>(x,Y,xi); break;
case CV_32FC1: return interp1_<float>(x,Y,xi); break;
case CV_64FC1: return interp1_<double>(x,Y,xi); break;
- default: CV_Error(Error::StsUnsupportedFormat, ""); break;
}
- return Mat();
+ CV_Error(Error::StsUnsupportedFormat, "");
}
namespace colormap
}
CV_Error(CV_StsUnsupportedFormat, "unsupported label/image type");
- return -1;
}
}
}
else{
CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s");
- return 0;
}
}
CV_Error_( CV_StsNotImplemented,
("Unsupported combination of source format (=%d), and buffer format (=%d)",
srcType, bufType));
-
- return Ptr<BaseRowFilter>();
}
CV_Error_( CV_StsNotImplemented,
("Unsupported combination of buffer format (=%d), and destination format (=%d)",
bufType, dstType));
-
- return Ptr<BaseColumnFilter>();
}
CV_Error_( CV_StsNotImplemented,
("Unsupported combination of source format (=%d), and destination format (=%d)",
srcType, dstType));
-
- return Ptr<BaseFilter>();
}
}
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
- return Ptr<BaseRowFilter>();
}
cv::Ptr<cv::BaseColumnFilter> cv::getMorphologyColumnFilter(int op, int type, int ksize, int anchor)
}
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
- return Ptr<BaseColumnFilter>();
}
}
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
- return Ptr<BaseFilter>();
}
return true;
else if (CV_IS_MAT( arr ))
return false;
- else
- CV_Error( CV_StsBadArg, "Destination is not CvMemStorage* nor CvMat*" );
- return false;
+ CV_Error( CV_StsBadArg, "Destination is not CvMemStorage* nor CvMat*" );
}
#endif /*__OPENCV_CV_INTERNAL_H_*/
CV_Error_( CV_StsNotImplemented,
("Unsupported combination of source format (=%d), and buffer format (=%d)",
srcType, sumType));
-
- return Ptr<BaseRowFilter>();
}
CV_Error_( CV_StsNotImplemented,
("Unsupported combination of sum format (=%d), and destination format (=%d)",
sumType, dstType));
-
- return Ptr<BaseColumnFilter>();
}
CV_Error_( CV_StsNotImplemented,
("Unsupported combination of source format (=%d), and buffer format (=%d)",
srcType, sumType));
-
- return Ptr<BaseRowFilter>();
}
}
return Point2f((float)asin(x1), (float)asin(y1));
}
CV_Error(CV_StsBadArg, "Unknown projection type");
- return Point2f();
}
cout << "Result rect (x, y, w, h): [" << rect[i].x << ", " << rect[i].y << ", " << rect[i].width << ", " << rect[i].height << "]" << endl;
cout << endl;
CV_Error(IMGPROC_BOUNDINGRECT_ERROR_DIFF, MESSAGE_ERROR_DIFF);
- return false;
}
}
if( !str.compare("NU_SVR") )
return SVM::NU_SVR;
CV_Error( CV_StsBadArg, "incorrect svm type string" );
- return -1;
}
int str_to_svm_kernel_type( String& str )
{
if( !str.compare("SIGMOID") )
return SVM::SIGMOID;
CV_Error( CV_StsBadArg, "incorrect svm type string" );
- return -1;
}
// 4. em
if (!str.compare("ANNEAL"))
return ANN_MLP::ANNEAL;
CV_Error( CV_StsBadArg, "incorrect ann train method string" );
- return -1;
}
#if 0
if (!str.compare("LEAKYRELU"))
return ANN_MLP::LEAKYRELU;
CV_Error(CV_StsBadArg, "incorrect ann activation function string");
- return -1;
}
#endif
if ( !str.compare("GENTLE") )
return Boost::GENTLE;
CV_Error( CV_StsBadArg, "incorrect boost type string" );
- return -1;
}
// 8. rtrees
if ( !str.compare("ASGD") )
return SVMSGD::ASGD;
CV_Error( CV_StsBadArg, "incorrect svmsgd type string" );
- return -1;
}
int str_to_margin_type( String& str )
if ( !str.compare("HARD_MARGIN") )
return SVMSGD::HARD_MARGIN;
CV_Error( CV_StsBadArg, "incorrect svmsgd margin type string" );
- return -1;
}
}
if (type == GAIN_BLOCKS)
return makePtr<BlocksGainCompensator>();
CV_Error(Error::StsBadArg, "unsupported exposure compensation method");
- return Ptr<ExposureCompensator>();
}
if( size > max_size )
{
CV_Error(CV_StsOutOfRange, "too big maximum Huffman code size");
- return false;
}
memset( table, 0, size*sizeof(table[0]));