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
e09694bd
Commit
e09694bd
authored
Dec 19, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrated 128x256 scale
parent
3e7965a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
softcascade.cpp
modules/objdetect/src/softcascade.cpp
+15
-7
No files found.
modules/objdetect/src/softcascade.cpp
View file @
e09694bd
...
...
@@ -41,6 +41,7 @@
//M*/
#include "precomp.hpp"
#include <iostream>
namespace
{
...
...
@@ -56,7 +57,6 @@ struct Octave
float
scale
;
cv
::
Size
size
;
int
shrinkage
;
static
const
char
*
const
SC_OCT_SCALE
;
static
const
char
*
const
SC_OCT_WEAKS
;
...
...
@@ -111,7 +111,6 @@ struct Feature
static
const
char
*
const
SC_F_CHANNEL
;
static
const
char
*
const
SC_F_RECT
;
};
const
char
*
const
Octave
::
SC_OCT_SCALE
=
"scale"
;
...
...
@@ -140,6 +139,8 @@ struct Level
workRect
(
cv
::
Size
(
cvRound
(
w
/
(
float
)
shrinkage
),
cvRound
(
h
/
(
float
)
shrinkage
))),
objSize
(
cv
::
Size
(
cvRound
(
oct
.
size
.
width
*
relScale
),
cvRound
(
oct
.
size
.
height
*
relScale
)))
{
std
::
cout
<<
"Level "
<<
oct
.
scale
<<
" "
<<
scale
<<
" "
<<
shrinkage
<<
" "
<<
w
<<
" "
<<
h
<<
std
::
endl
;
scaling
[
0
]
=
((
relScale
>=
1.
f
)
?
1.
f
:
(
0.89
f
*
pow
(
relScale
,
1.099
f
/
log
(
2.
f
))))
/
(
relScale
*
relScale
);
scaling
[
1
]
=
1.
f
;
scaleshift
=
static_cast
<
int
>
(
relScale
*
(
1
<<
16
));
...
...
@@ -242,7 +243,7 @@ struct cv::SCascade::Fields
const
Octave
&
octave
=
*
(
level
.
octave
);
int
stBegin
=
octave
.
index
*
octave
.
weaks
,
stEnd
=
stBegin
+
((
octave
.
index
)
?
1024
:
416
;
int
stBegin
=
octave
.
index
*
octave
.
weaks
,
stEnd
=
stBegin
+
((
octave
.
index
)
?
1024
:
416
)
;
int
st
=
stBegin
;
int
offset
=
(
octave
.
index
)
?
-
2
:
0
;
...
...
@@ -362,7 +363,6 @@ struct cv::SCascade::Fields
static
const
char
*
const
SC_INTERNAL
=
"internalNodes"
;
static
const
char
*
const
SC_LEAF
=
"leafValues"
;
// only Ada Boost supported
std
::
string
stageTypeStr
=
(
string
)
root
[
SC_STAGE_TYPE
];
CV_Assert
(
stageTypeStr
==
SC_BOOST
);
...
...
@@ -412,7 +412,7 @@ struct cv::SCascade::Fields
fns
=
(
*
st
)[
SC_LEAF
];
inIt
=
fns
.
begin
(),
inIt_end
=
fns
.
end
();
int
l
=
0
;
//
int l = 0;
for
(;
inIt
!=
inIt_end
;
++
inIt
)
{
leaves
.
push_back
((
float
)(
*
inIt
));
...
...
@@ -430,9 +430,15 @@ struct cv::SCascade::Fields
feature_offset
+=
octave
.
weaks
*
3
;
++
octIndex
;
std
::
cout
<<
"octaves "
<<
octaves
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"stages "
<<
stages
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"nodes "
<<
nodes
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"leaves "
<<
leaves
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"features "
<<
features
.
size
()
<<
std
::
endl
;
}
shrinkage
=
octaves
[
0
].
shrinkage
;
// exit(0)
;
return
true
;
}
};
...
...
@@ -518,7 +524,9 @@ void cv::SCascade::detectNoRoi(const cv::Mat& image, std::vector<Detection>& obj
{
const
Level
&
level
=
*
it
;
if
(
i
++
==
26
)
return
;
if
(
level
.
octave
->
index
!=
2
)
continue
;
std
::
cout
<<
level
.
origScale
<<
std
::
endl
;
for
(
int
dy
=
0
;
dy
<
level
.
workRect
.
height
;
++
dy
)
{
...
...
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