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
5ff271ef
Commit
5ff271ef
authored
Jul 31, 2014
by
Vlad Shakhuro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bg_per_image param
parent
319b25ee
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
fcw_train.cpp
modules/adas/tools/fcw_train/fcw_train.cpp
+2
-3
xobjdetect.hpp
modules/xobjdetect/include/opencv2/xobjdetect.hpp
+2
-1
icfdetector.cpp
modules/xobjdetect/src/icfdetector.cpp
+3
-3
No files found.
modules/adas/tools/fcw_train/fcw_train.cpp
View file @
5ff271ef
...
@@ -52,6 +52,7 @@ int main(int argc, char *argv[])
...
@@ -52,6 +52,7 @@ int main(int argc, char *argv[])
"{help | | print this message}"
"{help | | print this message}"
"{pos_path | pos | path to training object samples}"
"{pos_path | pos | path to training object samples}"
"{bg_path | bg | path to background images}"
"{bg_path | bg | path to background images}"
"{bg_per_image | 5 | number of windows to sample per bg image}"
"{feature_count | 10000 | number of features to generate}"
"{feature_count | 10000 | number of features to generate}"
"{weak_count | 100 | number of weak classifiers in cascade}"
"{weak_count | 100 | number of weak classifiers in cascade}"
"{model_size | 40x40 | model size in pixels}"
"{model_size | 40x40 | model size in pixels}"
...
@@ -71,12 +72,10 @@ int main(int argc, char *argv[])
...
@@ -71,12 +72,10 @@ int main(int argc, char *argv[])
string
bg_path
=
parser
.
get
<
string
>
(
"bg_path"
);
string
bg_path
=
parser
.
get
<
string
>
(
"bg_path"
);
string
model_filename
=
parser
.
get
<
string
>
(
"model_filename"
);
string
model_filename
=
parser
.
get
<
string
>
(
"model_filename"
);
cerr
<<
pos_path
<<
endl
;
cerr
<<
bg_path
<<
endl
;
ICFDetectorParams
params
;
ICFDetectorParams
params
;
params
.
feature_count
=
parser
.
get
<
size_t
>
(
"feature_count"
);
params
.
feature_count
=
parser
.
get
<
size_t
>
(
"feature_count"
);
params
.
weak_count
=
parser
.
get
<
size_t
>
(
"weak_count"
);
params
.
weak_count
=
parser
.
get
<
size_t
>
(
"weak_count"
);
params
.
bg_per_image
=
parser
.
get
<
size_t
>
(
"bg_per_image"
);
string
model_size
=
parser
.
get
<
string
>
(
"model_size"
);
string
model_size
=
parser
.
get
<
string
>
(
"model_size"
);
if
(
!
read_model_size
(
model_size
.
c_str
(),
&
params
.
model_n_rows
,
if
(
!
read_model_size
(
model_size
.
c_str
(),
&
params
.
model_n_rows
,
...
...
modules/xobjdetect/include/opencv2/xobjdetect.hpp
View file @
5ff271ef
...
@@ -159,9 +159,10 @@ struct CV_EXPORTS ICFDetectorParams
...
@@ -159,9 +159,10 @@ struct CV_EXPORTS ICFDetectorParams
int
weak_count
;
int
weak_count
;
int
model_n_rows
;
int
model_n_rows
;
int
model_n_cols
;
int
model_n_cols
;
int
bg_per_image
;
ICFDetectorParams
()
:
feature_count
(
UINT_MAX
),
weak_count
(
100
),
ICFDetectorParams
()
:
feature_count
(
UINT_MAX
),
weak_count
(
100
),
model_n_rows
(
40
),
model_n_cols
(
40
)
model_n_rows
(
56
),
model_n_cols
(
56
),
bg_per_image
(
5
)
{}
{}
};
};
...
...
modules/xobjdetect/src/icfdetector.cpp
View file @
5ff271ef
...
@@ -97,11 +97,11 @@ void ICFDetector::train(const String& pos_path,
...
@@ -97,11 +97,11 @@ void ICFDetector::train(const String& pos_path,
{
{
cout
<<
setw
(
6
)
<<
(
i
+
1
)
<<
"/"
<<
bg_filenames
.
size
()
<<
"
\r
"
;
cout
<<
setw
(
6
)
<<
(
i
+
1
)
<<
"/"
<<
bg_filenames
.
size
()
<<
"
\r
"
;
Mat
img
=
imread
(
bg_filenames
[
i
]);
Mat
img
=
imread
(
bg_filenames
[
i
]);
for
(
int
j
=
0
;
j
<
50
;
for
(
int
j
=
0
;
j
<
params
.
bg_per_image
;
++
j
,
++
neg_count
)
++
j
,
++
neg_count
)
{
{
Rect
r
;
Rect
r
;
r
.
x
=
rng
.
uniform
(
0
,
img
.
cols
);
r
.
width
=
rng
.
uniform
(
r
.
x
+
1
,
img
.
cols
);
r
.
x
=
rng
.
uniform
(
0
,
img
.
cols
);
r
.
width
=
rng
.
uniform
(
r
.
x
+
1
,
img
.
cols
);
r
.
y
=
rng
.
uniform
(
0
,
img
.
rows
);
r
.
y
=
rng
.
uniform
(
0
,
img
.
rows
);
r
.
height
=
rng
.
uniform
(
r
.
y
+
1
,
img
.
rows
);
r
.
height
=
rng
.
uniform
(
r
.
y
+
1
,
img
.
rows
);
...
...
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