diff --git a/modules/bioinspired/include/opencv2/bioinspired/retina.hpp b/modules/bioinspired/include/opencv2/bioinspired/retina.hpp index 583599ca2..d76aaba9d 100644 --- a/modules/bioinspired/include/opencv2/bioinspired/retina.hpp +++ b/modules/bioinspired/include/opencv2/bioinspired/retina.hpp @@ -422,33 +422,31 @@ public: Retina::getParvo methods */ CV_WRAP virtual void activateContoursProcessing(const bool activate)=0; + + /** @overload */ + CV_WRAP static Ptr create(Size inputSize); + /** @brief Constructors from standardized interfaces : retreive a smart pointer to a Retina instance + + @param inputSize the input frame size + @param colorMode the chosen processing mode : with or without color processing + @param colorSamplingMethod specifies which kind of color sampling will be used : + - cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice + - cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR... + - cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling + @param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can + be used + @param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction + factor of the output frame (as the center (fovea) is high resolution and corners can be + underscaled, then a reduction of the output is allowed without precision leak + @param samplingStrenght only usefull if param useRetinaLogSampling=true, specifies the strenght of + the log scale that is applied + */ + CV_WRAP static Ptr create(Size inputSize, const bool colorMode, + int colorSamplingMethod=RETINA_COLOR_BAYER, + const bool useRetinaLogSampling=false, + const float reductionFactor=1.0f, const float samplingStrenght=10.0f); }; -//! @relates bioinspired::Retina -//! @{ - -/** @overload */ -CV_EXPORTS_W Ptr createRetina(Size inputSize); -/** @brief Constructors from standardized interfaces : retreive a smart pointer to a Retina instance - -@param inputSize the input frame size -@param colorMode the chosen processing mode : with or without color processing -@param colorSamplingMethod specifies which kind of color sampling will be used : -- cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice -- cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR... -- cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling -@param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can -be used -@param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction -factor of the output frame (as the center (fovea) is high resolution and corners can be -underscaled, then a reduction of the output is allowed without precision leak -@param samplingStrenght only usefull if param useRetinaLogSampling=true, specifies the strenght of -the log scale that is applied - */ -CV_EXPORTS_W Ptr createRetina(Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const float reductionFactor=1.0f, const float samplingStrenght=10.0f); - -//! @} - //! @} } diff --git a/modules/bioinspired/include/opencv2/bioinspired/retinafasttonemapping.hpp b/modules/bioinspired/include/opencv2/bioinspired/retinafasttonemapping.hpp index c65709d0e..ba1a87292 100644 --- a/modules/bioinspired/include/opencv2/bioinspired/retinafasttonemapping.hpp +++ b/modules/bioinspired/include/opencv2/bioinspired/retinafasttonemapping.hpp @@ -126,10 +126,10 @@ public: (default is 1, see reference paper) */ CV_WRAP virtual void setup(const float photoreceptorsNeighborhoodRadius=3.f, const float ganglioncellsNeighborhoodRadius=1.f, const float meanLuminanceModulatorK=1.f)=0; + + CV_WRAP static Ptr create(Size inputSize); }; -//! @relates bioinspired::RetinaFastToneMapping -CV_EXPORTS_W Ptr createRetinaFastToneMapping(Size inputSize); //! @} diff --git a/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp b/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp index b11b61d73..5d3c358bd 100755 --- a/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp +++ b/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp @@ -187,13 +187,12 @@ public: /** @brief cleans all the buffers of the instance */ CV_WRAP virtual void clearAllBuffers()=0; -}; -/** @brief allocator -@param inputSize : size of the images input to segment (output will be the same size) -@relates bioinspired::TransientAreasSegmentationModule - */ -CV_EXPORTS_W Ptr createTransientAreasSegmentationModule(Size inputSize); + /** @brief allocator + @param inputSize : size of the images input to segment (output will be the same size) + */ + CV_WRAP static Ptr create(Size inputSize); +}; //! @} diff --git a/modules/bioinspired/perf/opencl/perf_retina.ocl.cpp b/modules/bioinspired/perf/opencl/perf_retina.ocl.cpp index 2fe2cc52c..881041cee 100644 --- a/modules/bioinspired/perf/opencl/perf_retina.ocl.cpp +++ b/modules/bioinspired/perf/opencl/perf_retina.ocl.cpp @@ -29,7 +29,7 @@ OCL_PERF_TEST_P(RetinaFixture, Retina, UMat ocl_parvo, ocl_magno; { - Ptr retina = cv::bioinspired::createRetina( + Ptr retina = cv::bioinspired::Retina::create( input.size(), colorMode, colorSamplingMethod, useLogSampling, reductionFactor, samplingStrength); diff --git a/modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp b/modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp index 486d150b2..7a7edda3f 100644 --- a/modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp +++ b/modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp @@ -220,10 +220,10 @@ int main(int argc, char* argv[]) */ if (useLogSampling) { - retina = cv::bioinspired::createRetina(inputImage.size(),true, cv::bioinspired::RETINA_COLOR_BAYER, true, 2.0, 10.0); + retina = cv::bioinspired::Retina::create(inputImage.size(),true, cv::bioinspired::RETINA_COLOR_BAYER, true, 2.0, 10.0); } else// -> else allocate "classical" retina : - retina = cv::bioinspired::createRetina(inputImage.size()); + retina = cv::bioinspired::Retina::create(inputImage.size()); // create a fast retina tone mapper (Meyla&al algorithm) std::cout<<"Allocating fast tone mapper..."< else allocate "classical" retina : - myRetina = cv::bioinspired::createRetina(inputFrame.size()); + myRetina = cv::bioinspired::Retina::create(inputFrame.size()); // save default retina parameters file in order to let you see this and maybe modify it and reload using method "setup" myRetina->write("RetinaDefaultParameters.xml"); diff --git a/modules/bioinspired/src/retina.cpp b/modules/bioinspired/src/retina.cpp index ec593fa54..54b3162c4 100644 --- a/modules/bioinspired/src/retina.cpp +++ b/modules/bioinspired/src/retina.cpp @@ -306,12 +306,12 @@ private: }; // smart pointers allocation : -Ptr createRetina(Size inputSize) +Ptr Retina::create(Size inputSize) { return makePtr(inputSize); } -Ptr createRetina(Size inputSize, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrenght) +Ptr Retina::create(Size inputSize, const bool colorMode, int colorSamplingMethod, const bool useRetinaLogSampling, const float reductionFactor, const float samplingStrenght) { return makePtr(inputSize, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght); } diff --git a/modules/bioinspired/src/retinafasttonemapping.cpp b/modules/bioinspired/src/retinafasttonemapping.cpp index 776e68c90..1711a41a5 100644 --- a/modules/bioinspired/src/retinafasttonemapping.cpp +++ b/modules/bioinspired/src/retinafasttonemapping.cpp @@ -309,7 +309,7 @@ void _runRGBToneMapping(const std::valarray &RGBimageInput, std::valarray }; -CV_EXPORTS Ptr createRetinaFastToneMapping(Size inputSize) +Ptr RetinaFastToneMapping::create(Size inputSize) { return makePtr(inputSize); } diff --git a/modules/bioinspired/src/transientareassegmentationmodule.cpp b/modules/bioinspired/src/transientareassegmentationmodule.cpp index d54be3b7a..8a3a5391f 100644 --- a/modules/bioinspired/src/transientareassegmentationmodule.cpp +++ b/modules/bioinspired/src/transientareassegmentationmodule.cpp @@ -247,7 +247,7 @@ private: * allocator * @param Size : size of the images input to segment (output will be the same size) */ -Ptr createTransientAreasSegmentationModule(Size inputSize){ +Ptr TransientAreasSegmentationModule::create(Size inputSize){ return makePtr(inputSize); } diff --git a/modules/bioinspired/test/test_retina_ocl.cpp b/modules/bioinspired/test/test_retina_ocl.cpp index 8f3067e30..9113661d4 100644 --- a/modules/bioinspired/test/test_retina_ocl.cpp +++ b/modules/bioinspired/test/test_retina_ocl.cpp @@ -76,7 +76,7 @@ OCL_TEST_P(Retina_OCL, Accuracy) Mat input = imread(cvtest::TS::ptr()->get_data_path() + "shared/lena.png", colorMode); CV_Assert(!input.empty()); - Ptr retina = bioinspired::createRetina( + Ptr retina = bioinspired::Retina::create( input.size(), colorMode, colorSamplingMethod,