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
42e65654
Commit
42e65654
authored
Nov 23, 2011
by
Alexandre Benoit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cv::Filestorage based setup method for retina model
parent
b33e2313
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
retina.hpp
modules/contrib/include/opencv2/contrib/retina.hpp
+10
-0
retina.cpp
modules/contrib/src/retina.cpp
+22
-3
No files found.
modules/contrib/include/opencv2/contrib/retina.hpp
View file @
42e65654
...
...
@@ -174,6 +174,16 @@ public:
*/
void
setup
(
std
::
string
retinaParameterFile
=
""
,
const
bool
applyDefaultSetupOnFailure
=
true
);
/**
* try to open an XML retina parameters file to adjust current retina instance setup
* => if the xml file does not exist, then default setup is applied
* => warning, Exceptions are thrown if read XML file is not valid
* @param fs : the open Filestorage which contains retina parameters
* @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error
*/
void
setup
(
cv
::
FileStorage
&
fs
,
const
bool
applyDefaultSetupOnFailure
=
true
);
/**
* try to open an XML retina parameters file to adjust current retina instance setup
* => if the xml file does not exist, then default setup is applied
...
...
modules/contrib/src/retina.cpp
View file @
42e65654
...
...
@@ -100,15 +100,34 @@ void Retina::setColorSaturation(const bool saturateColors, const float colorSatu
struct
Retina
::
RetinaParameters
Retina
::
getParameters
(){
return
_retinaParameters
;}
void
Retina
::
setup
(
std
::
string
retinaParameterFile
,
const
bool
applyDefaultSetupOnFailure
)
{
// open specified parameters file
std
::
cout
<<
"Retina::setup: setting up retina from parameter file : "
<<
retinaParameterFile
<<
std
::
endl
;
try
{
// opening retinaParameterFile in read mode
cv
::
FileStorage
fs
(
retinaParameterFile
,
cv
::
FileStorage
::
READ
);
setup
(
fs
,
applyDefaultSetupOnFailure
);
}
catch
(
Exception
&
e
)
{
std
::
cout
<<
"Retina::setup: wrong/unappropriate xml parameter file : error report :`n=>"
<<
e
.
what
()
<<
std
::
endl
;
if
(
applyDefaultSetupOnFailure
)
{
std
::
cout
<<
"Retina::setup: resetting retina with default parameters"
<<
std
::
endl
;
setupOPLandIPLParvoChannel
();
setupIPLMagnoChannel
();
}
else
{
std
::
cout
<<
"=> keeping current parameters"
<<
std
::
endl
;
}
}
}
void
Retina
::
setup
(
cv
::
FileStorage
&
fs
,
const
bool
applyDefaultSetupOnFailure
)
{
try
{
// read parameters file if it exists or apply default setup if asked for
if
(
!
fs
.
isOpened
())
{
...
...
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