Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
c9e6efc2
Commit
c9e6efc2
authored
Apr 25, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propagated changes for retina filters from trunk to 2.4
parent
db3f9b13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
basicretinafilter.cpp
modules/contrib/src/basicretinafilter.cpp
+2
-1
retinaDemo.cpp
samples/cpp/retinaDemo.cpp
+5
-0
No files found.
modules/contrib/src/basicretinafilter.cpp
View file @
c9e6efc2
...
...
@@ -334,7 +334,8 @@ void BasicRetinaFilter::_localLuminanceAdaptation(const float *inputFrame, const
for
(
register
unsigned
int
IDpixel
=
0
;
IDpixel
<
_filterOutput
.
getNBpixels
()
;
++
IDpixel
,
++
inputFramePTR
)
{
float
X0
=*
(
localLuminancePTR
++
)
*
_localLuminanceFactor
+
_localLuminanceAddon
;
*
(
outputFramePTR
++
)
=
(
_maxInputValue
+
X0
)
**
inputFramePTR
/
(
*
inputFramePTR
+
X0
);
// TODO : the following line can lead to a divide by zero ! A small offset is added, take care if the offset is too large in case of High Dynamic Range images which can use very small values...
*
(
outputFramePTR
++
)
=
(
_maxInputValue
+
X0
)
**
inputFramePTR
/
(
*
inputFramePTR
+
X0
+
0.00000000001
);
//std::cout<<"BasicRetinaFilter::inputFrame[IDpixel]=%f, X0=%f, outputFrame[IDpixel]=%f\n", inputFrame[IDpixel], X0, outputFrame[IDpixel]);
}
}
...
...
samples/cpp/retinaDemo.cpp
View file @
c9e6efc2
...
...
@@ -47,6 +47,8 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"* => reports comments/remarks at benoit.alexandre.vision@gmail.com"
<<
std
::
endl
;
std
::
cout
<<
"* => more informations and papers at : http://sites.google.com/site/benoitalexandrevision/"
<<
std
::
endl
;
std
::
cout
<<
"****************************************************"
<<
std
::
endl
;
std
::
cout
<<
" NOTE : this program generates the default retina parameters file 'RetinaDefaultParameters.xml'"
<<
std
::
endl
;
std
::
cout
<<
" => you can use this to fine tune parameters and load them if you save to file 'RetinaSpecificParameters.xml'"
<<
std
::
endl
;
// basic input arguments checking
if
(
argc
<
2
)
...
...
@@ -116,7 +118,10 @@ int main(int argc, char* argv[]) {
// 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"
);
// load parameters if file exists
myRetina
->
setup
(
"RetinaSpecificParameters.xml"
);
myRetina
->
clearBuffers
();
// declare retina output buffers
cv
::
Mat
retinaOutput_parvo
;
cv
::
Mat
retinaOutput_magno
;
...
...
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