Skip to content

Commit 5f2d797

Browse files
committed
Merge pull request #1318 from sovrasov:bioinspired_improvement
2 parents e7a2e63 + 53b8242 commit 5f2d797

21 files changed

+260
-363
lines changed

modules/bioinspired/include/opencv2/bioinspired/retina.hpp

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -422,32 +422,30 @@ class CV_EXPORTS_W Retina : public Algorithm {
422422
Retina::getParvo methods
423423
*/
424424
CV_WRAP virtual void activateContoursProcessing(const bool activate)=0;
425-
};
426-
427-
//! @relates bioinspired::Retina
428-
//! @{
429-
430-
/** @overload */
431-
CV_EXPORTS_W Ptr<Retina> createRetina(Size inputSize);
432-
/** @brief Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
433-
434-
@param inputSize the input frame size
435-
@param colorMode the chosen processing mode : with or without color processing
436-
@param colorSamplingMethod specifies which kind of color sampling will be used :
437-
- cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
438-
- cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
439-
- cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
440-
@param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can
441-
be used
442-
@param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction
443-
factor of the output frame (as the center (fovea) is high resolution and corners can be
444-
underscaled, then a reduction of the output is allowed without precision leak
445-
@param samplingStrenght only usefull if param useRetinaLogSampling=true, specifies the strenght of
446-
the log scale that is applied
447-
*/
448-
CV_EXPORTS_W Ptr<Retina> 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);
449425

450-
//! @}
426+
/** @overload */
427+
CV_WRAP static Ptr<Retina> create(Size inputSize);
428+
/** @brief Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
429+
430+
@param inputSize the input frame size
431+
@param colorMode the chosen processing mode : with or without color processing
432+
@param colorSamplingMethod specifies which kind of color sampling will be used :
433+
- cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
434+
- cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
435+
- cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
436+
@param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can
437+
be used
438+
@param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction
439+
factor of the output frame (as the center (fovea) is high resolution and corners can be
440+
underscaled, then a reduction of the output is allowed without precision leak
441+
@param samplingStrenght only usefull if param useRetinaLogSampling=true, specifies the strenght of
442+
the log scale that is applied
443+
*/
444+
CV_WRAP static Ptr<Retina> create(Size inputSize, const bool colorMode,
445+
int colorSamplingMethod=RETINA_COLOR_BAYER,
446+
const bool useRetinaLogSampling=false,
447+
const float reductionFactor=1.0f, const float samplingStrenght=10.0f);
448+
};
451449

452450
//! @}
453451

modules/bioinspired/include/opencv2/bioinspired/retinafasttonemapping.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ class CV_EXPORTS_W RetinaFastToneMapping : public Algorithm
126126
(default is 1, see reference paper)
127127
*/
128128
CV_WRAP virtual void setup(const float photoreceptorsNeighborhoodRadius=3.f, const float ganglioncellsNeighborhoodRadius=1.f, const float meanLuminanceModulatorK=1.f)=0;
129+
130+
CV_WRAP static Ptr<RetinaFastToneMapping> create(Size inputSize);
129131
};
130132

131-
//! @relates bioinspired::RetinaFastToneMapping
132-
CV_EXPORTS_W Ptr<RetinaFastToneMapping> createRetinaFastToneMapping(Size inputSize);
133133

134134
//! @}
135135

modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,12 @@ class CV_EXPORTS_W TransientAreasSegmentationModule: public Algorithm
187187
/** @brief cleans all the buffers of the instance
188188
*/
189189
CV_WRAP virtual void clearAllBuffers()=0;
190-
};
191190

192-
/** @brief allocator
193-
@param inputSize : size of the images input to segment (output will be the same size)
194-
@relates bioinspired::TransientAreasSegmentationModule
195-
*/
196-
CV_EXPORTS_W Ptr<TransientAreasSegmentationModule> createTransientAreasSegmentationModule(Size inputSize);
191+
/** @brief allocator
192+
@param inputSize : size of the images input to segment (output will be the same size)
193+
*/
194+
CV_WRAP static Ptr<TransientAreasSegmentationModule> create(Size inputSize);
195+
};
197196

198197
//! @}
199198

modules/bioinspired/perf/opencl/perf_retina.ocl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ OCL_PERF_TEST_P(RetinaFixture, Retina,
2929
UMat ocl_parvo, ocl_magno;
3030

3131
{
32-
Ptr<cv::bioinspired::Retina> retina = cv::bioinspired::createRetina(
32+
Ptr<cv::bioinspired::Retina> retina = cv::bioinspired::Retina::create(
3333
input.size(), colorMode, colorSamplingMethod, useLogSampling,
3434
reductionFactor, samplingStrength);
3535

modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ int main(int argc, char* argv[])
220220
*/
221221
if (useLogSampling)
222222
{
223-
retina = cv::bioinspired::createRetina(inputImage.size(),true, cv::bioinspired::RETINA_COLOR_BAYER, true, 2.0, 10.0);
223+
retina = cv::bioinspired::Retina::create(inputImage.size(),true, cv::bioinspired::RETINA_COLOR_BAYER, true, 2.0, 10.0);
224224
}
225225
else// -> else allocate "classical" retina :
226-
retina = cv::bioinspired::createRetina(inputImage.size());
226+
retina = cv::bioinspired::Retina::create(inputImage.size());
227227

228228
// create a fast retina tone mapper (Meyla&al algorithm)
229229
std::cout<<"Allocating fast tone mapper..."<<std::endl;

modules/bioinspired/samples/basicRetina.cpp

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)