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
95548c98
Commit
95548c98
authored
Aug 12, 2014
by
Vlad Shakhuro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix waldboost interface
parent
6c9712de
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
14 deletions
+10
-14
fcw_detect.cpp
modules/adas/tools/fcw_detect/fcw_detect.cpp
+1
-1
fcw_train.cpp
modules/adas/tools/fcw_train/fcw_train.cpp
+2
-1
xobjdetect.hpp
modules/xobjdetect/include/opencv2/xobjdetect.hpp
+4
-10
icfdetector.cpp
modules/xobjdetect/src/icfdetector.cpp
+3
-2
No files found.
modules/adas/tools/fcw_detect/fcw_detect.cpp
View file @
95548c98
...
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
...
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
ICFDetector
detector
;
ICFDetector
detector
;
FileStorage
fs
(
model_filename
,
FileStorage
::
READ
);
FileStorage
fs
(
model_filename
,
FileStorage
::
READ
);
fs
[
"icfdetector"
]
>>
detector
;
detector
.
read
(
fs
[
"icfdetector"
])
;
fs
.
release
();
fs
.
release
();
vector
<
Rect
>
objects
;
vector
<
Rect
>
objects
;
Mat
img
=
imread
(
image_path
);
Mat
img
=
imread
(
image_path
);
...
...
modules/adas/tools/fcw_train/fcw_train.cpp
View file @
95548c98
...
@@ -94,6 +94,7 @@ int main(int argc, char *argv[])
...
@@ -94,6 +94,7 @@ int main(int argc, char *argv[])
ICFDetector
detector
;
ICFDetector
detector
;
detector
.
train
(
pos_path
,
bg_path
,
params
);
detector
.
train
(
pos_path
,
bg_path
,
params
);
FileStorage
fs
(
model_filename
,
FileStorage
::
WRITE
);
FileStorage
fs
(
model_filename
,
FileStorage
::
WRITE
);
fs
<<
"icfdetector"
<<
detector
;
fs
<<
"icfdetector"
;
detector
.
write
(
fs
);
fs
.
release
();
fs
.
release
();
}
}
modules/xobjdetect/include/opencv2/xobjdetect.hpp
View file @
95548c98
...
@@ -128,7 +128,7 @@ public:
...
@@ -128,7 +128,7 @@ public:
Feature enumeration starts from 0
Feature enumeration starts from 0
*/
*/
virtual
std
::
vector
<
int
>
train
(
const
Mat
&
/*data*/
,
virtual
std
::
vector
<
int
>
train
(
const
Mat
&
/*data*/
,
const
Mat
&
/*labels*/
)
{
return
std
::
vector
<
int
>
();}
const
Mat
&
/*labels*/
)
=
0
;
/* Predict object class given object that can compute object features
/* Predict object class given object that can compute object features
...
@@ -138,21 +138,15 @@ public:
...
@@ -138,21 +138,15 @@ public:
is from class +1
is from class +1
*/
*/
virtual
float
predict
(
virtual
float
predict
(
const
Ptr
<
FeatureEvaluator
>&
/*feature_evaluator*/
)
const
const
Ptr
<
FeatureEvaluator
>&
/*feature_evaluator*/
)
const
=
0
;
{
return
0.0
f
;}
/* Write WaldBoost to FileStorage */
/* Write WaldBoost to FileStorage */
virtual
void
write
(
FileStorage
&
/*fs*/
)
const
{}
virtual
void
write
(
FileStorage
&
/*fs*/
)
const
=
0
;
/* Read WaldBoost */
/* Read WaldBoost */
virtual
void
read
(
const
FileNode
&
/*node*/
)
{}
virtual
void
read
(
const
FileNode
&
/*node*/
)
=
0
;
};
};
void
write
(
FileStorage
&
fs
,
String
&
,
const
WaldBoost
&
waldboost
);
void
read
(
const
FileNode
&
node
,
WaldBoost
&
w
,
const
WaldBoost
&
default_value
=
WaldBoost
());
CV_EXPORTS
Ptr
<
WaldBoost
>
CV_EXPORTS
Ptr
<
WaldBoost
>
createWaldBoost
(
const
WaldBoostParams
&
params
=
WaldBoostParams
());
createWaldBoost
(
const
WaldBoostParams
&
params
=
WaldBoostParams
());
...
...
modules/xobjdetect/src/icfdetector.cpp
View file @
95548c98
...
@@ -163,7 +163,8 @@ void ICFDetector::write(FileStorage& fs) const
...
@@ -163,7 +163,8 @@ void ICFDetector::write(FileStorage& fs) const
fs
<<
"{"
;
fs
<<
"{"
;
fs
<<
"model_n_rows"
<<
model_n_rows_
;
fs
<<
"model_n_rows"
<<
model_n_rows_
;
fs
<<
"model_n_cols"
<<
model_n_cols_
;
fs
<<
"model_n_cols"
<<
model_n_cols_
;
fs
<<
"waldboost"
<<
*
waldboost_
;
fs
<<
"waldboost"
;
waldboost_
->
write
(
fs
);
fs
<<
"features"
<<
"["
;
fs
<<
"features"
<<
"["
;
for
(
size_t
i
=
0
;
i
<
features_
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
features_
.
size
();
++
i
)
{
{
...
@@ -178,7 +179,7 @@ void ICFDetector::read(const FileNode& node)
...
@@ -178,7 +179,7 @@ void ICFDetector::read(const FileNode& node)
waldboost_
=
Ptr
<
WaldBoost
>
(
createWaldBoost
(
WaldBoostParams
()));
waldboost_
=
Ptr
<
WaldBoost
>
(
createWaldBoost
(
WaldBoostParams
()));
node
[
"model_n_rows"
]
>>
model_n_rows_
;
node
[
"model_n_rows"
]
>>
model_n_rows_
;
node
[
"model_n_cols"
]
>>
model_n_cols_
;
node
[
"model_n_cols"
]
>>
model_n_cols_
;
node
[
"waldboost"
]
>>
*
waldboost_
;
waldboost_
->
read
(
node
[
"waldboost"
])
;
FileNode
features
=
node
[
"features"
];
FileNode
features
=
node
[
"features"
];
features_
.
clear
();
features_
.
clear
();
vector
<
int
>
p
;
vector
<
int
>
p
;
...
...
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