Commit feec6d7e authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #1893 from tompollok:3.4

parents 20efa8cc fcb266f7
...@@ -292,7 +292,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i ...@@ -292,7 +292,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
*/ */
cv::waitKey(10); cv::waitKey(10);
} }
}catch(cv::Exception e) }catch(const cv::Exception& e)
{ {
std::cerr<<"Error using Retina : "<<e.what()<<std::endl; std::cerr<<"Error using Retina : "<<e.what()<<std::endl;
} }
......
...@@ -353,7 +353,7 @@ static void loadNewFrame(const std::string filenamePrototype, const int currentF ...@@ -353,7 +353,7 @@ static void loadNewFrame(const std::string filenamePrototype, const int currentF
// jump to next frame // jump to next frame
++currentFrameIndex; ++currentFrameIndex;
} }
}catch(cv::Exception e) }catch(const cv::Exception& e)
{ {
std::cerr<<"Error using Retina : "<<e.what()<<std::endl; std::cerr<<"Error using Retina : "<<e.what()<<std::endl;
} }
......
...@@ -146,7 +146,7 @@ int main(int argc, char* argv[]) { ...@@ -146,7 +146,7 @@ int main(int argc, char* argv[]) {
cv::waitKey(5); cv::waitKey(5);
} }
}catch(cv::Exception e) }catch(const cv::Exception& e)
{ {
std::cerr<<"Error using Retina : "<<e.what()<<std::endl; std::cerr<<"Error using Retina : "<<e.what()<<std::endl;
} }
......
...@@ -137,7 +137,7 @@ int main(int argc, char* argv[]) { ...@@ -137,7 +137,7 @@ int main(int argc, char* argv[]) {
cv::imshow("Retina Magno", retinaOutput_magno); cv::imshow("Retina Magno", retinaOutput_magno);
cv::waitKey(10); cv::waitKey(10);
} }
}catch(cv::Exception e) }catch(const cv::Exception& e)
{ {
std::cerr<<"Error using Retina or end of video sequence reached : "<<e.what()<<std::endl; std::cerr<<"Error using Retina or end of video sequence reached : "<<e.what()<<std::endl;
} }
......
...@@ -109,7 +109,7 @@ int main(int argc, char* argv[]) ...@@ -109,7 +109,7 @@ int main(int argc, char* argv[])
} }
printf("Average: %.4fms\n", (double)total_time / total_loop_count / cv::getTickFrequency() * 1000.0); printf("Average: %.4fms\n", (double)total_time / total_loop_count / cv::getTickFrequency() * 1000.0);
} }
catch(cv::Exception e) catch(const cv::Exception& e)
{ {
std::cerr << "Error using Retina : " << e.what() << std::endl; std::cerr << "Error using Retina : " << e.what() << std::endl;
} }
......
...@@ -368,7 +368,7 @@ void RetinaImpl::setup(String retinaParameterFile, const bool applyDefaultSetupO ...@@ -368,7 +368,7 @@ void RetinaImpl::setup(String retinaParameterFile, const bool applyDefaultSetupO
cv::FileStorage fs(retinaParameterFile, cv::FileStorage::READ); cv::FileStorage fs(retinaParameterFile, cv::FileStorage::READ);
setup(fs, applyDefaultSetupOnFailure); setup(fs, applyDefaultSetupOnFailure);
} }
catch(Exception &e) catch(const Exception &e)
{ {
printf("Retina::setup: wrong/unappropriate xml parameter file : error report :`n=>%s\n", e.what()); printf("Retina::setup: wrong/unappropriate xml parameter file : error report :`n=>%s\n", e.what());
if (applyDefaultSetupOnFailure) if (applyDefaultSetupOnFailure)
...@@ -422,7 +422,7 @@ void RetinaImpl::setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailur ...@@ -422,7 +422,7 @@ void RetinaImpl::setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailur
setupIPLMagnoChannel(_retinaParameters.IplMagno.normaliseOutput, _retinaParameters.IplMagno.parasolCells_beta, _retinaParameters.IplMagno.parasolCells_tau, _retinaParameters.IplMagno.parasolCells_k, _retinaParameters.IplMagno.amacrinCellsTemporalCutFrequency,_retinaParameters.IplMagno.V0CompressionParameter, _retinaParameters.IplMagno.localAdaptintegration_tau, _retinaParameters.IplMagno.localAdaptintegration_k); setupIPLMagnoChannel(_retinaParameters.IplMagno.normaliseOutput, _retinaParameters.IplMagno.parasolCells_beta, _retinaParameters.IplMagno.parasolCells_tau, _retinaParameters.IplMagno.parasolCells_k, _retinaParameters.IplMagno.amacrinCellsTemporalCutFrequency,_retinaParameters.IplMagno.V0CompressionParameter, _retinaParameters.IplMagno.localAdaptintegration_tau, _retinaParameters.IplMagno.localAdaptintegration_k);
} }
catch(Exception &e) catch(const Exception &e)
{ {
printf("RetinaImpl::setup: resetting retina with default parameters\n"); printf("RetinaImpl::setup: resetting retina with default parameters\n");
if (applyDefaultSetupOnFailure) if (applyDefaultSetupOnFailure)
......
...@@ -127,7 +127,7 @@ void RetinaOCLImpl::setup(String retinaParameterFile, const bool applyDefaultSet ...@@ -127,7 +127,7 @@ void RetinaOCLImpl::setup(String retinaParameterFile, const bool applyDefaultSet
cv::FileStorage fs(retinaParameterFile, cv::FileStorage::READ); cv::FileStorage fs(retinaParameterFile, cv::FileStorage::READ);
setup(fs, applyDefaultSetupOnFailure); setup(fs, applyDefaultSetupOnFailure);
} }
catch(Exception &e) catch(const Exception &e)
{ {
std::cout << "RetinaOCLImpl::setup: wrong/inappropriate xml parameter file : error report :`n=>" << e.what() << std::endl; std::cout << "RetinaOCLImpl::setup: wrong/inappropriate xml parameter file : error report :`n=>" << e.what() << std::endl;
if (applyDefaultSetupOnFailure) if (applyDefaultSetupOnFailure)
...@@ -181,7 +181,7 @@ void RetinaOCLImpl::setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFai ...@@ -181,7 +181,7 @@ void RetinaOCLImpl::setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFai
setupIPLMagnoChannel(_retinaParameters.IplMagno.normaliseOutput, _retinaParameters.IplMagno.parasolCells_beta, _retinaParameters.IplMagno.parasolCells_tau, _retinaParameters.IplMagno.parasolCells_k, _retinaParameters.IplMagno.amacrinCellsTemporalCutFrequency, _retinaParameters.IplMagno.V0CompressionParameter, _retinaParameters.IplMagno.localAdaptintegration_tau, _retinaParameters.IplMagno.localAdaptintegration_k); setupIPLMagnoChannel(_retinaParameters.IplMagno.normaliseOutput, _retinaParameters.IplMagno.parasolCells_beta, _retinaParameters.IplMagno.parasolCells_tau, _retinaParameters.IplMagno.parasolCells_k, _retinaParameters.IplMagno.amacrinCellsTemporalCutFrequency, _retinaParameters.IplMagno.V0CompressionParameter, _retinaParameters.IplMagno.localAdaptintegration_tau, _retinaParameters.IplMagno.localAdaptintegration_k);
} }
catch(Exception &e) catch(const Exception &e)
{ {
std::cout << "RetinaOCLImpl::setup: resetting retina with default parameters" << std::endl; std::cout << "RetinaOCLImpl::setup: resetting retina with default parameters" << std::endl;
if (applyDefaultSetupOnFailure) if (applyDefaultSetupOnFailure)
......
...@@ -298,7 +298,7 @@ void TransientAreasSegmentationModuleImpl::setup(String segmentationParameterFil ...@@ -298,7 +298,7 @@ void TransientAreasSegmentationModuleImpl::setup(String segmentationParameterFil
// opening retinaParameterFile in read mode // opening retinaParameterFile in read mode
cv::FileStorage fs(segmentationParameterFile, cv::FileStorage::READ); cv::FileStorage fs(segmentationParameterFile, cv::FileStorage::READ);
setup(fs, applyDefaultSetupOnFailure); setup(fs, applyDefaultSetupOnFailure);
}catch(cv::Exception &e) }catch(const cv::Exception &e)
{ {
printf("Retina::setup: wrong/unappropriate xml parameter file : error report :`n=>%s\n", e.what()); printf("Retina::setup: wrong/unappropriate xml parameter file : error report :`n=>%s\n", e.what());
if (applyDefaultSetupOnFailure) if (applyDefaultSetupOnFailure)
...@@ -338,7 +338,7 @@ void TransientAreasSegmentationModuleImpl::setup(cv::FileStorage &fs, const bool ...@@ -338,7 +338,7 @@ void TransientAreasSegmentationModuleImpl::setup(cv::FileStorage &fs, const bool
currFn["contextEnergy_spatialConstant"]>>_segmentationParameters.contextEnergy_spatialConstant; currFn["contextEnergy_spatialConstant"]>>_segmentationParameters.contextEnergy_spatialConstant;
setup(_segmentationParameters); setup(_segmentationParameters);
}catch(cv::Exception &e) }catch(const cv::Exception &e)
{ {
std::cout<<"Retina::setup: resetting retina with default parameters"<<std::endl; std::cout<<"Retina::setup: resetting retina with default parameters"<<std::endl;
if (applyDefaultSetupOnFailure) if (applyDefaultSetupOnFailure)
......
...@@ -93,7 +93,7 @@ int main(int argc, const char *argv[]) { ...@@ -93,7 +93,7 @@ int main(int argc, const char *argv[]) {
// input filename is given. // input filename is given.
try { try {
read_csv(fn_csv, images, labels, labelsInfo); read_csv(fn_csv, images, labels, labelsInfo);
} catch (cv::Exception& e) { } catch (const cv::Exception& e) {
cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl; cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl;
// nothing more we can do // nothing more we can do
exit(1); exit(1);
......
...@@ -85,7 +85,7 @@ int main(int argc, const char *argv[]) { ...@@ -85,7 +85,7 @@ int main(int argc, const char *argv[]) {
// input filename is given. // input filename is given.
try { try {
read_csv(fn_csv, images, labels); read_csv(fn_csv, images, labels);
} catch (cv::Exception& e) { } catch (const cv::Exception& e) {
cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl; cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl;
// nothing more we can do // nothing more we can do
exit(1); exit(1);
......
...@@ -85,7 +85,7 @@ int main(int argc, const char *argv[]) { ...@@ -85,7 +85,7 @@ int main(int argc, const char *argv[]) {
// input filename is given. // input filename is given.
try { try {
read_csv(fn_csv, images, labels); read_csv(fn_csv, images, labels);
} catch (cv::Exception& e) { } catch (const cv::Exception& e) {
cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl; cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl;
// nothing more we can do // nothing more we can do
exit(1); exit(1);
......
...@@ -62,7 +62,7 @@ int main(int argc, const char *argv[]) { ...@@ -62,7 +62,7 @@ int main(int argc, const char *argv[]) {
// input filename is given. // input filename is given.
try { try {
read_csv(fn_csv, images, labels); read_csv(fn_csv, images, labels);
} catch (cv::Exception& e) { } catch (const cv::Exception& e) {
cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl; cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl;
// nothing more we can do // nothing more we can do
exit(1); exit(1);
......
...@@ -85,7 +85,7 @@ int main(int argc, const char *argv[]) { ...@@ -85,7 +85,7 @@ int main(int argc, const char *argv[]) {
// input filename is given. // input filename is given.
try { try {
read_csv(fn_csv, images, labels); read_csv(fn_csv, images, labels);
} catch (cv::Exception& e) { } catch (const cv::Exception& e) {
cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl; cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl;
// nothing more we can do // nothing more we can do
exit(1); exit(1);
......
...@@ -68,7 +68,7 @@ int main(int argc, const char *argv[]) { ...@@ -68,7 +68,7 @@ int main(int argc, const char *argv[]) {
// Read in the data (fails if no valid input filename is given, but you'll get an error message): // Read in the data (fails if no valid input filename is given, but you'll get an error message):
try { try {
read_csv(fn_csv, images, labels); read_csv(fn_csv, images, labels);
} catch (cv::Exception& e) { } catch (const cv::Exception& e) {
cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl; cerr << "Error opening file \"" << fn_csv << "\". Reason: " << e.msg << endl;
// nothing more we can do // nothing more we can do
exit(1); exit(1);
......
...@@ -85,9 +85,9 @@ addVariant("{{ fun.name }}", {{ fun.req|inputs|length }}, {{ fun.opt|inputs|leng ...@@ -85,9 +85,9 @@ addVariant("{{ fun.name }}", {{ fun.req|inputs|length }}, {{ fun.opt|inputs|leng
// [out =] namespace.fun(src1, ..., srcn, dst1, ..., dstn, opt1, ..., optn); // [out =] namespace.fun(src1, ..., srcn, dst1, ..., dstn, opt1, ..., optn);
try { try {
{{ compose(fun) }} {{ compose(fun) }}
} catch(cv::Exception& e) { } catch(const cv::Exception& e) {
error(std::string("cv::exception caught: ").append(e.what()).c_str()); error(std::string("cv::exception caught: ").append(e.what()).c_str());
} catch(std::exception& e) { } catch(const std::exception& e) {
error(std::string("std::exception caught: ").append(e.what()).c_str()); error(std::string("std::exception caught: ").append(e.what()).c_str());
} catch(...) { } catch(...) {
error("Uncaught exception occurred in {{fun.name}}"); error("Uncaught exception occurred in {{fun.name}}");
......
...@@ -25,7 +25,7 @@ void mexFunction(int nlhs, mxArray* plhs[], ...@@ -25,7 +25,7 @@ void mexFunction(int nlhs, mxArray* plhs[],
// [out =] namespace.fun(src1, ..., srcn, dst1, ..., dstn, opt1, ..., optn); // [out =] namespace.fun(src1, ..., srcn, dst1, ..., dstn, opt1, ..., optn);
try { try {
throw cv::Exception(-1, "OpenCV exception thrown", __func__, __FILE__, __LINE__); throw cv::Exception(-1, "OpenCV exception thrown", __func__, __FILE__, __LINE__);
} catch(cv::Exception& e) { } catch(const cv::Exception& e) {
mexErrMsgTxt(e.what()); mexErrMsgTxt(e.what());
} catch(...) { } catch(...) {
mexErrMsgTxt("Incorrect exception caught!"); mexErrMsgTxt("Incorrect exception caught!");
......
...@@ -24,7 +24,7 @@ void mexFunction(int nlhs, mxArray* plhs[], ...@@ -24,7 +24,7 @@ void mexFunction(int nlhs, mxArray* plhs[],
// [out =] namespace.fun(src1, ..., srcn, dst1, ..., dstn, opt1, ..., optn); // [out =] namespace.fun(src1, ..., srcn, dst1, ..., dstn, opt1, ..., optn);
try { try {
throw std::exception(); throw std::exception();
} catch(std::exception& e) { } catch(const std::exception& e) {
mexErrMsgTxt(e.what()); mexErrMsgTxt(e.what());
} catch(...) { } catch(...) {
mexErrMsgTxt("Incorrect exception caught!"); mexErrMsgTxt("Incorrect exception caught!");
......
...@@ -149,7 +149,7 @@ static SceneNode& _getSceneNode(SceneManager* sceneMgr, const String& name) ...@@ -149,7 +149,7 @@ static SceneNode& _getSceneNode(SceneManager* sceneMgr, const String& name)
if(mo) if(mo)
return *mo->getParentSceneNode()->getParentSceneNode(); return *mo->getParentSceneNode()->getParentSceneNode();
} }
catch (ItemIdentityException&) catch (const ItemIdentityException&)
{ {
// ignore // ignore
} }
...@@ -159,7 +159,7 @@ static SceneNode& _getSceneNode(SceneManager* sceneMgr, const String& name) ...@@ -159,7 +159,7 @@ static SceneNode& _getSceneNode(SceneManager* sceneMgr, const String& name)
if (!mo) if (!mo)
mo = sceneMgr->getMovableObject(name, "Light"); mo = sceneMgr->getMovableObject(name, "Light");
} }
catch (ItemIdentityException&) catch (const ItemIdentityException&)
{ {
// ignore // ignore
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment