1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #12878 from tompollok:3.4

This commit is contained in:
Alexander Alekhin
2018-11-09 19:54:16 +00:00
54 changed files with 202 additions and 201 deletions
+14 -10
View File
@@ -124,7 +124,7 @@ static void from_str(const String& str, int type, void* dst)
void CommandLineParser::getByName(const String& name, bool space_delete, int type, void* dst) const
{
CV_TRY
try
{
for (size_t i = 0; i < impl->data.size(); i++)
{
@@ -149,19 +149,20 @@ void CommandLineParser::getByName(const String& name, bool space_delete, int typ
}
}
}
CV_CATCH (Exception, e)
catch (const 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
{
CV_TRY
try
{
for (size_t i = 0; i < impl->data.size(); i++)
{
@@ -181,12 +182,13 @@ void CommandLineParser::getByIndex(int index, bool space_delete, int type, void*
}
}
}
CV_CATCH(Exception, e)
catch (const 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));
}
@@ -460,13 +462,14 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
std::vector<String> vec;
String word = "";
bool begin = false;
while (!str.empty())
{
if (str[0] == fs)
{
if (begin == true)
{
CV_THROW (cv::Exception(CV_StsParseError,
throw cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -475,7 +478,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
));
);
}
begin = true;
word = "";
@@ -486,7 +489,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
{
if (begin == false)
{
CV_THROW (cv::Exception(CV_StsParseError,
throw cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -495,7 +498,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
));
);
}
begin = false;
vec.push_back(word);
@@ -510,7 +513,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
if (begin == true)
{
CV_THROW (cv::Exception(CV_StsParseError,
throw cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -519,8 +522,9 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
));
);
}
return vec;
}
+3 -3
View File
@@ -231,7 +231,7 @@ static void glob_rec(const cv::String& directory, const cv::String& wildchart, s
if ((dir = opendir (directory.c_str())) != 0)
{
/* find all the files and directories within directory */
CV_TRY
try
{
struct dirent *ent;
while ((ent = readdir (dir)) != 0)
@@ -255,10 +255,10 @@ static void glob_rec(const cv::String& directory, const cv::String& wildchart, s
result.push_back(entry);
}
}
CV_CATCH_ALL
catch (...)
{
closedir(dir);
CV_RETHROW();
throw;
}
closedir(dir);
}
+3 -3
View File
@@ -866,7 +866,7 @@ private:
d = alloc_1d<double> (n);
e = alloc_1d<double> (n);
ort = alloc_1d<double> (n);
CV_TRY {
try {
// Reduce to Hessenberg form.
orthes();
// Reduce Hessenberg to real Schur form.
@@ -884,10 +884,10 @@ private:
// Deallocate the memory by releasing all internal working data.
release();
}
CV_CATCH_ALL
catch (...)
{
release();
CV_RETHROW();
throw;
}
}
+2 -2
View File
@@ -120,11 +120,11 @@ static bool openvx_LUT(Mat src, Mat dst, Mat _lut)
lut.copyFrom(_lut);
ivx::IVX_CHECK_STATUS(vxuTableLookup(ctx, ia, lut, ib));
}
catch (ivx::RuntimeError & e)
catch (const ivx::RuntimeError& e)
{
VX_DbgThrow(e.what());
}
catch (ivx::WrapperError & e)
catch (const ivx::WrapperError& e)
{
VX_DbgThrow(e.what());
}
+3 -3
View File
@@ -416,7 +416,7 @@ Mat::Mat(const Mat& m, const Range& _rowRange, const Range& _colRange)
}
*this = m;
CV_TRY
try
{
if( _rowRange != Range::all() && _rowRange != Range(0,rows) )
{
@@ -436,10 +436,10 @@ Mat::Mat(const Mat& m, const Range& _rowRange, const Range& _colRange)
flags |= SUBMATRIX_FLAG;
}
}
CV_CATCH_ALL
catch(...)
{
release();
CV_RETHROW();
throw;
}
updateContinuityFlag();
+2 -2
View File
@@ -648,11 +648,11 @@ static bool ocl_meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv
pstddev[c] = 0;
}
}
catch (ivx::RuntimeError & e)
catch (const ivx::RuntimeError & e)
{
VX_DbgThrow(e.what());
}
catch (ivx::WrapperError & e)
catch (const ivx::WrapperError & e)
{
VX_DbgThrow(e.what());
}
+2 -2
View File
@@ -433,11 +433,11 @@ static bool openvx_minMaxIdx(Mat &src, double* minVal, double* maxVal, int* minI
ofs2idx(src, maxidx, maxIdx);
}
}
catch (ivx::RuntimeError & e)
catch (const ivx::RuntimeError & e)
{
VX_DbgThrow(e.what());
}
catch (ivx::WrapperError & e)
catch (const ivx::WrapperError & e)
{
VX_DbgThrow(e.what());
}
+2 -2
View File
@@ -894,11 +894,11 @@ bool useOpenCL()
CoreTLSData* data = getCoreTlsData().get();
if( data->useOpenCL < 0 )
{
CV_TRY
try
{
data->useOpenCL = (int)(haveOpenCL() && Device::getDefault().ptr() && Device::getDefault().available()) ? 1 : 0;
}
CV_CATCH_ALL
catch (...)
{
data->useOpenCL = 0;
}
+2 -2
View File
@@ -417,7 +417,7 @@ cvOpenFileStorage( const char* query, CvMemStorage* dststorage, int flags, const
//mode = cvGetErrMode();
//cvSetErrMode( CV_ErrModeSilent );
CV_TRY
try
{
switch (fs->fmt)
{
@@ -427,7 +427,7 @@ cvOpenFileStorage( const char* query, CvMemStorage* dststorage, int flags, const
default: break;
}
}
CV_CATCH_ALL
catch (...)
{
fs->is_opened = true;
cvReleaseFileStorage( &fs );
+2 -2
View File
@@ -756,11 +756,11 @@ static void* icvReadSeq( CvFileStorage* fs, CvFileNode* node )
flags |= CV_SEQ_FLAG_HOLE;
if( !strstr(flags_str, "untyped") )
{
CV_TRY
try
{
flags |= icvDecodeSimpleFormat(dt);
}
CV_CATCH_ALL
catch (...)
{
}
}
+1 -1
View File
@@ -1025,7 +1025,7 @@ void error( const Exception& exc )
*p = 0;
}
CV_THROW(exc);
throw exc;
}
void error(int _code, const String& _err, const char* _func, const char* _file, int _line)
+4 -4
View File
@@ -367,11 +367,11 @@ UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
new_u->originalUMatData = u;
}
bool allocated = false;
CV_TRY
try
{
allocated = UMat::getStdAllocator()->allocate(new_u, accessFlags, usageFlags);
}
CV_CATCH(cv::Exception, e)
catch (const cv::Exception& e)
{
fprintf(stderr, "Exception: %s\n", e.what());
}
@@ -442,12 +442,12 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
a = a0;
a0 = Mat::getDefaultAllocator();
}
CV_TRY
try
{
u = a->allocate(dims, size, _type, 0, step.p, 0, usageFlags);
CV_Assert(u != 0);
}
CV_CATCH_ALL
catch(...)
{
if(a != a0)
u = a0->allocate(dims, size, _type, 0, step.p, 0, usageFlags);