diff --git a/modules/contrib/include/opencv2/contrib/retina.hpp b/modules/contrib/include/opencv2/contrib/retina.hpp index e6e8232d5..770114a28 100644 --- a/modules/contrib/include/opencv2/contrib/retina.hpp +++ b/modules/contrib/include/opencv2/contrib/retina.hpp @@ -174,6 +174,16 @@ public: */ void setup(std::string retinaParameterFile="", const bool applyDefaultSetupOnFailure=true); + + /** + * try to open an XML retina parameters file to adjust current retina instance setup + * => if the xml file does not exist, then default setup is applied + * => warning, Exceptions are thrown if read XML file is not valid + * @param fs : the open Filestorage which contains retina parameters + * @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error + */ + void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true); + /** * try to open an XML retina parameters file to adjust current retina instance setup * => if the xml file does not exist, then default setup is applied diff --git a/modules/contrib/src/retina.cpp b/modules/contrib/src/retina.cpp index ae51ccd2e..9a113fc37 100644 --- a/modules/contrib/src/retina.cpp +++ b/modules/contrib/src/retina.cpp @@ -100,15 +100,34 @@ void Retina::setColorSaturation(const bool saturateColors, const float colorSatu struct Retina::RetinaParameters Retina::getParameters(){return _retinaParameters;} + void Retina::setup(std::string retinaParameterFile, const bool applyDefaultSetupOnFailure) { - // open specified parameters file - std::cout<<"Retina::setup: setting up retina from parameter file : "<"< keeping current parameters"<