Merge pull request #11381 from alalek:replace_cv_errornoreturn
This commit is contained in:
commit
d72494d09d
@ -120,7 +120,9 @@ if(CV_GCC OR CV_CLANG)
|
||||
add_extra_compiler_option(-Wno-unnamed-type-template-args)
|
||||
add_extra_compiler_option(-Wno-comment)
|
||||
if(NOT OPENCV_SKIP_IMPLICIT_FALLTHROUGH
|
||||
AND NOT " ${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}" MATCHES "implicit-fallthrough")
|
||||
AND NOT " ${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}" MATCHES "implicit-fallthrough"
|
||||
AND (CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
|
||||
)
|
||||
add_extra_compiler_option(-Wimplicit-fallthrough=3)
|
||||
endif()
|
||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.2.0)
|
||||
|
||||
@ -759,12 +759,8 @@ bool CirclesGridFinder::isDetectionCorrect()
|
||||
}
|
||||
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)
|
||||
|
||||
@ -371,7 +371,7 @@ It is possible to alternate error processing by using redirectError().
|
||||
@param _func - function name. Available only when the compiler supports getting it
|
||||
@param _file - source file name where the error has occurred
|
||||
@param _line - line number in the source file where the error has occurred
|
||||
@see CV_Error, CV_Error_, CV_ErrorNoReturn, CV_ErrorNoReturn_, CV_Assert, CV_DbgAssert
|
||||
@see CV_Error, CV_Error_, CV_Assert, CV_DbgAssert
|
||||
*/
|
||||
CV_EXPORTS void error(int _code, const String& _err, const char* _func, const char* _file, int _line);
|
||||
|
||||
@ -414,8 +414,6 @@ CV_INLINE CV_NORETURN void errorNoReturn(int _code, const String& _err, const ch
|
||||
// We need to use simplified definition for them.
|
||||
#define CV_Error(...) do { abort(); } while (0)
|
||||
#define CV_Error_( code, args ) do { cv::format args; abort(); } while (0)
|
||||
#define CV_ErrorNoReturn(...) do { abort(); } while (0)
|
||||
#define CV_ErrorNoReturn_(...) do { abort(); } while (0)
|
||||
#define CV_Assert_1( expr ) do { if (!(expr)) abort(); } while (0)
|
||||
|
||||
#else // CV_STATIC_ANALYSIS
|
||||
@ -446,22 +444,22 @@ for example:
|
||||
*/
|
||||
#define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )
|
||||
|
||||
/** same as CV_Error(code,msg), but does not return */
|
||||
#define CV_ErrorNoReturn( code, msg ) cv::errorNoReturn( code, msg, CV_Func, __FILE__, __LINE__ )
|
||||
|
||||
/** same as CV_Error_(code,args), but does not return */
|
||||
#define CV_ErrorNoReturn_( code, args ) cv::errorNoReturn( code, cv::format args, CV_Func, __FILE__, __LINE__ )
|
||||
|
||||
#define CV_Assert_1( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
|
||||
|
||||
//! @cond IGNORED
|
||||
#define CV__ErrorNoReturn( code, msg ) cv::errorNoReturn( code, msg, CV_Func, __FILE__, __LINE__ )
|
||||
#define CV__ErrorNoReturn_( code, args ) cv::errorNoReturn( code, cv::format args, CV_Func, __FILE__, __LINE__ )
|
||||
#ifdef __OPENCV_BUILD
|
||||
#undef CV_Error
|
||||
#define CV_Error CV_ErrorNoReturn
|
||||
#define CV_Error CV__ErrorNoReturn
|
||||
#undef CV_Error_
|
||||
#define CV_Error_ CV_ErrorNoReturn_
|
||||
#define CV_Error_ CV__ErrorNoReturn_
|
||||
#undef CV_Assert_1
|
||||
#define CV_Assert_1( expr ) if(!!(expr)) ; else cv::errorNoReturn( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
|
||||
#else
|
||||
// backward compatibility
|
||||
#define CV_ErrorNoReturn CV__ErrorNoReturn
|
||||
#define CV_ErrorNoReturn_ CV__ErrorNoReturn_
|
||||
#endif
|
||||
//! @endcond
|
||||
|
||||
|
||||
@ -1047,7 +1047,7 @@ template<typename _Tp, int n> inline bool v_check_any(const v_reg<_Tp, n>& a)
|
||||
Return value will be built by combining values _a_ and _b_ using the following scheme:
|
||||
result[i] = mask[i] ? a[i] : b[i];
|
||||
|
||||
@Note: _mask_ element values are restricted to these values:
|
||||
@note: _mask_ element values are restricted to these values:
|
||||
- 0: select element from _b_
|
||||
- 0xff/0xffff/etc: select element from _a_
|
||||
(fully compatible with bitwise-based operator)
|
||||
|
||||
@ -93,7 +93,7 @@ static void dumpOpenCLInformation()
|
||||
|
||||
const Device& device = Device::getDefault();
|
||||
if (!device.available())
|
||||
CV_ErrorNoReturn(Error::OpenCLInitError, "OpenCL device is not available");
|
||||
CV_Error(Error::OpenCLInitError, "OpenCL device is not available");
|
||||
|
||||
DUMP_MESSAGE_STDOUT("Current OpenCL device: ");
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef CL_VERSION_1_2
|
||||
#define CV_REQUIRE_OPENCL_1_2_ERROR CV_ErrorNoReturn(cv::Error::OpenCLApiCallError, "OpenCV compiled without OpenCL v1.2 support, so we can't use functionality from OpenCL v1.2")
|
||||
#define CV_REQUIRE_OPENCL_1_2_ERROR CV_Error(cv::Error::OpenCLApiCallError, "OpenCV compiled without OpenCL v1.2 support, so we can't use functionality from OpenCL v1.2")
|
||||
#endif
|
||||
|
||||
#endif // HAVE_OPENCL
|
||||
|
||||
@ -53,7 +53,6 @@ namespace cv {
|
||||
static void* OutOfMemoryError(size_t size)
|
||||
{
|
||||
CV_Error_(CV_StsNoMem, ("Failed to allocate %llu bytes", (unsigned long long)size));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
// 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>
|
||||
|
||||
@ -364,7 +367,6 @@ bool CommandLineParser::has(const String& name) const
|
||||
}
|
||||
|
||||
CV_Error_(Error::StsBadArg, ("undeclared key '%s' requested", name.c_str()));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CommandLineParser::check() const
|
||||
|
||||
@ -50,11 +50,11 @@
|
||||
#include <vector>
|
||||
# include "directx.inc.hpp"
|
||||
#else // HAVE_DIRECTX
|
||||
#define NO_DIRECTX_SUPPORT_ERROR CV_ErrorNoReturn(cv::Error::StsBadFunc, "OpenCV was build without DirectX support")
|
||||
#define NO_DIRECTX_SUPPORT_ERROR CV_Error(cv::Error::StsBadFunc, "OpenCV was build without DirectX support")
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_OPENCL
|
||||
# define NO_OPENCL_SUPPORT_ERROR CV_ErrorNoReturn(cv::Error::StsBadFunc, "OpenCV was build without OpenCL support")
|
||||
# define NO_OPENCL_SUPPORT_ERROR CV_Error(cv::Error::StsBadFunc, "OpenCV was build without OpenCL support")
|
||||
#endif // HAVE_OPENCL
|
||||
|
||||
namespace cv { namespace directx {
|
||||
|
||||
@ -143,6 +143,9 @@
|
||||
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");
|
||||
|
||||
@ -912,7 +912,6 @@ Mat Mat::reshape(int _cn, int _newndims, const int* _newsz) const
|
||||
|
||||
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
|
||||
|
||||
@ -179,7 +179,6 @@ Mat cvarrToMat(const CvArr* arr, bool copyData,
|
||||
return buf;
|
||||
}
|
||||
CV_Error(CV_StsBadArg, "Unknown array type");
|
||||
return Mat();
|
||||
}
|
||||
|
||||
void extractImageCOI(const CvArr* arr, OutputArray _ch, int coi)
|
||||
|
||||
@ -110,14 +110,12 @@ Mat _InputArray::getMat_(int i) const
|
||||
{
|
||||
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 )
|
||||
@ -130,7 +128,6 @@ Mat _InputArray::getMat_(int i) const
|
||||
}
|
||||
|
||||
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
|
||||
return Mat();
|
||||
}
|
||||
|
||||
UMat _InputArray::getUMat(int i) const
|
||||
@ -354,14 +351,12 @@ cuda::GpuMat _InputArray::getGpuMat() 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
|
||||
{
|
||||
@ -516,7 +511,6 @@ Size _InputArray::size(int i) const
|
||||
}
|
||||
|
||||
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
|
||||
return Size();
|
||||
}
|
||||
|
||||
int _InputArray::sizend(int* arrsz, int i) const
|
||||
@ -716,7 +710,6 @@ int _InputArray::dims(int i) const
|
||||
}
|
||||
|
||||
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t _InputArray::total(int i) const
|
||||
@ -845,7 +838,6 @@ int _InputArray::type(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
|
||||
@ -928,7 +920,6 @@ bool _InputArray::empty() const
|
||||
return ((const cuda::HostMem*)obj)->empty();
|
||||
|
||||
CV_Error(Error::StsNotImplemented, "Unknown/unsupported array type");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _InputArray::isContinuous(int i) const
|
||||
@ -970,7 +961,6 @@ 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
|
||||
@ -1009,7 +999,6 @@ bool _InputArray::isSubmatrix(int i) const
|
||||
}
|
||||
|
||||
CV_Error(CV_StsNotImplemented, "");
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t _InputArray::offset(int i) const
|
||||
@ -1074,7 +1063,6 @@ size_t _InputArray::offset(int i) const
|
||||
}
|
||||
|
||||
CV_Error(Error::StsNotImplemented, "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t _InputArray::step(int i) const
|
||||
@ -1135,7 +1123,6 @@ size_t _InputArray::step(int i) const
|
||||
}
|
||||
|
||||
CV_Error(Error::StsNotImplemented, "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _InputArray::copyTo(const _OutputArray& arr) const
|
||||
@ -1459,7 +1446,6 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
|
||||
if( k == NONE )
|
||||
{
|
||||
CV_Error(CV_StsNullPtr, "create() called for the missing output array" );
|
||||
return;
|
||||
}
|
||||
|
||||
if( k == STD_VECTOR_MAT )
|
||||
|
||||
@ -133,7 +133,7 @@ namespace cv { namespace ocl {
|
||||
int refcount
|
||||
|
||||
#ifndef HAVE_OPENCL
|
||||
#define CV_OPENCL_NO_SUPPORT() CV_ErrorNoReturn(cv::Error::OpenCLApiCallError, "OpenCV build without OpenCL support")
|
||||
#define CV_OPENCL_NO_SUPPORT() CV_Error(cv::Error::OpenCLApiCallError, "OpenCV build without OpenCL support")
|
||||
namespace {
|
||||
struct DummyImpl
|
||||
{
|
||||
@ -2177,7 +2177,7 @@ struct Context::Impl
|
||||
if (!ptr)
|
||||
{
|
||||
CV_OPENCL_SVM_TRACE_ERROR_P("clSVMAlloc returned NULL...\n");
|
||||
CV_ErrorNoReturn(Error::StsBadArg, "clSVMAlloc returned NULL");
|
||||
CV_Error(Error::StsBadArg, "clSVMAlloc returned NULL");
|
||||
}
|
||||
try
|
||||
{
|
||||
@ -2186,7 +2186,7 @@ struct Context::Impl
|
||||
if (CL_SUCCESS != clEnqueueSVMMap(q, CL_TRUE, CL_MAP_WRITE, ptr, 100, 0, NULL, NULL))
|
||||
{
|
||||
CV_OPENCL_SVM_TRACE_ERROR_P("clEnqueueSVMMap failed...\n");
|
||||
CV_ErrorNoReturn(Error::StsBadArg, "clEnqueueSVMMap FAILED");
|
||||
CV_Error(Error::StsBadArg, "clEnqueueSVMMap FAILED");
|
||||
}
|
||||
clFinish(q);
|
||||
try
|
||||
@ -2201,12 +2201,12 @@ struct Context::Impl
|
||||
if (CL_SUCCESS != clEnqueueSVMUnmap(q, ptr, 0, NULL, NULL))
|
||||
{
|
||||
CV_OPENCL_SVM_TRACE_ERROR_P("clEnqueueSVMUnmap failed...\n");
|
||||
CV_ErrorNoReturn(Error::StsBadArg, "clEnqueueSVMUnmap FAILED");
|
||||
CV_Error(Error::StsBadArg, "clEnqueueSVMUnmap FAILED");
|
||||
}
|
||||
clFinish(q);
|
||||
if (error)
|
||||
{
|
||||
CV_ErrorNoReturn(Error::StsBadArg, "OpenCL SVM buffer access test was FAILED");
|
||||
CV_Error(Error::StsBadArg, "OpenCL SVM buffer access test was FAILED");
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
@ -2412,7 +2412,7 @@ void Context::setUseSVM(bool enabled)
|
||||
i->svmInit();
|
||||
if (enabled && !i->svmAvailable)
|
||||
{
|
||||
CV_ErrorNoReturn(Error::StsError, "OpenCL Shared Virtual Memory (SVM) is not supported by OpenCL device");
|
||||
CV_Error(Error::StsError, "OpenCL Shared Virtual Memory (SVM) is not supported by OpenCL device");
|
||||
}
|
||||
i->svmEnabled = enabled;
|
||||
}
|
||||
@ -2483,7 +2483,7 @@ void attachContext(const String& platformName, void* platformID, void* context,
|
||||
CV_OCL_CHECK(clGetPlatformIDs(0, 0, &cnt));
|
||||
|
||||
if (cnt == 0)
|
||||
CV_ErrorNoReturn(cv::Error::OpenCLApiCallError, "no OpenCL platform available!");
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "no OpenCL platform available!");
|
||||
|
||||
std::vector<cl_platform_id> platforms(cnt);
|
||||
|
||||
@ -2505,13 +2505,13 @@ void attachContext(const String& platformName, void* platformID, void* context,
|
||||
}
|
||||
|
||||
if (!platformAvailable)
|
||||
CV_ErrorNoReturn(cv::Error::OpenCLApiCallError, "No matched platforms available!");
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "No matched platforms available!");
|
||||
|
||||
// check if platformID corresponds to platformName
|
||||
String actualPlatformName;
|
||||
get_platform_name((cl_platform_id)platformID, actualPlatformName);
|
||||
if (platformName != actualPlatformName)
|
||||
CV_ErrorNoReturn(cv::Error::OpenCLApiCallError, "No matched platforms available!");
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "No matched platforms available!");
|
||||
|
||||
// do not initialize OpenCL context
|
||||
Context ctx = Context::getDefault(false);
|
||||
@ -3305,7 +3305,7 @@ struct ProgramSource::Impl
|
||||
hash = crc64(sourceAddr_, sourceSize_);
|
||||
break;
|
||||
default:
|
||||
CV_ErrorNoReturn(Error::StsInternal, "Internal error");
|
||||
CV_Error(Error::StsInternal, "Internal error");
|
||||
}
|
||||
sourceHash_ = cv::format("%08llx", hash);
|
||||
isHashUpdated = true;
|
||||
@ -3427,7 +3427,7 @@ const String& ProgramSource::source() const
|
||||
|
||||
ProgramSource::hash_t ProgramSource::hash() const
|
||||
{
|
||||
CV_ErrorNoReturn(Error::StsNotImplemented, "Removed method: ProgramSource::hash()");
|
||||
CV_Error(Error::StsNotImplemented, "Removed method: ProgramSource::hash()");
|
||||
}
|
||||
|
||||
ProgramSource ProgramSource::fromBinary(const String& module, const String& name,
|
||||
@ -3597,11 +3597,11 @@ struct Program::Impl
|
||||
}
|
||||
else if (src_->kind_ == ProgramSource::Impl::PROGRAM_SPIRV)
|
||||
{
|
||||
CV_ErrorNoReturn(Error::StsNotImplemented, "OpenCL: SPIR-V is not supported");
|
||||
CV_Error(Error::StsNotImplemented, "OpenCL: SPIR-V is not supported");
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_ErrorNoReturn(Error::StsInternal, "Internal error");
|
||||
CV_Error(Error::StsInternal, "Internal error");
|
||||
}
|
||||
CV_Assert(handle != NULL);
|
||||
#if OPENCV_HAVE_FILESYSTEM_SUPPORT
|
||||
@ -3948,19 +3948,19 @@ void* Program::ptr() const
|
||||
#ifndef OPENCV_REMOVE_DEPRECATED_API
|
||||
const ProgramSource& Program::source() const
|
||||
{
|
||||
CV_ErrorNoReturn(Error::StsNotImplemented, "Removed API");
|
||||
CV_Error(Error::StsNotImplemented, "Removed API");
|
||||
}
|
||||
|
||||
bool Program::read(const String& bin, const String& buildflags)
|
||||
{
|
||||
CV_UNUSED(bin); CV_UNUSED(buildflags);
|
||||
CV_ErrorNoReturn(Error::StsNotImplemented, "Removed API");
|
||||
CV_Error(Error::StsNotImplemented, "Removed API");
|
||||
}
|
||||
|
||||
bool Program::write(String& bin) const
|
||||
{
|
||||
CV_UNUSED(bin);
|
||||
CV_ErrorNoReturn(Error::StsNotImplemented, "Removed API");
|
||||
CV_Error(Error::StsNotImplemented, "Removed API");
|
||||
}
|
||||
|
||||
String Program::getPrefix() const
|
||||
@ -5627,7 +5627,7 @@ public:
|
||||
}
|
||||
if (id != NULL && strcmp(id, "OCL") != 0)
|
||||
{
|
||||
CV_ErrorNoReturn(cv::Error::StsBadArg, "getBufferPoolController(): unknown BufferPool ID\n");
|
||||
CV_Error(cv::Error::StsBadArg, "getBufferPoolController(): unknown BufferPool ID\n");
|
||||
}
|
||||
return &bufferPool;
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ static void* opencl_check_fn(int ID)
|
||||
#endif
|
||||
else
|
||||
{
|
||||
CV_ErrorNoReturn(cv::Error::StsBadArg, "Invalid function ID");
|
||||
CV_Error(cv::Error::StsBadArg, "Invalid function ID");
|
||||
}
|
||||
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
|
||||
if (!func)
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
# include <cuda_gl_interop.h>
|
||||
# endif
|
||||
#else // HAVE_OPENGL
|
||||
# define NO_OPENGL_SUPPORT_ERROR CV_ErrorNoReturn(cv::Error::StsBadFunc, "OpenCV was build without OpenGL support")
|
||||
# define NO_OPENGL_SUPPORT_ERROR CV_Error(cv::Error::StsBadFunc, "OpenCV was build without OpenGL support")
|
||||
#endif // HAVE_OPENGL
|
||||
|
||||
using namespace cv;
|
||||
@ -1304,10 +1304,15 @@ void cv::ogl::Arrays::release()
|
||||
|
||||
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
|
||||
@ -1563,10 +1568,10 @@ void cv::ogl::render(const ogl::Arrays& arr, InputArray indices, int mode, Scala
|
||||
# ifdef cl_khr_gl_sharing
|
||||
# define HAVE_OPENCL_OPENGL_SHARING
|
||||
# else
|
||||
# define NO_OPENCL_SHARING_ERROR CV_ErrorNoReturn(cv::Error::StsBadFunc, "OpenCV was build without OpenCL/OpenGL sharing support")
|
||||
# define NO_OPENCL_SHARING_ERROR CV_Error(cv::Error::StsBadFunc, "OpenCV was build without OpenCL/OpenGL sharing support")
|
||||
# endif
|
||||
#else // HAVE_OPENCL
|
||||
# define NO_OPENCL_SUPPORT_ERROR CV_ErrorNoReturn(cv::Error::StsBadFunc, "OpenCV was build without OpenCL support")
|
||||
# define NO_OPENCL_SUPPORT_ERROR CV_Error(cv::Error::StsBadFunc, "OpenCV was build without OpenCL support")
|
||||
#endif // HAVE_OPENCL
|
||||
|
||||
#if defined(HAVE_OPENGL)
|
||||
|
||||
@ -239,7 +239,7 @@ namespace
|
||||
#if CV__EXCEPTION_PTR
|
||||
std::rethrow_exception(pException);
|
||||
#else
|
||||
CV_ErrorNoReturn(Error::StsError, "Exception in parallel_for() body: " + exception_message);
|
||||
CV_Error(Error::StsError, "Exception in parallel_for() body: " + exception_message);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ char* icvGets( CvFileStorage* fs, char* str, int maxCount )
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
CV_ErrorNoReturn(CV_StsError, "The storage is not opened");
|
||||
CV_Error(CV_StsError, "The storage is not opened");
|
||||
}
|
||||
|
||||
int icvEof( CvFileStorage* fs )
|
||||
|
||||
@ -76,7 +76,7 @@ static bool param_dumpErrors = utils::getConfigurationParameterBool("OPENCV_DUMP
|
||||
# define CV_ERROR_SET_TERMINATE_HANDLER 1
|
||||
# endif
|
||||
#endif
|
||||
#if CV_ERROR_SET_TERMINATE_HANDLER == 0
|
||||
#if defined(CV_ERROR_SET_TERMINATE_HANDLER) && !CV_ERROR_SET_TERMINATE_HANDLER
|
||||
# undef CV_ERROR_SET_TERMINATE_HANDLER
|
||||
#endif
|
||||
|
||||
@ -532,7 +532,7 @@ struct HWFeatures
|
||||
"******************************************************************\n");
|
||||
fprintf(stderr, "\nRequired baseline features:\n");
|
||||
checkFeatures(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0]), true);
|
||||
CV_ErrorNoReturn(cv::Error::StsAssert, "Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup.");
|
||||
CV_Error(cv::Error::StsAssert, "Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup.");
|
||||
}
|
||||
|
||||
readSettings(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0]));
|
||||
@ -1657,7 +1657,7 @@ bool utils::getConfigurationParameterBool(const char* name, bool defaultValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
CV_ErrorNoReturn(cv::Error::StsBadArg, cv::format("Invalid value for %s parameter: %s", name, value.c_str()));
|
||||
CV_Error(cv::Error::StsBadArg, cv::format("Invalid value for %s parameter: %s", name, value.c_str()));
|
||||
}
|
||||
|
||||
|
||||
@ -1688,7 +1688,7 @@ size_t utils::getConfigurationParameterSizeT(const char* name, size_t defaultVal
|
||||
return v * 1024 * 1024;
|
||||
else if (suffixStr == "KB" || suffixStr == "Kb" || suffixStr == "kb")
|
||||
return v * 1024;
|
||||
CV_ErrorNoReturn(cv::Error::StsBadArg, cv::format("Invalid value for %s parameter: %s", name, value.c_str()));
|
||||
CV_Error(cv::Error::StsBadArg, cv::format("Invalid value for %s parameter: %s", name, value.c_str()));
|
||||
}
|
||||
|
||||
cv::String utils::getConfigurationParameterString(const char* name, const char* defaultValue)
|
||||
|
||||
@ -837,8 +837,6 @@ UMat UMat::reshape(int _cn, int _newndims, const int* _newsz) 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
|
||||
|
||||
@ -265,7 +265,7 @@ struct FileLock::Impl
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_ErrorNoReturn_(Error::StsAssert, ("Can't open lock file: %s", fname));
|
||||
CV_Error_(Error::StsAssert, ("Can't open lock file: %s", fname));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -517,7 +517,7 @@ cv::String getCacheDirectory(const char* sub_directory_name, const char* configu
|
||||
}
|
||||
|
||||
#else
|
||||
#define NOT_IMPLEMENTED CV_ErrorNoReturn(Error::StsNotImplemented, "");
|
||||
#define NOT_IMPLEMENTED CV_Error(Error::StsNotImplemented, "");
|
||||
CV_EXPORTS bool exists(const cv::String& /*path*/) { NOT_IMPLEMENTED }
|
||||
CV_EXPORTS void remove_all(const cv::String& /*path*/) { NOT_IMPLEMENTED }
|
||||
CV_EXPORTS bool createDirectory(const cv::String& /*path*/) { NOT_IMPLEMENTED }
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#ifdef HAVE_VA
|
||||
# include <va/va.h>
|
||||
#else // HAVE_VA
|
||||
# define NO_VA_SUPPORT_ERROR CV_ErrorNoReturn(cv::Error::StsBadFunc, "OpenCV was build without VA support (libva)")
|
||||
# define NO_VA_SUPPORT_ERROR CV_Error(cv::Error::StsBadFunc, "OpenCV was build without VA support (libva)")
|
||||
#endif // HAVE_VA
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -174,7 +174,6 @@ bool Core_EigenTest::check_pair_count(const cv::Mat& src, const cv::Mat& evalues
|
||||
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;
|
||||
}
|
||||
@ -190,7 +189,6 @@ bool Core_EigenTest::check_pair_count(const cv::Mat& src, const cv::Mat& evalues
|
||||
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))
|
||||
@ -199,7 +197,6 @@ bool Core_EigenTest::check_pair_count(const cv::Mat& src, const cv::Mat& evalues
|
||||
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;
|
||||
@ -237,7 +234,6 @@ bool Core_EigenTest::check_orthogonality(const cv::Mat& U)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,7 +253,6 @@ bool Core_EigenTest::check_pairs_order(const cv::Mat& eigen_values)
|
||||
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;
|
||||
@ -272,7 +267,6 @@ bool Core_EigenTest::check_pairs_order(const cv::Mat& eigen_values)
|
||||
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;
|
||||
@ -331,7 +325,6 @@ bool Core_EigenTest::test_pairs(const cv::Mat& src)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -360,7 +353,6 @@ bool Core_EigenTest::test_values(const cv::Mat& src)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -269,17 +269,16 @@ inline int DictValue::size() const
|
||||
{
|
||||
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)
|
||||
|
||||
@ -1941,7 +1941,7 @@ Net::Net() : impl(new Net::Impl)
|
||||
Net Net::readFromModelOptimizer(const String& xml, const String& bin)
|
||||
{
|
||||
#ifndef HAVE_INF_ENGINE
|
||||
CV_ErrorNoReturn(Error::StsError, "Build OpenCV with Inference Engine to enable loading models from Model Optimizer.");
|
||||
CV_Error(Error::StsError, "Build OpenCV with Inference Engine to enable loading models from Model Optimizer.");
|
||||
#else
|
||||
InferenceEngine::CNNNetReader reader;
|
||||
reader.ReadNetwork(xml);
|
||||
@ -2930,7 +2930,7 @@ Net readNet(const String& _model, const String& _config, const String& _framewor
|
||||
std::swap(model, config);
|
||||
return readNetFromModelOptimizer(config, model);
|
||||
}
|
||||
CV_ErrorNoReturn(Error::StsError, "Cannot determine an origin framework of files: " +
|
||||
CV_Error(Error::StsError, "Cannot determine an origin framework of files: " +
|
||||
model + (config.empty() ? "" : ", " + config));
|
||||
}
|
||||
|
||||
|
||||
@ -151,7 +151,7 @@ public:
|
||||
message += " layer parameter does not contain ";
|
||||
message += parameterName;
|
||||
message += " parameter.";
|
||||
CV_ErrorNoReturn(Error::StsBadArg, message);
|
||||
CV_Error(Error::StsBadArg, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -471,12 +471,12 @@ public:
|
||||
{
|
||||
int label = it->first;
|
||||
if (confidenceScores.rows <= label)
|
||||
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find confidence predictions for label %d", label));
|
||||
CV_Error_(cv::Error::StsError, ("Could not find confidence predictions for label %d", label));
|
||||
const std::vector<float>& scores = confidenceScores.row(label);
|
||||
int locLabel = _shareLocation ? -1 : label;
|
||||
LabelBBox::const_iterator label_bboxes = decodeBBoxes.find(locLabel);
|
||||
if (label_bboxes == decodeBBoxes.end())
|
||||
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", locLabel));
|
||||
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", locLabel));
|
||||
const std::vector<int>& indices = it->second;
|
||||
|
||||
for (size_t j = 0; j < indices.size(); ++j, ++count)
|
||||
@ -507,14 +507,14 @@ public:
|
||||
if (c == _backgroundLabelId)
|
||||
continue; // Ignore background class.
|
||||
if (c >= confidenceScores.rows)
|
||||
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find confidence predictions for label %d", c));
|
||||
CV_Error_(cv::Error::StsError, ("Could not find confidence predictions for label %d", c));
|
||||
|
||||
const std::vector<float> scores = confidenceScores.row(c);
|
||||
int label = _shareLocation ? -1 : c;
|
||||
|
||||
LabelBBox::const_iterator label_bboxes = decodeBBoxes.find(label);
|
||||
if (label_bboxes == decodeBBoxes.end())
|
||||
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
|
||||
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
|
||||
if (_bboxesNormalized)
|
||||
NMSFast_(label_bboxes->second, scores, _confidenceThreshold, _nmsThreshold, 1.0, _topK,
|
||||
indices[c], util::caffe_norm_box_overlap);
|
||||
@ -532,7 +532,7 @@ public:
|
||||
int label = it->first;
|
||||
const std::vector<int>& labelIndices = it->second;
|
||||
if (label >= confidenceScores.rows)
|
||||
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
|
||||
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
|
||||
const std::vector<float>& scores = confidenceScores.row(label);
|
||||
for (size_t j = 0; j < labelIndices.size(); ++j)
|
||||
{
|
||||
@ -645,7 +645,7 @@ public:
|
||||
decode_bbox.ymax = decode_bbox_center_y + decode_bbox_height * .5;
|
||||
}
|
||||
else
|
||||
CV_ErrorNoReturn(Error::StsBadArg, "Unknown type.");
|
||||
CV_Error(Error::StsBadArg, "Unknown type.");
|
||||
|
||||
if (clip_bbox)
|
||||
{
|
||||
@ -714,7 +714,7 @@ public:
|
||||
continue; // Ignore background class.
|
||||
LabelBBox::const_iterator label_loc_preds = loc_preds.find(label);
|
||||
if (label_loc_preds == loc_preds.end())
|
||||
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
|
||||
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
|
||||
DecodeBBoxes(prior_bboxes, prior_variances,
|
||||
code_type, variance_encoded_in_target, clip, clip_bounds,
|
||||
normalized_bbox, label_loc_preds->second, decode_bboxes[label]);
|
||||
|
||||
@ -89,7 +89,7 @@ public:
|
||||
if (net.node(i).name() == name)
|
||||
return net.node(i);
|
||||
}
|
||||
CV_ErrorNoReturn(Error::StsParseError, "Input node with name " + name + " not found");
|
||||
CV_Error(Error::StsParseError, "Input node with name " + name + " not found");
|
||||
}
|
||||
|
||||
// Match TensorFlow subgraph starting from <nodeId> with a set of nodes to be fused.
|
||||
|
||||
@ -1360,11 +1360,13 @@ Ptr<DescriptorMatcher> FlannBasedMatcher::clone( bool emptyTrainData ) const
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -530,7 +530,6 @@ static const char* NO_QT_ERR_MSG = "The library is compiled without QT support";
|
||||
cv::QtFont cv::fontQt(const String&, int, Scalar, int, int, int)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
|
||||
return QtFont();
|
||||
}
|
||||
|
||||
void cv::addText( const Mat&, const String&, Point, const QtFont&)
|
||||
@ -556,7 +555,6 @@ void cv::displayOverlay(const String&, const String&, int )
|
||||
int cv::startLoop(int (*)(int argc, char *argv[]), int , char**)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cv::stopLoop()
|
||||
@ -577,7 +575,6 @@ void cv::loadWindowParameters(const String&)
|
||||
int cv::createButton(const String&, ButtonCallback, void*, int , bool )
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, NO_QT_ERR_MSG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -606,17 +603,16 @@ void cv::setWindowTitle(const String&, const String&)
|
||||
}
|
||||
|
||||
#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* )
|
||||
@ -651,7 +647,6 @@ cvCreateTrackbar( const char*, const char*,
|
||||
int*, int, CvTrackbarCallback )
|
||||
{
|
||||
CV_NO_GUI_ERROR( "cvCreateTrackbar" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL int
|
||||
@ -660,7 +655,6 @@ cvCreateTrackbar2( const char* /*trackbar_name*/, const char* /*window_name*/,
|
||||
void* /*userdata*/ )
|
||||
{
|
||||
CV_NO_GUI_ERROR( "cvCreateTrackbar2" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void
|
||||
@ -672,7 +666,6 @@ cvSetMouseCallback( const char*, CvMouseCallback, 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 )
|
||||
@ -693,33 +686,28 @@ CV_IMPL void cvSetTrackbarMin(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 ---------
|
||||
@ -742,7 +730,6 @@ CV_IMPL int cvStartLoop(int (*)(int argc, char *argv[]), int , char* argv[])
|
||||
{
|
||||
(void)argv;
|
||||
CV_NO_GUI_ERROR("cvStartLoop");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvStopLoop()
|
||||
@ -763,7 +750,6 @@ CV_IMPL void cvSaveWindowParameters(const char* )
|
||||
CV_IMPL int cvCreateButton(const char*, void (*)(int, void*), void*, int, int)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvCreateButton");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -490,7 +490,7 @@ decode_rle8_bad: ;
|
||||
result = true;
|
||||
break;
|
||||
default:
|
||||
CV_ErrorNoReturn(cv::Error::StsError, "Invalid/unsupported mode");
|
||||
CV_Error(cv::Error::StsError, "Invalid/unsupported mode");
|
||||
}
|
||||
}
|
||||
CV_CATCH_ALL
|
||||
|
||||
@ -409,7 +409,7 @@ bool GdalDecoder::readData( Mat& img ){
|
||||
color = 3;
|
||||
break;
|
||||
default:
|
||||
CV_ErrorNoReturn(cv::Error::StsError, "Invalid/unsupported mode");
|
||||
CV_Error(cv::Error::StsError, "Invalid/unsupported mode");
|
||||
}
|
||||
|
||||
// make sure the image band has the same dimensions as the image
|
||||
|
||||
@ -77,7 +77,7 @@ static int ReadNumber(RLByteStream& strm, int maxdigits = 0)
|
||||
else
|
||||
{
|
||||
#if 1
|
||||
CV_ErrorNoReturn_(Error::StsError, ("PXM: Unexpected code in ReadNumber(): 0x%x (%d)", code, code));
|
||||
CV_Error_(Error::StsError, ("PXM: Unexpected code in ReadNumber(): 0x%x (%d)", code, code));
|
||||
#else
|
||||
code = strm.getByte();
|
||||
#endif
|
||||
@ -354,7 +354,7 @@ bool PxMDecoder::readData( Mat& img )
|
||||
break;
|
||||
}
|
||||
default:
|
||||
CV_ErrorNoReturn(Error::StsError, "m_bpp is not supported");
|
||||
CV_Error(Error::StsError, "m_bpp is not supported");
|
||||
}
|
||||
}
|
||||
CV_CATCH (cv::Exception, e)
|
||||
|
||||
@ -722,7 +722,7 @@ bool imwrite( const String& filename, InputArray _img,
|
||||
else if (_img.isMatVector() || _img.isUMatVector())
|
||||
_img.getMatVector(img_vec);
|
||||
else
|
||||
CV_ErrorNoReturn(Error::StsBadArg, "Unknown/unsupported input encountered");
|
||||
CV_Error(Error::StsBadArg, "Unknown/unsupported input encountered");
|
||||
|
||||
CV_Assert(!img_vec.empty());
|
||||
return imwrite_(filename, img_vec, params, false);
|
||||
|
||||
@ -99,7 +99,6 @@ static int rgbe_error(int rgbe_error_code, const char *msg)
|
||||
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 */
|
||||
|
||||
@ -126,9 +126,8 @@ static Mat interp1(InputArray _x, InputArray _Y, InputArray _xi)
|
||||
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
|
||||
|
||||
@ -3980,7 +3980,6 @@ namespace cv{
|
||||
}
|
||||
|
||||
CV_Error(CV_StsUnsupportedFormat, "unsupported label/image type");
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
@ -4003,7 +4002,6 @@ int cv::connectedComponents(InputArray img_, OutputArray _labels, int connectivi
|
||||
}
|
||||
else{
|
||||
CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3642,8 +3642,6 @@ cv::Ptr<cv::BaseRowFilter> cv::getLinearRowFilter( int srcType, int bufType,
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and buffer format (=%d)",
|
||||
srcType, bufType));
|
||||
|
||||
return Ptr<BaseRowFilter>();
|
||||
}
|
||||
|
||||
|
||||
@ -3739,8 +3737,6 @@ cv::Ptr<cv::BaseColumnFilter> cv::getLinearColumnFilter( int bufType, int dstTyp
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
("Unsupported combination of buffer format (=%d), and destination format (=%d)",
|
||||
bufType, dstType));
|
||||
|
||||
return Ptr<BaseColumnFilter>();
|
||||
}
|
||||
|
||||
|
||||
@ -4491,8 +4487,6 @@ cv::Ptr<cv::BaseFilter> cv::getLinearFilter(int srcType, int dstType,
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and destination format (=%d)",
|
||||
srcType, dstType));
|
||||
|
||||
return Ptr<BaseFilter>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -888,7 +888,6 @@ cv::Ptr<cv::BaseRowFilter> cv::getMorphologyRowFilter(int op, int type, int ksiz
|
||||
}
|
||||
|
||||
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)
|
||||
@ -935,7 +934,6 @@ cv::Ptr<cv::BaseColumnFilter> cv::getMorphologyColumnFilter(int op, int type, in
|
||||
}
|
||||
|
||||
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
return Ptr<BaseColumnFilter>();
|
||||
}
|
||||
|
||||
|
||||
@ -973,7 +971,6 @@ cv::Ptr<cv::BaseFilter> cv::getMorphologyFilter(int op, int type, InputArray _ke
|
||||
}
|
||||
|
||||
CV_Error_( CV_StsNotImplemented, ("Unsupported data type (=%d)", type));
|
||||
return Ptr<BaseFilter>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -117,9 +117,7 @@ inline bool isStorageOrMat(void * arr)
|
||||
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_*/
|
||||
|
||||
@ -1332,8 +1332,6 @@ cv::Ptr<cv::BaseRowFilter> cv::getRowSumFilter(int srcType, int sumType, int ksi
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and buffer format (=%d)",
|
||||
srcType, sumType));
|
||||
|
||||
return Ptr<BaseRowFilter>();
|
||||
}
|
||||
|
||||
|
||||
@ -1374,8 +1372,6 @@ cv::Ptr<cv::BaseColumnFilter> cv::getColumnSumFilter(int sumType, int dstType, i
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
("Unsupported combination of sum format (=%d), and destination format (=%d)",
|
||||
sumType, dstType));
|
||||
|
||||
return Ptr<BaseColumnFilter>();
|
||||
}
|
||||
|
||||
|
||||
@ -1656,8 +1652,6 @@ static Ptr<BaseRowFilter> getSqrRowSumFilter(int srcType, int sumType, int ksize
|
||||
CV_Error_( CV_StsNotImplemented,
|
||||
("Unsupported combination of source format (=%d), and buffer format (=%d)",
|
||||
srcType, sumType));
|
||||
|
||||
return Ptr<BaseRowFilter>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -613,7 +613,6 @@ static Point2f mapPointSpherical(const Point2f& p, float alpha, Vec4d* J, int pr
|
||||
return Point2f((float)asin(x1), (float)asin(y1));
|
||||
}
|
||||
CV_Error(CV_StsBadArg, "Unknown projection type");
|
||||
return Point2f();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -125,7 +125,6 @@ template <typename T> bool CV_BoundingRectTest::checking_function_work(vector <P
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -58,7 +58,6 @@ int str_to_svm_type(String& str)
|
||||
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 )
|
||||
{
|
||||
@ -71,7 +70,6 @@ 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
|
||||
@ -85,7 +83,6 @@ int str_to_ann_train_method( String& str )
|
||||
if (!str.compare("ANNEAL"))
|
||||
return ANN_MLP::ANNEAL;
|
||||
CV_Error( CV_StsBadArg, "incorrect ann train method string" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -102,7 +99,6 @@ int str_to_ann_activation_function(String& str)
|
||||
if (!str.compare("LEAKYRELU"))
|
||||
return ANN_MLP::LEAKYRELU;
|
||||
CV_Error(CV_StsBadArg, "incorrect ann activation function string");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -374,7 +370,6 @@ int str_to_boost_type( String& str )
|
||||
if ( !str.compare("GENTLE") )
|
||||
return Boost::GENTLE;
|
||||
CV_Error( CV_StsBadArg, "incorrect boost type string" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 8. rtrees
|
||||
@ -387,7 +382,6 @@ int str_to_svmsgd_type( String& str )
|
||||
if ( !str.compare("ASGD") )
|
||||
return SVMSGD::ASGD;
|
||||
CV_Error( CV_StsBadArg, "incorrect svmsgd type string" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
int str_to_margin_type( String& str )
|
||||
@ -397,7 +391,6 @@ 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -54,7 +54,6 @@ Ptr<ExposureCompensator> ExposureCompensator::createDefault(int type)
|
||||
if (type == GAIN_BLOCKS)
|
||||
return makePtr<BlocksGainCompensator>();
|
||||
CV_Error(Error::StsBadArg, "unsupported exposure compensation method");
|
||||
return Ptr<ExposureCompensator>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -836,7 +836,7 @@ std::string findDataFile(const std::string& relative_path, bool required)
|
||||
#endif
|
||||
#endif
|
||||
if (required)
|
||||
CV_ErrorNoReturn(cv::Error::StsError, cv::format("OpenCV tests: Can't find required data file: %s", relative_path.c_str()));
|
||||
CV_Error(cv::Error::StsError, cv::format("OpenCV tests: Can't find required data file: %s", relative_path.c_str()));
|
||||
throw SkipTestException(cv::format("OpenCV tests: Can't find data file: %s", relative_path.c_str()));
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +106,8 @@ protected:
|
||||
bool parseMovi(frame_list& in_frame_list)
|
||||
{
|
||||
//not implemented
|
||||
in_frame_list.empty();
|
||||
CV_UNUSED(in_frame_list);
|
||||
// FIXIT: in_frame_list.empty();
|
||||
return true;
|
||||
}
|
||||
bool parseStrl(char stream_id, Codecs codec_);
|
||||
|
||||
@ -65,7 +65,7 @@ using namespace std;
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#if defined(__GNUC__) && __GNUC__ >= 7
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#endif
|
||||
|
||||
|
||||
@ -158,7 +158,7 @@ inline static bool is_gst_element_exists(const std::string & name)
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
class GStreamerCapture : public IVideoCapture
|
||||
class GStreamerCapture CV_FINAL : public IVideoCapture
|
||||
{
|
||||
private:
|
||||
GstElement* pipeline;
|
||||
@ -184,12 +184,12 @@ private:
|
||||
public:
|
||||
GStreamerCapture();
|
||||
~GStreamerCapture();
|
||||
virtual bool grabFrame();
|
||||
virtual bool retrieveFrame(int /*unused*/, OutputArray dst);
|
||||
virtual double getProperty(int propId) const;
|
||||
virtual bool setProperty(int propId, double value);
|
||||
virtual bool isOpened() const;
|
||||
virtual int getCaptureDomain(); // Return the type of the capture object: CAP_VFW, etc...
|
||||
virtual bool grabFrame() CV_OVERRIDE;
|
||||
virtual bool retrieveFrame(int /*unused*/, OutputArray dst) CV_OVERRIDE;
|
||||
virtual double getProperty(int propId) const CV_OVERRIDE;
|
||||
virtual bool setProperty(int propId, double value) CV_OVERRIDE;
|
||||
virtual bool isOpened() const CV_OVERRIDE;
|
||||
virtual int getCaptureDomain() CV_OVERRIDE; // Return the type of the capture object: CAP_VFW, etc...
|
||||
bool open(int id);
|
||||
bool open(const String &filename_);
|
||||
static void newPad(GstElement * /*elem*/, GstPad *pad, gpointer data);
|
||||
@ -630,7 +630,7 @@ bool GStreamerCapture::open(const String &filename_)
|
||||
const gchar * filename = filename_.c_str();
|
||||
|
||||
bool file = false;
|
||||
bool stream = false;
|
||||
//bool stream = false;
|
||||
bool manualpipeline = false;
|
||||
char *uri = NULL;
|
||||
GstElement* uridecodebin = NULL;
|
||||
@ -655,7 +655,7 @@ bool GStreamerCapture::open(const String &filename_)
|
||||
#else
|
||||
uri = realpath(filename, NULL);
|
||||
#endif
|
||||
stream = false;
|
||||
//stream = false;
|
||||
if(uri)
|
||||
{
|
||||
uri = g_filename_to_uri(uri, NULL, NULL);
|
||||
@ -680,13 +680,13 @@ bool GStreamerCapture::open(const String &filename_)
|
||||
fprintf(stderr, "GStreamer: Error opening bin: %s\n", err->message);
|
||||
return false;
|
||||
}
|
||||
stream = true;
|
||||
//stream = true;
|
||||
manualpipeline = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stream = true;
|
||||
//stream = true;
|
||||
uri = g_strdup(filename);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,6 @@ static bool createEncodeHuffmanTable( const int* src, unsigned* table, int max_s
|
||||
if( size > max_size )
|
||||
{
|
||||
CV_Error(CV_StsOutOfRange, "too big maximum Huffman code size");
|
||||
return false;
|
||||
}
|
||||
|
||||
memset( table, 0, size*sizeof(table[0]));
|
||||
|
||||
@ -83,6 +83,7 @@ struct VideoCaptureAPI
|
||||
case CAP_ARAVIS: return "CAP_ARAVIS";
|
||||
case CAP_OPENCV_MJPEG: return "CAP_OPENCV_MJPEG";
|
||||
case CAP_INTEL_MFX: return "CAP_INTEL_MFX";
|
||||
case CAP_XINE: return "CAP_XINE";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ void postprocess(Mat& frame, const std::vector<Mat>& outs, Net& net)
|
||||
}
|
||||
}
|
||||
std::vector<int> indices;
|
||||
NMSBoxes(boxes, confidences, confThreshold, 0.4, indices);
|
||||
NMSBoxes(boxes, confidences, confThreshold, 0.4f, indices);
|
||||
for (size_t i = 0; i < indices.size(); ++i)
|
||||
{
|
||||
int idx = indices[i];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user