Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
53b82426
Commit
53b82426
authored
Aug 17, 2017
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bioinspired: move all factories into corresponding classes
parent
6adf012e
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
39 additions
and
41 deletions
+39
-41
retina.hpp
modules/bioinspired/include/opencv2/bioinspired/retina.hpp
+22
-24
retinafasttonemapping.hpp
...red/include/opencv2/bioinspired/retinafasttonemapping.hpp
+2
-2
transientareassegmentationmodule.hpp
.../opencv2/bioinspired/transientareassegmentationmodule.hpp
+4
-5
perf_retina.ocl.cpp
modules/bioinspired/perf/opencl/perf_retina.ocl.cpp
+1
-1
OpenEXRimages_HDR_Retina_toneMapping.cpp
...inspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp
+2
-2
retinaDemo.cpp
modules/bioinspired/samples/retinaDemo.cpp
+3
-2
retina.cpp
modules/bioinspired/src/retina.cpp
+2
-2
retinafasttonemapping.cpp
modules/bioinspired/src/retinafasttonemapping.cpp
+1
-1
transientareassegmentationmodule.cpp
modules/bioinspired/src/transientareassegmentationmodule.cpp
+1
-1
test_retina_ocl.cpp
modules/bioinspired/test/test_retina_ocl.cpp
+1
-1
No files found.
modules/bioinspired/include/opencv2/bioinspired/retina.hpp
View file @
53b82426
...
@@ -422,32 +422,30 @@ public:
...
@@ -422,32 +422,30 @@ public:
Retina::getParvo methods
Retina::getParvo methods
*/
*/
CV_WRAP
virtual
void
activateContoursProcessing
(
const
bool
activate
)
=
0
;
CV_WRAP
virtual
void
activateContoursProcessing
(
const
bool
activate
)
=
0
;
};
//! @relates bioinspired::Retina
//! @{
/** @overload */
/** @overload */
CV_EXPORTS_W
Ptr
<
Retina
>
createRetina
(
Size
inputSize
);
CV_WRAP
static
Ptr
<
Retina
>
create
(
Size
inputSize
);
/** @brief Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
/** @brief Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
@param inputSize the input frame size
@param inputSize the input frame size
@param colorMode the chosen processing mode : with or without color processing
@param colorMode the chosen processing mode : with or without color processing
@param colorSamplingMethod specifies which kind of color sampling will be used :
@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_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_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
- cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
- cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
@param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can
@param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can
be used
be used
@param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction
@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
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
underscaled, then a reduction of the output is allowed without precision leak
@param samplingStrenght only usefull if param useRetinaLogSampling=true, specifies the strenght of
@param samplingStrenght only usefull if param useRetinaLogSampling=true, specifies the strenght of
the log scale that is applied
the log scale that is applied
*/
*/
CV_EXPORTS_W
Ptr
<
Retina
>
createRetina
(
Size
inputSize
,
const
bool
colorMode
,
int
colorSamplingMethod
=
RETINA_COLOR_BAYER
,
const
bool
useRetinaLogSampling
=
false
,
const
float
reductionFactor
=
1.0
f
,
const
float
samplingStrenght
=
10.0
f
);
CV_WRAP
static
Ptr
<
Retina
>
create
(
Size
inputSize
,
const
bool
colorMode
,
int
colorSamplingMethod
=
RETINA_COLOR_BAYER
,
//! @}
const
bool
useRetinaLogSampling
=
false
,
const
float
reductionFactor
=
1.0
f
,
const
float
samplingStrenght
=
10.0
f
);
};
//! @}
//! @}
...
...
modules/bioinspired/include/opencv2/bioinspired/retinafasttonemapping.hpp
View file @
53b82426
...
@@ -126,10 +126,10 @@ public:
...
@@ -126,10 +126,10 @@ public:
(default is 1, see reference paper)
(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
virtual
void
setup
(
const
float
photoreceptorsNeighborhoodRadius
=
3.
f
,
const
float
ganglioncellsNeighborhoodRadius
=
1.
f
,
const
float
meanLuminanceModulatorK
=
1.
f
)
=
0
;
CV_WRAP
static
Ptr
<
RetinaFastToneMapping
>
create
(
Size
inputSize
);
};
};
//! @relates bioinspired::RetinaFastToneMapping
CV_EXPORTS_W
Ptr
<
RetinaFastToneMapping
>
createRetinaFastToneMapping
(
Size
inputSize
);
//! @}
//! @}
...
...
modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp
View file @
53b82426
...
@@ -187,13 +187,12 @@ public:
...
@@ -187,13 +187,12 @@ public:
/** @brief cleans all the buffers of the instance
/** @brief cleans all the buffers of the instance
*/
*/
CV_WRAP
virtual
void
clearAllBuffers
()
=
0
;
CV_WRAP
virtual
void
clearAllBuffers
()
=
0
;
};
/** @brief allocator
/** @brief allocator
@param inputSize : size of the images input to segment (output will be the same size)
@param inputSize : size of the images input to segment (output will be the same size)
@relates bioinspired::TransientAreasSegmentationModule
*/
*/
CV_EXPORTS_W
Ptr
<
TransientAreasSegmentationModule
>
createTransientAreasSegmentationModule
(
Size
inputSize
);
CV_WRAP
static
Ptr
<
TransientAreasSegmentationModule
>
create
(
Size
inputSize
);
};
//! @}
//! @}
...
...
modules/bioinspired/perf/opencl/perf_retina.ocl.cpp
View file @
53b82426
...
@@ -29,7 +29,7 @@ OCL_PERF_TEST_P(RetinaFixture, Retina,
...
@@ -29,7 +29,7 @@ OCL_PERF_TEST_P(RetinaFixture, Retina,
UMat
ocl_parvo
,
ocl_magno
;
UMat
ocl_parvo
,
ocl_magno
;
{
{
Ptr
<
cv
::
bioinspired
::
Retina
>
retina
=
cv
::
bioinspired
::
createRetina
(
Ptr
<
cv
::
bioinspired
::
Retina
>
retina
=
cv
::
bioinspired
::
Retina
::
create
(
input
.
size
(),
colorMode
,
colorSamplingMethod
,
useLogSampling
,
input
.
size
(),
colorMode
,
colorSamplingMethod
,
useLogSampling
,
reductionFactor
,
samplingStrength
);
reductionFactor
,
samplingStrength
);
...
...
modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp
View file @
53b82426
...
@@ -220,10 +220,10 @@ int main(int argc, char* argv[])
...
@@ -220,10 +220,10 @@ int main(int argc, char* argv[])
*/
*/
if
(
useLogSampling
)
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 :
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)
// create a fast retina tone mapper (Meyla&al algorithm)
std
::
cout
<<
"Allocating fast tone mapper..."
<<
std
::
endl
;
std
::
cout
<<
"Allocating fast tone mapper..."
<<
std
::
endl
;
...
...
modules/bioinspired/samples/retinaDemo.cpp
View file @
53b82426
...
@@ -84,10 +84,11 @@ int main(int argc, char* argv[])
...
@@ -84,10 +84,11 @@ int main(int argc, char* argv[])
// if the last parameter is 'log', then activate log sampling (favour foveal vision and subsamples peripheral vision)
// if the last parameter is 'log', then activate log sampling (favour foveal vision and subsamples peripheral vision)
if
(
useLogSampling
)
if
(
useLogSampling
)
{
{
myRetina
=
cv
::
bioinspired
::
createRetina
(
inputFrame
.
size
(),
true
,
cv
::
bioinspired
::
RETINA_COLOR_BAYER
,
true
,
2.0
,
10.0
);
myRetina
=
cv
::
bioinspired
::
Retina
::
create
(
inputFrame
.
size
(),
true
,
cv
::
bioinspired
::
RETINA_COLOR_BAYER
,
true
,
2.0
,
10.0
);
}
}
else
// -> else allocate "classical" retina :
else
// -> 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"
// 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"
);
myRetina
->
write
(
"RetinaDefaultParameters.xml"
);
...
...
modules/bioinspired/src/retina.cpp
View file @
53b82426
...
@@ -306,12 +306,12 @@ private:
...
@@ -306,12 +306,12 @@ private:
};
};
// smart pointers allocation :
// smart pointers allocation :
Ptr
<
Retina
>
createRetina
(
Size
inputSize
)
Ptr
<
Retina
>
Retina
::
create
(
Size
inputSize
)
{
{
return
makePtr
<
RetinaImpl
>
(
inputSize
);
return
makePtr
<
RetinaImpl
>
(
inputSize
);
}
}
Ptr
<
Retina
>
createRetina
(
Size
inputSize
,
const
bool
colorMode
,
int
colorSamplingMethod
,
const
bool
useRetinaLogSampling
,
const
float
reductionFactor
,
const
float
samplingStrenght
)
Ptr
<
Retina
>
Retina
::
create
(
Size
inputSize
,
const
bool
colorMode
,
int
colorSamplingMethod
,
const
bool
useRetinaLogSampling
,
const
float
reductionFactor
,
const
float
samplingStrenght
)
{
{
return
makePtr
<
RetinaImpl
>
(
inputSize
,
colorMode
,
colorSamplingMethod
,
useRetinaLogSampling
,
reductionFactor
,
samplingStrenght
);
return
makePtr
<
RetinaImpl
>
(
inputSize
,
colorMode
,
colorSamplingMethod
,
useRetinaLogSampling
,
reductionFactor
,
samplingStrenght
);
}
}
...
...
modules/bioinspired/src/retinafasttonemapping.cpp
View file @
53b82426
...
@@ -309,7 +309,7 @@ void _runRGBToneMapping(const std::valarray<float> &RGBimageInput, std::valarray
...
@@ -309,7 +309,7 @@ void _runRGBToneMapping(const std::valarray<float> &RGBimageInput, std::valarray
};
};
CV_EXPORTS
Ptr
<
RetinaFastToneMapping
>
createRetinaFastToneMapping
(
Size
inputSize
)
Ptr
<
RetinaFastToneMapping
>
RetinaFastToneMapping
::
create
(
Size
inputSize
)
{
{
return
makePtr
<
RetinaFastToneMappingImpl
>
(
inputSize
);
return
makePtr
<
RetinaFastToneMappingImpl
>
(
inputSize
);
}
}
...
...
modules/bioinspired/src/transientareassegmentationmodule.cpp
View file @
53b82426
...
@@ -247,7 +247,7 @@ private:
...
@@ -247,7 +247,7 @@ private:
* allocator
* allocator
* @param Size : size of the images input to segment (output will be the same size)
* @param Size : size of the images input to segment (output will be the same size)
*/
*/
Ptr
<
TransientAreasSegmentationModule
>
createTransientAreasSegmentationModul
e
(
Size
inputSize
){
Ptr
<
TransientAreasSegmentationModule
>
TransientAreasSegmentationModule
::
creat
e
(
Size
inputSize
){
return
makePtr
<
TransientAreasSegmentationModuleImpl_
>
(
inputSize
);
return
makePtr
<
TransientAreasSegmentationModuleImpl_
>
(
inputSize
);
}
}
...
...
modules/bioinspired/test/test_retina_ocl.cpp
View file @
53b82426
...
@@ -76,7 +76,7 @@ OCL_TEST_P(Retina_OCL, Accuracy)
...
@@ -76,7 +76,7 @@ OCL_TEST_P(Retina_OCL, Accuracy)
Mat
input
=
imread
(
cvtest
::
TS
::
ptr
()
->
get_data_path
()
+
"shared/lena.png"
,
colorMode
);
Mat
input
=
imread
(
cvtest
::
TS
::
ptr
()
->
get_data_path
()
+
"shared/lena.png"
,
colorMode
);
CV_Assert
(
!
input
.
empty
());
CV_Assert
(
!
input
.
empty
());
Ptr
<
bioinspired
::
Retina
>
retina
=
bioinspired
::
createRetina
(
Ptr
<
bioinspired
::
Retina
>
retina
=
bioinspired
::
Retina
::
create
(
input
.
size
(),
input
.
size
(),
colorMode
,
colorMode
,
colorSamplingMethod
,
colorSamplingMethod
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment