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
0a40bbd0
Commit
0a40bbd0
authored
Jan 10, 2013
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add two types of feature boxes support:
- (left, top, width, height) - (left, top, right, bottom)
parent
f7921b5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
softcascade.cpp
modules/objdetect/src/softcascade.cpp
+11
-3
No files found.
modules/objdetect/src/softcascade.cpp
View file @
0a40bbd0
...
...
@@ -88,7 +88,7 @@ struct Node
struct
Feature
{
Feature
()
{}
Feature
(
const
cv
::
FileNode
&
fn
)
:
channel
((
int
)
fn
[
SC_F_CHANNEL
])
Feature
(
const
cv
::
FileNode
&
fn
,
bool
useBoxes
=
false
)
:
channel
((
int
)
fn
[
SC_F_CHANNEL
])
{
cv
::
FileNode
rn
=
fn
[
SC_F_RECT
];
cv
::
FileNodeIterator
r_it
=
rn
.
begin
();
...
...
@@ -99,7 +99,10 @@ struct Feature
int
h
=
*
r_it
++
;
// ToDo: fix me
rect
=
cv
::
Rect
(
x
,
y
,
w
+
x
,
h
+
y
);
if
(
useBoxes
)
rect
=
cv
::
Rect
(
x
,
y
,
w
,
h
);
else
rect
=
cv
::
Rect
(
x
,
y
,
w
+
x
,
h
+
x
);
// 1 / area
rarea
=
1.
f
/
((
rect
.
width
-
rect
.
x
)
*
(
rect
.
height
-
rect
.
y
));
...
...
@@ -353,10 +356,15 @@ struct cv::SCascade::Fields
static
const
char
*
const
SC_SHRINKAGE
=
"shrinkage"
;
static
const
char
*
const
FEATURE_FORMAT
=
"featureFormat"
;
// only Ada Boost supported
std
::
string
stageTypeStr
=
(
string
)
root
[
SC_STAGE_TYPE
];
CV_Assert
(
stageTypeStr
==
SC_BOOST
);
std
::
string
fformat
=
(
string
)
root
[
FEATURE_FORMAT
];
bool
useBoxes
=
(
fformat
==
"BOX"
);
// only HOG-like integral channel features cupported
string
featureTypeStr
=
(
string
)
root
[
SC_FEATURE_TYPE
];
CV_Assert
(
featureTypeStr
==
SC_ICF
);
...
...
@@ -403,7 +411,7 @@ struct cv::SCascade::Fields
st
=
ffs
.
begin
(),
st_end
=
ffs
.
end
();
for
(;
st
!=
st_end
;
++
st
)
features
.
push_back
(
Feature
(
*
st
));
features
.
push_back
(
Feature
(
*
st
,
useBoxes
));
}
return
true
;
...
...
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