@@ -413,17 +413,17 @@ void TransientAreasSegmentationModuleImpl::run(InputArray inputToProcess, const
413413 // preliminary basic error check
414414 if ( (inputToSegment.rows *inputToSegment.cols ) != (int )_inputToSegment.size ())
415415 {
416- std::stringstream errorMsg;
417- errorMsg<<" Input matrix size does not match instance buffers setup !"
418- <<" \n\t Input size is : " <<inputToSegment.rows *inputToSegment.cols
419- <<" \n\t v.s. internalBuffer size is : " << _inputToSegment.size ();
420- throw cv::Exception (- 1 , errorMsg.str ().c_str (), " SegmentationModule::run " , " SegmentationModule.cpp " , 0 );
416+ std::stringstream errorMsg;
417+ errorMsg<<" Input matrix size does not match instance buffers setup !"
418+ <<" \n\t Input size is : " <<inputToSegment.rows *inputToSegment.cols
419+ <<" \n\t v.s. internalBuffer size is : " << _inputToSegment.size ();
420+ CV_Error ( cv::Error::StsError , errorMsg.str ().c_str ());
421421 }
422422 if (channelIndex >= inputToSegment.channels ())
423423 {
424- std::stringstream errorMsg;
425- errorMsg<<" Cannot access channel index " <<channelIndex<<" on the input matrix with channels quantity = " <<inputToSegment.channels ();
426- throw cv::Exception (- 1 , errorMsg.str ().c_str (), " SegmentationModule::run " , " SegmentationModule.cpp " , 0 );
424+ std::stringstream errorMsg;
425+ errorMsg<<" Cannot access channel index " <<channelIndex<<" on the input matrix with channels quantity = " <<inputToSegment.channels ();
426+ CV_Error ( cv::Error::StsError , errorMsg.str ().c_str ());
427427 }
428428
429429 // create a cv::Mat header for the input valarray
@@ -538,7 +538,7 @@ bool TransientAreasSegmentationModuleImpl::_convertCvMat2ValarrayBuffer(InputArr
538538 const Mat inputMatToConvert=inputMat.getMat ();
539539 // first check input consistency
540540 if (inputMatToConvert.empty ())
541- throw cv::Exception (- 1 , " RetinaImpl cannot be applied, input buffer is empty" , " RetinaImpl::run " , " RetinaImpl.h " , 0 );
541+ CV_Error ( cv::Error::StsError , " RetinaImpl cannot be applied, input buffer is empty" );
542542
543543 // retreive color mode from image input
544544 int imageNumberOfChannels = inputMatToConvert.channels ();
0 commit comments