endif()
endfunction()
-if(UNIX AND NOT ANDROID)
+if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID)
ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "")
endif()
cv::Ptr<CvMemStorage> storage;
- try
+ CV_TRY
{
int k = 0;
const int min_dilations = 0;
cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 15, 0.1));
}
}
- catch(...)
+ CV_CATCH_ALL
{
cvFree(&quads);
cvFree(&corners);
- throw;
+ CV_RETHROW();
}
cvFree(&quads);
cvFree(&corners);
void* oldCbkData;
ErrorCallback oldCbk = redirectError(quiet_error, 0, &oldCbkData);
#endif
- try
+ CV_TRY
{
isFound = boxFinder.findHoles();
}
- catch (const cv::Exception &)
+ CV_CATCH(Exception, e)
{
-
+ CV_UNUSED(e);
}
#if BE_QUIET
redirectError(oldCbk, oldCbkData);
#define CV_SUPPRESS_DEPRECATED_START
#define CV_SUPPRESS_DEPRECATED_END
#endif
+
#define CV_UNUSED(name) (void)name
+
+#if defined __GNUC__ && !defined __EXCEPTIONS
+#define CV_TRY
+#define CV_CATCH(A, B) for (A B; false; )
+#define CV_CATCH_ALL if (false)
+#define CV_THROW(A) abort()
+#define CV_RETHROW() abort()
+#else
+#define CV_TRY try
+#define CV_CATCH(A, B) catch(const A & B)
+#define CV_CATCH_ALL catch(...)
+#define CV_THROW(A) throw A
+#define CV_RETHROW() throw
+#endif
+
//! @endcond
/*! @brief Signals an error and raises the exception.
#if !defined _MSC_VER && !defined __BORLANDC__
# if defined __cplusplus && __cplusplus >= 201103L && !defined __APPLE__
# include <cstdint>
- typedef std::uint32_t uint;
+# ifdef __NEWLIB__
+ typedef unsigned int uint;
+# else
+ typedef std::uint32_t uint;
+# endif
# else
# include <stdint.h>
typedef uint32_t uint;
explicit softfloat( const uint64_t );
explicit softfloat( const int32_t );
explicit softfloat( const int64_t );
+
+#ifdef CV_INT32_T_IS_LONG_INT
+ // for platforms with int32_t = long int
+ explicit softfloat( const int a ) { *this = softfloat(static_cast<int32_t>(a)); }
+#endif
+
/** @brief Construct from float */
explicit softfloat( const float a ) { Cv32suf s; s.f = a; v = s.u; }
explicit softdouble( const uint64_t );
explicit softdouble( const int32_t );
explicit softdouble( const int64_t );
+
+#ifdef CV_INT32_T_IS_LONG_INT
+ // for platforms with int32_t = long int
+ explicit softdouble( const int a ) { *this = softdouble(static_cast<int32_t>(a)); }
+#endif
+
/** @brief Construct from double */
explicit softdouble( const double a ) { Cv64suf s; s.f = a; v = s.u; }
void CommandLineParser::getByName(const String& name, bool space_delete, int type, void* dst) const
{
- try
+ CV_TRY
{
for (size_t i = 0; i < impl->data.size(); i++)
{
}
}
}
- catch (Exception& e)
+ CV_CATCH (Exception, e)
{
impl->error = true;
impl->error_message = impl->error_message + "Parameter '"+ name + "': " + e.err + "\n";
return;
}
-
CV_Error_(Error::StsBadArg, ("undeclared key '%s' requested", name.c_str()));
}
void CommandLineParser::getByIndex(int index, bool space_delete, int type, void* dst) const
{
- try
+ CV_TRY
{
for (size_t i = 0; i < impl->data.size(); i++)
{
}
}
}
- catch(Exception& e)
+ CV_CATCH(Exception, e)
{
impl->error = true;
impl->error_message = impl->error_message + format("Parameter #%d: ", index) + e.err + "\n";
return;
}
-
CV_Error_(Error::StsBadArg, ("undeclared position %d requested", index));
}
std::vector<String> vec;
String word = "";
bool begin = false;
-
while (!str.empty())
{
if (str[0] == fs)
{
if (begin == true)
{
- throw cv::Exception(CV_StsParseError,
+ CV_THROW (cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
- );
+ ));
}
begin = true;
word = "";
{
if (begin == false)
{
- throw cv::Exception(CV_StsParseError,
+ CV_THROW (cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
- );
+ ));
}
begin = false;
vec.push_back(word);
if (begin == true)
{
- throw cv::Exception(CV_StsParseError,
+ CV_THROW (cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
- );
+ ));
}
-
return vec;
}
if ((dir = opendir (directory.c_str())) != 0)
{
/* find all the files and directories within directory */
- try
+ CV_TRY
{
struct dirent *ent;
while ((ent = readdir (dir)) != 0)
result.push_back(entry);
}
}
- catch (...)
+ CV_CATCH_ALL
{
closedir(dir);
- throw;
+ CV_RETHROW();
}
closedir(dir);
}
d = alloc_1d<double> (n);
e = alloc_1d<double> (n);
ort = alloc_1d<double> (n);
- try {
+ CV_TRY {
// Reduce to Hessenberg form.
orthes();
// Reduce Hessenberg to real Schur form.
// Deallocate the memory by releasing all internal working data.
release();
}
- catch (...)
+ CV_CATCH_ALL
{
release();
- throw;
+ CV_RETHROW();
}
}
#endif
if(!a)
a = a0;
- try
+ CV_TRY
{
u = a->allocate(dims, size, _type, 0, step.p, 0, USAGE_DEFAULT);
CV_Assert(u != 0);
}
- catch(...)
+ CV_CATCH_ALL
{
if(a != a0)
u = a0->allocate(dims, size, _type, 0, step.p, 0, USAGE_DEFAULT);
}
*this = m;
- try
+ CV_TRY
{
if( _rowRange != Range::all() && _rowRange != Range(0,rows) )
{
flags |= SUBMATRIX_FLAG;
}
}
- catch(...)
+ CV_CATCH_ALL
{
release();
- throw;
+ CV_RETHROW();
}
if( rows == 1 )
CoreTLSData* data = getCoreTlsData().get();
if( data->useOpenCL < 0 )
{
- try
+ CV_TRY
{
data->useOpenCL = (int)(haveOpenCL() && Device::getDefault().ptr() && Device::getDefault().available()) ? 1 : 0;
}
- catch (...)
+ CV_CATCH_ALL
{
data->useOpenCL = 0;
}
//mode = cvGetErrMode();
//cvSetErrMode( CV_ErrModeSilent );
- try
+ CV_TRY
{
switch (fs->fmt)
{
default: break;
}
}
- catch (...)
+ CV_CATCH_ALL
{
fs->is_opened = true;
cvReleaseFileStorage( &fs );
- throw;
+ CV_RETHROW();
}
//cvSetErrMode( mode );
flags |= CV_SEQ_FLAG_HOLE;
if( !strstr(flags_str, "untyped") )
{
- try
+ CV_TRY
{
flags |= icvDecodeSimpleFormat(dt);
}
- catch(...)
+ CV_CATCH_ALL
{
}
}
*p = 0;
}
- throw exc;
+ CV_THROW(exc);
}
void error(int _code, const String& _err, const char* _func, const char* _file, int _line)
new_u = a->allocate(dims, size.p, type(), data, step.p, accessFlags, usageFlags);
}
bool allocated = false;
- try
+ CV_TRY
{
allocated = UMat::getStdAllocator()->allocate(new_u, accessFlags, usageFlags);
}
- catch (const cv::Exception& e)
+ CV_CATCH(cv::Exception, e)
{
fprintf(stderr, "Exception: %s\n", e.what());
}
a = a0;
a0 = Mat::getDefaultAllocator();
}
- try
+ CV_TRY
{
u = a->allocate(dims, size, _type, 0, step.p, 0, usageFlags);
CV_Assert(u != 0);
}
- catch(...)
+ CV_CATCH_ALL
{
if(a != a0)
u = a0->allocate(dims, size, _type, 0, step.p, 0, usageFlags);
{
if( m_block_pos == 0 && m_current < m_end )
return;
- throw RBS_THROW_EOS;
+ CV_THROW (RBS_THROW_EOS);
}
fseek( m_file, m_block_pos, SEEK_SET );
m_current = m_start;
if( readed == 0 || m_current >= m_end )
- throw RBS_THROW_EOS;
+ CV_THROW (RBS_THROW_EOS);
}
//M*/
#include "exif.hpp"
+#include "opencv2/core/cvdef.h"
+#include "opencv2/core/base.hpp"
namespace {
*/
bool ExifReader::parse()
{
- try {
+ CV_TRY {
m_exif = getExif();
if( !m_exif.empty() )
{
return true;
}
return false;
- } catch (ExifParsingError&) {
+ } CV_CATCH (ExifParsingError, e) {
+ CV_UNUSED(e);
return false;
}
}
case COM:
bytesToSkip = getFieldSize();
if (bytesToSkip < markerSize) {
- throw ExifParsingError();
+ CV_THROW (ExifParsingError());
}
m_stream.seekg( static_cast<long>( bytesToSkip - markerSize ), m_stream.cur );
if ( m_stream.fail() ) {
- throw ExifParsingError();
+ CV_THROW (ExifParsingError());
}
break;
case APP1: //actual Exif Marker
exifSize = getFieldSize();
if (exifSize <= offsetToTiffHeader) {
- throw ExifParsingError();
+ CV_THROW (ExifParsingError());
}
m_data.resize( exifSize - offsetToTiffHeader );
m_stream.seekg( static_cast<long>( offsetToTiffHeader ), m_stream.cur );
if ( m_stream.fail() ) {
- throw ExifParsingError();
+ CV_THROW (ExifParsingError());
}
m_stream.read( reinterpret_cast<char*>(&m_data[0]), exifSize - offsetToTiffHeader );
count = m_stream.gcount();
dataOffset = getU32( offset + 8 );
}
if (dataOffset > m_data.size() || dataOffset + size > m_data.size()) {
- throw ExifParsingError();
+ CV_THROW (ExifParsingError());
}
std::vector<uint8_t>::const_iterator it = m_data.begin() + dataOffset;
std::string result( it, it + size ); //copy vector content into result
uint16_t ExifReader::getU16(const size_t offset) const
{
if (offset + 1 >= m_data.size())
- throw ExifParsingError();
+ CV_THROW (ExifParsingError());
if( m_format == INTEL )
{
uint32_t ExifReader::getU32(const size_t offset) const
{
if (offset + 3 >= m_data.size())
- throw ExifParsingError();
+ CV_THROW (ExifParsingError());
if( m_format == INTEL )
{
else if( !m_strm.open( m_filename ))
return false;
- try
+ CV_TRY
{
m_strm.skip( 10 );
m_offset = m_strm.getDWord();
}
}
}
- catch(...)
+ CV_CATCH_ALL
{
- throw;
+ CV_RETHROW();
}
// in 32 bit case alpha channel is used - so require CV_8UC4 type
m_type = iscolor ? (m_bpp == 32 ? CV_8UC4 : CV_8UC3 ) : CV_8UC1;
}
uchar *src = _src, *bgr = _bgr;
- try
+ CV_TRY
{
m_strm.setPos( m_offset );
CV_ErrorNoReturn(cv::Error::StsError, "Invalid/unsupported mode");
}
}
- catch(...)
+ CV_CATCH_ALL
{
- throw;
+ CV_RETHROW();
}
return result;
}
else if( !m_strm.open( m_filename ))
return false;
- try
+ CV_TRY
{
byte = m_strm.getByte();
if( byte != 'P' )
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
byte = m_strm.getByte();
if (byte != '7')
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
byte = m_strm.getByte();
if (byte != '\n' && byte != '\r')
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
uint i;
memset (&flds, 0x00, sizeof (struct parsed_fields));
do {
if (!ReadPAMHeaderLine(m_strm, fieldtype, value))
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
switch (fieldtype) {
case PAM_HEADER_NONE:
case PAM_HEADER_COMMENT:
break;
case PAM_HEADER_HEIGHT:
if (flds.height)
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
if (!ParseNumber (value, &m_height))
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
flds.height = true;
break;
case PAM_HEADER_WIDTH:
if (flds.width)
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
if (!ParseNumber (value, &m_width))
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
flds.width = true;
break;
case PAM_HEADER_DEPTH:
if (flds.depth)
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
if (!ParseNumber (value, &m_channels))
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
flds.depth = true;
break;
case PAM_HEADER_MAXVAL:
if (flds.maxval)
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
if (!ParseNumber (value, &m_maxval))
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
if ( m_maxval > 65535 )
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
if ( m_maxval > 255 ) {
m_sampledepth = CV_16U;
}
}
break;
default:
- throw RBS_BAD_HEADER;
+ CV_THROW( RBS_BAD_HEADER );
}
} while (fieldtype != PAM_HEADER_ENDHDR);
return true;
}
- } catch(...)
+ } CV_CATCH_ALL
{
}
layout.graychan = 0;
}
- try
+ CV_TRY
{
m_strm.setPos( m_offset );
}
res = true;
- } catch(...)
+ } CV_CATCH_ALL
{
}
else if( !m_strm.open( m_filename ))
return false;
- try
+ CV_TRY
{
int code = m_strm.getByte();
if( code != 'P' )
- throw RBS_BAD_HEADER;
+ CV_THROW (RBS_BAD_HEADER);
code = m_strm.getByte();
switch( code )
case '1': case '4': m_bpp = 1; break;
case '2': case '5': m_bpp = 8; break;
case '3': case '6': m_bpp = 24; break;
- default: throw RBS_BAD_HEADER;
+ default: CV_THROW (RBS_BAD_HEADER);
}
m_binary = code >= '4';
m_maxval = m_bpp == 1 ? 1 : ReadNumber(m_strm);
if( m_maxval > 65535 )
- throw RBS_BAD_HEADER;
+ CV_THROW (RBS_BAD_HEADER);
//if( m_maxval > 255 ) m_binary = false; nonsense
if( m_maxval > 255 )
result = true;
}
}
- catch (const cv::Exception&)
+ CV_CATCH (cv::Exception, e)
{
- throw;
+ CV_UNUSED(e);
+ CV_RETHROW();
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "PXM::readHeader(): unknown C++ exception" << std::endl << std::flush;
- throw;
+ CV_RETHROW();
}
if( !result )
FillGrayPalette( palette, m_bpp==1 ? 1 : 8 , m_bpp == 1 );
}
- try
+ CV_TRY
{
m_strm.setPos( m_offset );
CV_ErrorNoReturn(Error::StsError, "m_bpp is not supported");
}
}
- catch (const cv::Exception&)
+ CV_CATCH (cv::Exception, e)
{
- throw;
+ CV_UNUSED(e);
+ CV_RETHROW();
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "PXM::readData(): unknown exception" << std::endl << std::flush;
- throw;
+ CV_RETHROW();
}
return result;
if( !m_strm.open( m_filename )) return false;
- try
+ CV_TRY
{
m_strm.skip( 4 );
m_width = m_strm.getDWord();
}
}
}
- catch(...)
+ CV_CATCH_ALL
{
}
if( !color && m_maptype == RMT_EQUAL_RGB )
CvtPaletteToGray( m_palette, gray_palette, 1 << m_bpp );
- try
+ CV_TRY
{
m_strm.setPos( m_offset );
assert(0);
}
}
- catch( ... )
+ CV_CATCH_ALL
{
}
/// set the filename in the driver
decoder->setSource( filename );
- try
+ CV_TRY
{
// read the header to make sure it succeeds
if( !decoder->readHeader() )
return 0;
}
- catch (const cv::Exception& e)
+ CV_CATCH (cv::Exception, e)
{
std::cerr << "imread_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
return 0;
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "imread_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
return 0;
// read the image data
bool success = false;
- try
+ CV_TRY
{
if (decoder->readData(*data))
success = true;
}
- catch (const cv::Exception& e)
+ CV_CATCH (cv::Exception, e)
{
std::cerr << "imread_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "imread_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
}
decoder->setSource(filename);
// read the header to make sure it succeeds
- try
+ CV_TRY
{
// read the header to make sure it succeeds
if( !decoder->readHeader() )
return 0;
}
- catch (const cv::Exception& e)
+ CV_CATCH (cv::Exception, e)
{
std::cerr << "imreadmulti_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
return 0;
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "imreadmulti_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
return 0;
// read the image data
Mat mat(size.height, size.width, type);
bool success = false;
- try
+ CV_TRY
{
if (decoder->readData(mat))
success = true;
}
- catch (const cv::Exception& e)
+ CV_CATCH (cv::Exception, e)
{
std::cerr << "imreadmulti_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "imreadmulti_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
}
}
bool success = false;
- try
+ CV_TRY
{
if (decoder->readHeader())
success = true;
}
- catch (const cv::Exception& e)
+ CV_CATCH (cv::Exception, e)
{
std::cerr << "imdecode_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "imdecode_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
}
}
success = false;
- try
+ CV_TRY
{
if (decoder->readData(*data))
success = true;
}
- catch (const cv::Exception& e)
+ CV_CATCH (cv::Exception, e)
{
std::cerr << "imdecode_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
}
- catch (...)
+ CV_CATCH_ALL
{
std::cerr << "imdecode_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
}
c = CV_DESCALE(c, trilinear_shift*3);
}
+#if CV_SIMD128
// 8 inValues are in [0; LAB_BASE]
static inline void trilinearPackedInterpolate(const v_uint16x8& inX, const v_uint16x8& inY, const v_uint16x8& inZ,
#undef DOT_SHIFT_PACK
}
+#endif // CV_SIMD128
+
struct RGB2Lab_b
{
i = 0;
if(useInterpolation)
{
+
+#if CV_SIMD128
if(enablePackedLab)
{
static const int nPixels = 4*2;
v_store_interleave(dst + i + 3*4, l_vec1, a_vec1, b_vec1);
}
}
+#endif // CV_SIMD128
for(; i < n; i += 3, src += scn)
{
float alpha = ColorChannel<float>::max();
int i = 0;
+
+#if CV_SIMD128
if(enablePackedLab)
{
v_float32x4 vldiv = v_setall_f32(256.f/100.0f);
}
}
}
+#endif
for(; i < n*3; i += 3, dst += dcn)
{
uchar alpha = ColorChannel<uchar>::max();
i = 0;
+#if CV_SIMD128
if(enablePackedLab)
{
static const int nPixels = 8*2;
}
}
}
+#endif
for (; i < n*3; i += 3, dst += dcn)
{
int i, scn = srccn, bIdx = blueIdx;
i = 0; n *= 3;
+
+#if CV_SIMD128
if(enablePackedRGB2Luv)
{
static const int nPixels = 8*2;
v_store_interleave(dst + i, l16, u16, v16);
}
}
+#endif // CV_SIMD128
for(; i < n; i += 3, src += scn)
{
uchar alpha = ColorChannel<uchar>::max();
i = 0;
+#if CV_SIMD128
if(enablePackedLuv2RGB)
{
static const int nPixels = 16;
}
}
}
+#endif
for (; i < n*3; i += 3, dst += dcn)
{
}
else
{
- try
+ CV_TRY
{
scanner = cvStartFindContours_Impl( img, storage, cntHeaderSize, mode, method, offset,
needFillBorder);
}
while( contour != 0 );
}
- catch(...)
+ CV_CATCH_ALL
{
if( scanner )
cvEndFindContours(&scanner);
- throw;
+ CV_RETHROW();
}
*firstContour = cvEndFindContours( &scanner );
}
#define CATCH_ALL_AND_LOG(_block) \
- try { \
+ CV_TRY { \
_block; \
} \
- catch(cv::Exception& e) { \
+ CV_CATCH(cv::Exception, e) { \
LOGE0("\n %s: ERROR: OpenCV Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
- } catch(std::exception& e) { \
+ } CV_CATCH(std::exception, e) { \
LOGE0("\n %s: ERROR: Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
- } catch(...) { \
+ } CV_CATCH_ALL { \
LOGE0("\n %s: ERROR: UNKNOWN Exception caught\n\n", CV_Func); \
}
void* cv::workcycleObjectDetectorFunction(void* p)
{
CATCH_ALL_AND_LOG({ ((cv::DetectionBasedTracker::SeparateDetectionWork*)p)->workcycleObjectDetector(); });
- try{
+ CV_TRY{
((cv::DetectionBasedTracker::SeparateDetectionWork*)p)->init();
- } catch(...) {
+ } CV_CATCH_ALL {
LOGE0("DetectionBasedTracker: workcycleObjectDetectorFunction: ERROR concerning pointer, received as the function parameter");
}
return NULL;
String eerr("file not exist");
String efile(__FILE__);
String efunc(__FUNCTION__);
- throw Exception(Error::StsError, eerr, efile, efunc, __LINE__);
+ CV_THROW (Exception(Error::StsError, eerr, efile, efunc, __LINE__));
}
char version_buffer[10];
if (!fread (&version_buffer,sizeof(char),10,modelfl))
String efunc(__FUNCTION__);
fclose(modelfl);
- throw Exception(Error::StsError, eerr, efile, efunc, __LINE__);
+ CV_THROW (Exception(Error::StsError, eerr, efile, efunc, __LINE__));
}
if(strcmp(version_buffer,"V6.01")) {
String eerr("version doesnot match");
String efunc(__FUNCTION__);
fclose(modelfl);
- throw Exception(Error::StsError, eerr, efile, efunc, __LINE__);
+ CV_THROW (Exception(Error::StsError, eerr, efile, efunc, __LINE__));
}
/* read version number */
int version = 0;
if (!fread (&version,sizeof(int),1,modelfl))
{
fclose(modelfl);
- throw Exception();
+ CV_THROW (Exception());
}
if (version < 200)
{
String efile(__FILE__);
String efunc(__FUNCTION__);
fclose(modelfl);
- throw Exception();
+ CV_THROW (Exception());
}
int kernel_type;
size_t nread;
if(nread != static_cast<size_t>(length) + 1) {
delete [] linearwt;
fclose(modelfl);
- throw Exception();
+ CV_THROW (Exception());
}
for(int i = 0; i < length; i++)
delete [] linearwt;
} else {
fclose(modelfl);
- throw Exception();
+ CV_THROW (Exception());
}
fclose(modelfl);
}
#define TRY_OPEN(capture, backend_func) \
{ \
if (!capture) \
- try { \
+ CV_TRY { \
if (get_capture_debug_flag()) fprintf(stderr, "VIDEOIO(%s): trying ...\n", #backend_func); \
capture = backend_func; \
if (get_capture_debug_flag()) fprintf(stderr, "VIDEOIO(%s): result=%p ...\n", #backend_func, capture); \
- } catch (const cv::Exception& e) { \
+ } CV_CATCH (cv::Exception, e) { \
fprintf(stderr, "VIDEOIO(%s): raised OpenCV exception:\n\n%s\n", #backend_func, e.what()); \
- } catch (const std::exception& e) { \
+ } CV_CATCH (std::exception, e) { \
fprintf(stderr, "VIDEOIO(%s): raised C++ exception:\n\n%s\n", #backend_func, e.what()); \
- } catch (...) { \
+ } CV_CATCH_ALL { \
fprintf(stderr, "VIDEOIO(%s): raised unknown C++ exception!\n\n", #backend_func); \
} \
}