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
3ae595c1
Commit
3ae595c1
authored
Jul 08, 2014
by
Alexandre Benoit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated code formating of reina samples
parent
154bc89d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
24 deletions
+26
-24
OpenEXRimages_HDR_Retina_toneMapping.cpp
...inspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp
+24
-23
retinaDemo.cpp
modules/bioinspired/samples/retinaDemo.cpp
+2
-1
No files found.
modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp
View file @
3ae595c1
...
...
@@ -51,8 +51,8 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
/*
* objective : get the gray level map of the input image and rescale it to the range [0-255]
*/
static
void
rescaleGrayLevelMat
(
const
cv
::
Mat
&
inputMat
,
cv
::
Mat
&
outputMat
,
const
float
histogramClippingLimit
)
{
static
void
rescaleGrayLevelMat
(
const
cv
::
Mat
&
inputMat
,
cv
::
Mat
&
outputMat
,
const
float
histogramClippingLimit
)
{
// adjust output matrix wrt the input size but single channel
std
::
cout
<<
"Input image rescaling with histogram edges cutting (in order to eliminate bad pixels created during the HDR image creation) :"
<<
std
::
endl
;
...
...
@@ -116,33 +116,34 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
cv
::
threshold
(
outputMat
,
outputMat
,
255.0
,
255.0
,
2
);
//THRESH_TRUNC, clips values above 255
cv
::
threshold
(
outputMat
,
outputMat
,
0.0
,
0.0
,
3
);
//THRESH_TOZERO, clips values under 0
}
// basic callback method for interface management
cv
::
Mat
inputImage
;
cv
::
Mat
imageInputRescaled
;
int
histogramClippingValue
;
static
void
callBack_rescaleGrayLevelMat
(
int
,
void
*
)
{
}
// basic callback method for interface management
cv
::
Mat
inputImage
;
cv
::
Mat
imageInputRescaled
;
int
histogramClippingValue
;
static
void
callBack_rescaleGrayLevelMat
(
int
,
void
*
)
{
std
::
cout
<<
"Histogram clipping value changed, current value = "
<<
histogramClippingValue
<<
std
::
endl
;
rescaleGrayLevelMat
(
inputImage
,
imageInputRescaled
,
(
float
)(
histogramClippingValue
/
100.0
));
normalize
(
imageInputRescaled
,
imageInputRescaled
,
0.0
,
255.0
,
cv
::
NORM_MINMAX
);
}
}
cv
::
Ptr
<
cv
::
bioinspired
::
Retina
>
retina
;
int
retinaHcellsGain
;
int
localAdaptation_photoreceptors
,
localAdaptation_Gcells
;
static
void
callBack_updateRetinaParams
(
int
,
void
*
)
{
cv
::
Ptr
<
cv
::
bioinspired
::
Retina
>
retina
;
int
retinaHcellsGain
;
int
localAdaptation_photoreceptors
,
localAdaptation_Gcells
;
static
void
callBack_updateRetinaParams
(
int
,
void
*
)
{
retina
->
setupOPLandIPLParvoChannel
(
true
,
true
,
(
float
)(
localAdaptation_photoreceptors
/
200.0
),
0.5
f
,
0.43
f
,
(
float
)
retinaHcellsGain
,
1.
f
,
7.
f
,
(
float
)(
localAdaptation_Gcells
/
200.0
));
}
}
int
colorSaturationFactor
;
static
void
callback_saturateColors
(
int
,
void
*
)
{
int
colorSaturationFactor
;
static
void
callback_saturateColors
(
int
,
void
*
)
{
retina
->
setColorSaturation
(
true
,
(
float
)
colorSaturationFactor
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
// welcome message
std
::
cout
<<
"*********************************************************************************"
<<
std
::
endl
;
std
::
cout
<<
"* Retina demonstration for High Dynamic Range compression (tone-mapping) : demonstrates the use of a wrapper class of the Gipsa/Listic Labs retina model."
<<
std
::
endl
;
...
...
@@ -289,7 +290,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
fastToneMapper->setup(3.f, 1.5f, 1.f);
fastToneMapper->applyFastToneMapping(imageInputRescaled, fastToneMappingOutput_specificObject);
cv::imshow("### Retina fast tone mapping output : 16bit=>8bit image retina tonemapping", fastToneMappingOutput_specificObject);
*/
*/
cv
::
waitKey
(
10
);
}
}
catch
(
cv
::
Exception
e
)
...
...
@@ -301,4 +302,4 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
std
::
cout
<<
"Retina demo end"
<<
std
::
endl
;
return
0
;
}
}
modules/bioinspired/samples/retinaDemo.cpp
View file @
3ae595c1
...
...
@@ -32,7 +32,8 @@ static void help(std::string errorMessage)
std
::
cout
<<
"
\n
Please start again with new parameters"
<<
std
::
endl
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
// welcome message
std
::
cout
<<
"****************************************************"
<<
std
::
endl
;
std
::
cout
<<
"* Retina demonstration : demonstrates the use of is a wrapper class of the Gipsa/Listic Labs retina model."
<<
std
::
endl
;
...
...
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