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
9e5698b9
Commit
9e5698b9
authored
Feb 25, 2013
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lying assertation and hard-coded shrinkage
parent
f783f34e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
softcascade.hpp
...s/softcascade/include/opencv2/softcascade/softcascade.hpp
+1
-1
integral_channel_builder.cpp
modules/softcascade/src/integral_channel_builder.cpp
+9
-8
softcascade.cpp
modules/softcascade/src/softcascade.cpp
+3
-2
No files found.
modules/softcascade/include/opencv2/softcascade/softcascade.hpp
View file @
9e5698b9
...
...
@@ -126,7 +126,7 @@ public:
virtual
~
ChannelFeatureBuilder
();
// apply channels to source frame
CV_WRAP_AS
(
compute
)
virtual
void
operator
()(
InputArray
src
,
CV_OUT
OutputArray
channels
)
const
=
0
;
CV_WRAP_AS
(
compute
)
virtual
void
operator
()(
InputArray
src
,
CV_OUT
OutputArray
channels
,
cv
::
Size
channelsSize
=
cv
::
Size
()
)
const
=
0
;
CV_WRAP
static
cv
::
Ptr
<
ChannelFeatureBuilder
>
create
();
};
...
...
modules/softcascade/src/integral_channel_builder.cpp
View file @
9e5698b9
...
...
@@ -51,14 +51,20 @@ class ICFBuilder : public ChannelFeatureBuilder
virtual
~
ICFBuilder
()
{}
virtual
cv
::
AlgorithmInfo
*
info
()
const
;
virtual
void
operator
()(
cv
::
InputArray
_frame
,
CV_OUT
cv
::
OutputArray
_integrals
)
const
virtual
void
operator
()(
cv
::
InputArray
_frame
,
CV_OUT
cv
::
OutputArray
_integrals
,
cv
::
Size
channelsSize
)
const
{
CV_Assert
(
_frame
.
type
()
==
CV_8UC3
);
cv
::
Mat
frame
=
_frame
.
getMat
();
int
h
=
frame
.
rows
;
int
w
=
frame
.
cols
;
_integrals
.
create
(
h
/
4
*
10
+
1
,
w
/
4
+
1
,
CV_32SC1
);
if
(
channelsSize
!=
cv
::
Size
())
_integrals
.
create
(
channelsSize
.
height
*
10
+
1
,
channelsSize
.
width
+
1
,
CV_32SC1
);
if
(
_integrals
.
empty
())
_integrals
.
create
(
frame
.
rows
*
10
+
1
,
frame
.
cols
+
1
,
CV_32SC1
);
cv
::
Mat
&
integrals
=
_integrals
.
getMatRef
();
cv
::
Mat
channels
,
gray
;
...
...
@@ -98,12 +104,7 @@ class ICFBuilder : public ChannelFeatureBuilder
for
(
int
i
=
0
;
i
<
3
;
++
i
)
splited
.
push_back
(
channels
(
cv
::
Rect
(
0
,
h
*
(
7
+
i
),
w
,
h
)));
split
(
luv
,
splited
);
float
shrinkage
=
static_cast
<
float
>
(
integrals
.
cols
-
1
)
/
channels
.
cols
;
CV_Assert
(
shrinkage
==
0.25
);
cv
::
resize
(
channels
,
shrunk
,
cv
::
Size
(),
shrinkage
,
shrinkage
,
CV_INTER_AREA
);
cv
::
resize
(
channels
,
shrunk
,
cv
::
Size
(
integrals
.
cols
-
1
,
integrals
.
rows
-
1
),
-
1
,
-
1
,
CV_INTER_AREA
);
cv
::
integral
(
shrunk
,
integrals
,
cv
::
noArray
(),
CV_32S
);
}
};
...
...
modules/softcascade/src/softcascade.cpp
View file @
9e5698b9
...
...
@@ -189,11 +189,12 @@ struct ChannelStorage
ChannelStorage
(
const
cv
::
Mat
&
colored
,
int
shr
)
:
shrinkage
(
shr
)
{
model_height
=
cvRound
(
colored
.
rows
/
(
float
)
shrinkage
);
builder
=
ChannelFeatureBuilder
::
create
();
(
*
builder
)(
colored
,
hog
);
(
*
builder
)(
colored
,
hog
,
cv
::
Size
(
cvRound
(
colored
.
cols
/
(
float
)
shrinkage
),
model_height
)
);
step
=
hog
.
step1
();
model_height
=
colored
.
rows
/
shrinkage
;
}
float
get
(
const
int
channel
,
const
cv
::
Rect
&
area
)
const
...
...
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