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
7290d857
Commit
7290d857
authored
Aug 30, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ICF feature
parent
fb113e5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
10 deletions
+31
-10
softcascade.cpp
modules/objdetect/src/softcascade.cpp
+31
-10
No files found.
modules/objdetect/src/softcascade.cpp
View file @
7290d857
...
...
@@ -106,13 +106,18 @@ struct Level {
// according to R. Benenson, M. Mathias, R. Timofte and L. Van Gool paper
struct
CascadeIntrinsics
{
static
const
float
lambda
=
1.099
f
/
0.301029996
f
,
a
=
0.89
f
;
static
const
float
lambda
=
1.099
f
,
a
=
0.89
f
;
static
const
float
intrinsics
[
10
][
4
];
static
float
getFor
(
int
chennel
,
int
scaling
,
int
ab
)
static
float
getFor
(
int
chennel
,
float
scaling
)
{
CV_Assert
(
chennel
<
10
&&
scaling
<
2
&&
ab
<
2
);
return
intrinsics
[
chennel
][(
scaling
<<
1
)
+
ab
];
CV_Assert
(
chennel
<
10
);
if
((
scaling
-
1.
f
)
<
FLT_EPSILON
)
return
1.
f
;
int
ud
=
(
int
)(
scaling
<
1.
f
);
return
intrinsics
[
chennel
][(
ud
<<
1
)]
*
pow
(
scaling
,
intrinsics
[
chennel
][(
ud
<<
1
)
+
1
]);
}
};
...
...
@@ -120,12 +125,12 @@ struct Level {
const
float
CascadeIntrinsics
::
intrinsics
[
10
][
4
]
=
{
//da, db, ua, ub
// hog-like orientation bins
{
a
,
lambda
,
1
,
2
},
{
a
,
lambda
,
1
,
2
},
{
a
,
lambda
,
1
,
2
},
{
a
,
lambda
,
1
,
2
},
{
a
,
lambda
,
1
,
2
},
{
a
,
lambda
,
1
,
2
},
{
a
,
lambda
/
log
(
2
)
,
1
,
2
},
{
a
,
lambda
/
log
(
2
)
,
1
,
2
},
{
a
,
lambda
/
log
(
2
)
,
1
,
2
},
{
a
,
lambda
/
log
(
2
)
,
1
,
2
},
{
a
,
lambda
/
log
(
2
)
,
1
,
2
},
{
a
,
lambda
/
log
(
2
)
,
1
,
2
},
// gradient magnitude
{
a
,
lambda
/
log
(
2
),
1
,
2
},
// luv -color chennels
...
...
@@ -133,6 +138,22 @@ struct Level {
{
1
,
2
,
1
,
2
},
{
1
,
2
,
1
,
2
}
};
struct
Feature
{
cv
::
Rect
rect
;
int
channel
;
float
threshold
;
Feature
(
int
x
,
int
y
,
int
w
,
int
h
,
int
c
,
float
t
)
:
rect
(
cv
::
Rect
(
x
,
y
,
w
,
h
)),
channel
(
c
),
threshold
(
t
)
{}
Feature
(
cv
::
Rect
r
,
int
c
,
float
t
)
:
rect
(
r
),
channel
(
c
),
threshold
(
t
)
{}
Feature
rescale
(
float
relScale
)
{
cv
::
Rect
r
(
cvRound
(
rect
.
x
*
relScale
),
cvRound
(
rect
.
y
*
relScale
),
cvRound
(
rect
.
width
*
relScale
),
cvRound
(
rect
.
height
*
relScale
));
return
Feature
(
r
,
channel
,
threshold
*
CascadeIntrinsics
::
getFor
(
channel
,
relScale
));
}
};
}
...
...
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