mirror of
https://github.com/opencv/opencv.git
synced 2025-06-06 00:43:52 +08:00
refactoring catching all exceptions as const ref
This commit is contained in:
parent
b74b05d1b3
commit
2da56d5af6
@ -149,7 +149,7 @@ void CommandLineParser::getByName(const String& name, bool space_delete, int typ
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception& e)
|
||||
catch (const Exception& e)
|
||||
{
|
||||
impl->error = true;
|
||||
impl->error_message = impl->error_message + "Parameter '"+ name + "': " + e.err + "\n";
|
||||
@ -182,7 +182,7 @@ void CommandLineParser::getByIndex(int index, bool space_delete, int type, void*
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception& e)
|
||||
catch (const Exception& e)
|
||||
{
|
||||
impl->error = true;
|
||||
impl->error_message = impl->error_message + format("Parameter #%d: ", index) + e.err + "\n";
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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 );
|
||||
|
@ -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 (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -401,11 +401,11 @@ static bool openvx_FAST(InputArray _img, std::vector<KeyPoint>& keypoints,
|
||||
img.swapHandle();
|
||||
#endif
|
||||
}
|
||||
catch (RuntimeError & e)
|
||||
catch (const RuntimeError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
catch (WrapperError & e)
|
||||
catch (const WrapperError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
|
@ -291,11 +291,11 @@ static bool openvx_accumulate(InputArray _src, InputOutputArray _dst, InputArray
|
||||
srcImage.swapHandle(); dstImage.swapHandle();
|
||||
#endif
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
@ -1559,11 +1559,11 @@ namespace cv
|
||||
ivx::IVX_CHECK_STATUS(vxuBox3x3(ctx, ia, ib));
|
||||
ctx.setImmediateBorder(prevBorder);
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
@ -246,11 +246,11 @@ namespace cv
|
||||
ivx::IVX_CHECK_STATUS(vxuSobel3x3(ctx, ia, NULL, ib));
|
||||
ctx.setImmediateBorder(prevBorder);
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
@ -342,11 +342,11 @@ static bool openvx_harris(Mat image, OutputArray _corners,
|
||||
ovxImage.swapHandle();
|
||||
#endif
|
||||
}
|
||||
catch (RuntimeError & e)
|
||||
catch (const RuntimeError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
catch (WrapperError & e)
|
||||
catch (const WrapperError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
|
@ -793,11 +793,11 @@ namespace cv
|
||||
img.swapHandle();
|
||||
#endif
|
||||
}
|
||||
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());
|
||||
}
|
||||
@ -3313,11 +3313,11 @@ static bool openvx_equalize_hist(Mat srcMat, Mat dstMat)
|
||||
srcImage.swapHandle(); dstImage.swapHandle();
|
||||
#endif
|
||||
}
|
||||
catch (RuntimeError & e)
|
||||
catch (const RuntimeError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
catch (WrapperError & e)
|
||||
catch (const WrapperError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
|
@ -1598,12 +1598,12 @@ static bool openvx_remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation
|
||||
|
||||
ctx.setImmediateBorder(prevBorder);
|
||||
}
|
||||
catch (ivx::RuntimeError & e)
|
||||
catch (const ivx::RuntimeError & e)
|
||||
{
|
||||
CV_Error(CV_StsInternal, e.what());
|
||||
return false;
|
||||
}
|
||||
catch (ivx::WrapperError & e)
|
||||
catch (const ivx::WrapperError & e)
|
||||
{
|
||||
CV_Error(CV_StsInternal, e.what());
|
||||
return false;
|
||||
|
@ -1068,11 +1068,11 @@ static bool openvx_medianFilter(InputArray _src, OutputArray _dst, int ksize)
|
||||
#endif
|
||||
ctx.setImmediateBorder(prevBorder);
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
@ -861,11 +861,11 @@ static bool openvx_pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz,
|
||||
srcImg.swapHandle(); dstImg.swapHandle();
|
||||
#endif
|
||||
}
|
||||
catch (RuntimeError & e)
|
||||
catch (const RuntimeError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
catch (WrapperError & e)
|
||||
catch (const WrapperError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
|
@ -2305,11 +2305,11 @@ static bool openvx_gaussianBlur(InputArray _src, OutputArray _dst, Size ksize,
|
||||
ivx::IVX_CHECK_STATUS(vxuGaussian3x3(ctx, ia, ib));
|
||||
ctx.setImmediateBorder(prevBorder);
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
@ -1374,11 +1374,11 @@ static bool openvx_threshold(Mat src, Mat dst, int thresh, int maxval, int type)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
@ -287,9 +287,9 @@ bool cv::DetectionBasedTracker::SeparateDetectionWork::run()
|
||||
try { \
|
||||
_block; \
|
||||
} \
|
||||
catch(cv::Exception& e) { \
|
||||
catch(const cv::Exception& e) { \
|
||||
LOGE0("\n %s: ERROR: OpenCV Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
|
||||
} catch(std::exception& e) { \
|
||||
} catch(const std::exception& e) { \
|
||||
LOGE0("\n %s: ERROR: Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
|
||||
} catch(...) { \
|
||||
LOGE0("\n %s: ERROR: UNKNOWN Exception caught\n\n", CV_Func); \
|
||||
|
@ -36,7 +36,7 @@ extern int testThreads;
|
||||
Body(); \
|
||||
CV__TEST_CLEANUP \
|
||||
} \
|
||||
catch (cvtest::SkipTestException& e) \
|
||||
catch (const cvtest::SkipTestException& e) \
|
||||
{ \
|
||||
printf("[ SKIP ] %s\n", e.what()); \
|
||||
} \
|
||||
@ -84,7 +84,7 @@ extern int testThreads;
|
||||
Body(); \
|
||||
CV__TEST_CLEANUP \
|
||||
} \
|
||||
catch (cvtest::SkipTestException& e) \
|
||||
catch (const cvtest::SkipTestException& e) \
|
||||
{ \
|
||||
printf("[ SKIP ] %s\n", e.what()); \
|
||||
} \
|
||||
|
@ -232,7 +232,7 @@ void Regression::init(const std::string& testSuitName, const std::string& ext)
|
||||
storageOutPath += ext;
|
||||
}
|
||||
}
|
||||
catch(cv::Exception&)
|
||||
catch(const cv::Exception&)
|
||||
{
|
||||
LOGE("Failed to open sanity data for reading: %s", storageInPath.c_str());
|
||||
}
|
||||
@ -1987,22 +1987,22 @@ void TestBase::RunPerfTestBody()
|
||||
implConf.GetImpl();
|
||||
#endif
|
||||
}
|
||||
catch(SkipTestException&)
|
||||
catch(const SkipTestException&)
|
||||
{
|
||||
metrics.terminationReason = performance_metrics::TERM_SKIP_TEST;
|
||||
return;
|
||||
}
|
||||
catch(PerfSkipTestException&)
|
||||
catch(const PerfSkipTestException&)
|
||||
{
|
||||
metrics.terminationReason = performance_metrics::TERM_SKIP_TEST;
|
||||
return;
|
||||
}
|
||||
catch(PerfEarlyExitException&)
|
||||
catch(const PerfEarlyExitException&)
|
||||
{
|
||||
metrics.terminationReason = performance_metrics::TERM_INTERRUPT;
|
||||
return;//no additional failure logging
|
||||
}
|
||||
catch(cv::Exception& e)
|
||||
catch(const cv::Exception& e)
|
||||
{
|
||||
metrics.terminationReason = performance_metrics::TERM_EXCEPTION;
|
||||
#ifdef HAVE_CUDA
|
||||
@ -2011,7 +2011,7 @@ void TestBase::RunPerfTestBody()
|
||||
#endif
|
||||
FAIL() << "Expected: PerfTestBody() doesn't throw an exception.\n Actual: it throws cv::Exception:\n " << e.what();
|
||||
}
|
||||
catch(std::exception& e)
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
metrics.terminationReason = performance_metrics::TERM_EXCEPTION;
|
||||
FAIL() << "Expected: PerfTestBody() doesn't throw an exception.\n Actual: it throws std::exception:\n " << e.what();
|
||||
|
@ -1191,11 +1191,11 @@ namespace
|
||||
prevImg.swapHandle(); nextImg.swapHandle();
|
||||
#endif
|
||||
}
|
||||
catch (RuntimeError & e)
|
||||
catch (const RuntimeError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
catch (WrapperError & e)
|
||||
catch (const WrapperError & e)
|
||||
{
|
||||
VX_DbgThrow(e.what());
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ bool CvCaptureCAM_CMU::open( int _index )
|
||||
CMU_numActiveCameras++;
|
||||
CMU_useCameraFlags[_index] = true;
|
||||
}
|
||||
catch ( int )
|
||||
catch (const int &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
return gp_result_as_string(result);
|
||||
}
|
||||
friend std::ostream & operator<<(std::ostream & ostream,
|
||||
GPhoto2Exception & e)
|
||||
const GPhoto2Exception & e)
|
||||
{
|
||||
return ostream << e.method << ": " << e.what();
|
||||
}
|
||||
@ -336,7 +336,7 @@ void DigitalCameraCapture::initContext()
|
||||
CR(gp_camera_autodetect(allDevices, context));
|
||||
CR(numDevices = gp_list_count(allDevices));
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
numDevices = 0;
|
||||
}
|
||||
@ -389,7 +389,7 @@ DigitalCameraCapture::~DigitalCameraCapture()
|
||||
gp_context_unref(context);
|
||||
context = NULL;
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
message(ERROR, "destruction error", e);
|
||||
}
|
||||
@ -442,7 +442,7 @@ bool DigitalCameraCapture::open(int index)
|
||||
opened = true;
|
||||
return true;
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
message(WARNING, "opening device failed", e);
|
||||
return false;
|
||||
@ -491,7 +491,7 @@ void DigitalCameraCapture::close()
|
||||
rootWidget = NULL;
|
||||
}
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
message(ERROR, "cannot close device properly", e);
|
||||
}
|
||||
@ -664,7 +664,7 @@ double DigitalCameraCapture::getProperty(int propertyId) const
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
char buf[128] = "";
|
||||
sprintf(buf, "cannot get property: %d", propertyId);
|
||||
@ -807,7 +807,7 @@ bool DigitalCameraCapture::setProperty(int propertyId, double value)
|
||||
CR(gp_widget_set_changed(widget, 0));
|
||||
}
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
char buf[128] = "";
|
||||
sprintf(buf, "cannot set property: %d to %f", propertyId, value);
|
||||
@ -849,7 +849,7 @@ bool DigitalCameraCapture::grabFrame()
|
||||
capturedFrames++;
|
||||
grabbedFrames.push_back(file);
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
if (file)
|
||||
gp_file_unref(file);
|
||||
@ -873,7 +873,7 @@ bool DigitalCameraCapture::retrieveFrame(int, OutputArray outputFrame)
|
||||
readFrameFromFile(file, outputFrame);
|
||||
CR(gp_file_unref(file));
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
message(WARNING, "cannot read file grabbed from device", e);
|
||||
return false;
|
||||
@ -914,7 +914,7 @@ int DigitalCameraCapture::findDevice(const char * deviceName) const
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
; // pass
|
||||
}
|
||||
@ -980,7 +980,7 @@ CameraWidget * DigitalCameraCapture::findWidgetByName(
|
||||
}
|
||||
return (it != end) ? it->second : NULL;
|
||||
}
|
||||
catch (GPhoto2Exception & e)
|
||||
catch (const GPhoto2Exception & e)
|
||||
{
|
||||
message(WARNING, "error while searching for widget", e);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker
|
||||
//trackingDetector->setMinObjectSize(Size(faceSize, faceSize));
|
||||
}
|
||||
}
|
||||
catch(cv::Exception& e)
|
||||
catch(const cv::Exception& e)
|
||||
{
|
||||
LOGD("nativeCreateObject caught cv::Exception: %s", e.what());
|
||||
jclass je = jenv->FindClass("org/opencv/core/CvException");
|
||||
@ -121,7 +121,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
|
||||
delete (DetectorAgregator*)thiz;
|
||||
}
|
||||
}
|
||||
catch(cv::Exception& e)
|
||||
catch(const cv::Exception& e)
|
||||
{
|
||||
LOGD("nativeestroyObject caught cv::Exception: %s", e.what());
|
||||
jclass je = jenv->FindClass("org/opencv/core/CvException");
|
||||
@ -147,7 +147,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
|
||||
{
|
||||
((DetectorAgregator*)thiz)->tracker->run();
|
||||
}
|
||||
catch(cv::Exception& e)
|
||||
catch(const cv::Exception& e)
|
||||
{
|
||||
LOGD("nativeStart caught cv::Exception: %s", e.what());
|
||||
jclass je = jenv->FindClass("org/opencv/core/CvException");
|
||||
@ -173,7 +173,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
|
||||
{
|
||||
((DetectorAgregator*)thiz)->tracker->stop();
|
||||
}
|
||||
catch(cv::Exception& e)
|
||||
catch(const cv::Exception& e)
|
||||
{
|
||||
LOGD("nativeStop caught cv::Exception: %s", e.what());
|
||||
jclass je = jenv->FindClass("org/opencv/core/CvException");
|
||||
@ -203,7 +203,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
|
||||
//((DetectorAgregator*)thiz)->trackingDetector->setMinObjectSize(Size(faceSize, faceSize));
|
||||
}
|
||||
}
|
||||
catch(cv::Exception& e)
|
||||
catch(const cv::Exception& e)
|
||||
{
|
||||
LOGD("nativeStop caught cv::Exception: %s", e.what());
|
||||
jclass je = jenv->FindClass("org/opencv/core/CvException");
|
||||
@ -233,7 +233,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
|
||||
((DetectorAgregator*)thiz)->tracker->getObjects(RectFaces);
|
||||
*((Mat*)faces) = Mat(RectFaces, true);
|
||||
}
|
||||
catch(cv::Exception& e)
|
||||
catch(const cv::Exception& e)
|
||||
{
|
||||
LOGD("nativeCreateObject caught cv::Exception: %s", e.what());
|
||||
jclass je = jenv->FindClass("org/opencv/core/CvException");
|
||||
|
@ -63,11 +63,11 @@ void dumpCLinfo()
|
||||
i, name.c_str(), (type==CL_DEVICE_TYPE_GPU ? "GPU" : "CPU"), extensions.c_str() );
|
||||
}
|
||||
}
|
||||
catch(cl::Error& e)
|
||||
catch(const cl::Error& e)
|
||||
{
|
||||
LOGE( "OpenCL info: error while gathering OpenCL info: %s (%d)", e.what(), e.err() );
|
||||
}
|
||||
catch(std::exception& e)
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
LOGE( "OpenCL info: error while gathering OpenCL info: %s", e.what() );
|
||||
}
|
||||
@ -130,11 +130,11 @@ extern "C" void initCL()
|
||||
LOGE("Can't init OpenCV with OpenCL TAPI");
|
||||
haveOpenCL = true;
|
||||
}
|
||||
catch(cl::Error& e)
|
||||
catch(const cl::Error& e)
|
||||
{
|
||||
LOGE("cl::Error: %s (%d)", e.what(), e.err());
|
||||
}
|
||||
catch(std::exception& e)
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
LOGE("std::exception: %s", e.what());
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ int main(int argc, char *argv[])
|
||||
imshow("Original", img);
|
||||
waitKey();
|
||||
}
|
||||
catch (Exception& e)
|
||||
catch (const Exception& e)
|
||||
{
|
||||
cout << "Feature : " << *itDesc << "\n";
|
||||
cout << e.msg << endl;
|
||||
|
@ -523,7 +523,7 @@ int main(int argc, char *argv[])
|
||||
imshow(winName, result);
|
||||
imshow("Original", img);
|
||||
}
|
||||
catch (Exception& e)
|
||||
catch (const Exception& e)
|
||||
{
|
||||
cout << "Feature: " << *itDesc << "\n";
|
||||
cout << e.msg << endl;
|
||||
|
@ -175,7 +175,7 @@ int showImageQRCodeDetect(string in, string out)
|
||||
{
|
||||
imwrite(out, color_src, compression_params);
|
||||
}
|
||||
catch (cv::Exception& ex)
|
||||
catch (const cv::Exception& ex)
|
||||
{
|
||||
cout << "Exception converting image to PNG format: ";
|
||||
cout << ex.what() << '\n';
|
||||
|
@ -147,15 +147,15 @@ int main(int argc, char *argv[])
|
||||
desMethCmp.push_back(cumSumDist2);
|
||||
waitKey();
|
||||
}
|
||||
catch (Exception& e)
|
||||
{
|
||||
catch (const Exception& e)
|
||||
{
|
||||
cout << e.msg << endl;
|
||||
cout << "Cumulative distance cannot be computed." << endl;
|
||||
desMethCmp.push_back(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception& e)
|
||||
catch (const Exception& e)
|
||||
{
|
||||
cout << "Feature : " << *itDesc << "\n";
|
||||
if (itMatcher != typeAlgoMatch.end())
|
||||
|
@ -141,7 +141,7 @@ int main(int argc, char** argv)
|
||||
// Read in the data. This can fail if not valid
|
||||
try {
|
||||
read_imgList(imgList, images);
|
||||
} catch (cv::Exception& e) {
|
||||
} catch (const cv::Exception& e) {
|
||||
cerr << "Error opening file \"" << imgList << "\". Reason: " << e.msg << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ public:
|
||||
}
|
||||
} // try
|
||||
|
||||
catch (cv::Exception& e)
|
||||
catch (const cv::Exception& e)
|
||||
{
|
||||
std::cerr << "Exception: " << e.what() << std::endl;
|
||||
return 10;
|
||||
|
@ -378,7 +378,7 @@ public:
|
||||
}
|
||||
} // try
|
||||
|
||||
catch (cv::Exception& e)
|
||||
catch (const cv::Exception& e)
|
||||
{
|
||||
std::cerr << "Exception: " << e.what() << std::endl;
|
||||
cleanup();
|
||||
|
@ -225,7 +225,7 @@ public:
|
||||
}
|
||||
} // try
|
||||
|
||||
catch (cv::Exception& e)
|
||||
catch (const cv::Exception& e)
|
||||
{
|
||||
std::cerr << "Exception: " << e.what() << std::endl;
|
||||
return 10;
|
||||
|
@ -226,7 +226,7 @@ public:
|
||||
|
||||
} // try
|
||||
|
||||
catch (cv::Exception& e)
|
||||
catch (const cv::Exception& e)
|
||||
{
|
||||
std::cerr << "Exception: " << e.what() << std::endl;
|
||||
return 10;
|
||||
|
@ -158,7 +158,7 @@ int d3d_app(int argc, char** argv, std::string& title)
|
||||
return app.run();
|
||||
}
|
||||
|
||||
catch (cv::Exception& e)
|
||||
catch (const cv::Exception& e)
|
||||
{
|
||||
std::cerr << "Exception: " << e.what() << std::endl;
|
||||
return 10;
|
||||
|
@ -676,7 +676,7 @@ int App::initVideoSource()
|
||||
throw std::runtime_error(std::string("specify video source"));
|
||||
}
|
||||
|
||||
catch (std::exception e)
|
||||
catch (const std::exception e)
|
||||
{
|
||||
cerr << "ERROR: " << e.what() << std::endl;
|
||||
return -1;
|
||||
|
@ -325,7 +325,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
catch (cv::Exception& e)
|
||||
catch (const cv::Exception& e)
|
||||
{
|
||||
std::cerr << "Exception: " << e.what() << std::endl;
|
||||
return 10;
|
||||
@ -520,7 +520,7 @@ int main(int argc, char** argv)
|
||||
app.create();
|
||||
return app.run();
|
||||
}
|
||||
catch (cv::Exception& e)
|
||||
catch (const cv::Exception& e)
|
||||
{
|
||||
cerr << "Exception: " << e.what() << endl;
|
||||
return 10;
|
||||
|
@ -256,7 +256,7 @@ int main(int argc, char** argv)
|
||||
|
||||
std::cout << "Interop " << (doInterop ? "ON " : "OFF") << ": processing time, msec: " << time << std::endl;
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
std::cerr << "ERROR: " << ex.what() << std::endl;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user