Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
98cd2a92
Commit
98cd2a92
authored
Mar 26, 2016
by
ray glover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce a configurable threshold for rendering HOGs
parent
7f611ea7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
fhog.h
dlib/image_transforms/fhog.h
+9
-6
No files found.
dlib/image_transforms/fhog.h
View file @
98cd2a92
...
@@ -1058,7 +1058,8 @@ namespace dlib
...
@@ -1058,7 +1058,8 @@ namespace dlib
>
>
matrix
<
unsigned
char
>
draw_fhog
(
matrix
<
unsigned
char
>
draw_fhog
(
const
dlib
::
array
<
array2d
<
T
,
mm1
>
,
mm2
>&
hog
,
const
dlib
::
array
<
array2d
<
T
,
mm1
>
,
mm2
>&
hog
,
const
long
cell_draw_size
=
15
const
long
cell_draw_size
=
15
,
const
float
min_response_threshold
=
0
.
0
)
)
{
{
// make sure requires clause is not broken
// make sure requires clause is not broken
...
@@ -1084,7 +1085,7 @@ namespace dlib
...
@@ -1084,7 +1085,7 @@ namespace dlib
const
float
val
=
hog
[
d
][
r
/
cell_draw_size
][
c
/
cell_draw_size
]
+
const
float
val
=
hog
[
d
][
r
/
cell_draw_size
][
c
/
cell_draw_size
]
+
hog
[
d
+
mbars
.
size
()][
r
/
cell_draw_size
][
c
/
cell_draw_size
]
+
hog
[
d
+
mbars
.
size
()][
r
/
cell_draw_size
][
c
/
cell_draw_size
]
+
hog
[
d
+
mbars
.
size
()
*
2
][
r
/
cell_draw_size
][
c
/
cell_draw_size
];
hog
[
d
+
mbars
.
size
()
*
2
][
r
/
cell_draw_size
][
c
/
cell_draw_size
];
if
(
val
>
0
)
if
(
val
>
min_response_threshold
)
{
{
set_subm
(
himg
,
r
,
c
,
cell_draw_size
,
cell_draw_size
)
+=
val
*
mbars
[
d
%
mbars
.
size
()];
set_subm
(
himg
,
r
,
c
,
cell_draw_size
,
cell_draw_size
)
+=
val
*
mbars
[
d
%
mbars
.
size
()];
}
}
...
@@ -1106,7 +1107,8 @@ namespace dlib
...
@@ -1106,7 +1107,8 @@ namespace dlib
>
>
matrix
<
unsigned
char
>
draw_fhog
(
matrix
<
unsigned
char
>
draw_fhog
(
const
std
::
vector
<
matrix
<
T
>
>&
hog
,
const
std
::
vector
<
matrix
<
T
>
>&
hog
,
const
long
cell_draw_size
=
15
const
long
cell_draw_size
=
15
,
const
float
min_response_threshold
=
0
.
0
)
)
{
{
// make sure requires clause is not broken
// make sure requires clause is not broken
...
@@ -1131,7 +1133,7 @@ namespace dlib
...
@@ -1131,7 +1133,7 @@ namespace dlib
}
}
}
}
}
}
return
draw_fhog
(
temp
,
cell_draw_size
);
return
draw_fhog
(
temp
,
cell_draw_size
,
min_response_threshold
);
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -1142,7 +1144,8 @@ namespace dlib
...
@@ -1142,7 +1144,8 @@ namespace dlib
>
>
matrix
<
unsigned
char
>
draw_fhog
(
matrix
<
unsigned
char
>
draw_fhog
(
const
array2d
<
matrix
<
T
,
31
,
1
>
,
mm
>&
hog
,
const
array2d
<
matrix
<
T
,
31
,
1
>
,
mm
>&
hog
,
const
long
cell_draw_size
=
15
const
long
cell_draw_size
=
15
,
const
float
min_response_threshold
=
0
.
0
)
)
{
{
// make sure requires clause is not broken
// make sure requires clause is not broken
...
@@ -1167,7 +1170,7 @@ namespace dlib
...
@@ -1167,7 +1170,7 @@ namespace dlib
const
float
val
=
hog
[
r
/
cell_draw_size
][
c
/
cell_draw_size
](
d
)
+
const
float
val
=
hog
[
r
/
cell_draw_size
][
c
/
cell_draw_size
](
d
)
+
hog
[
r
/
cell_draw_size
][
c
/
cell_draw_size
](
d
+
mbars
.
size
())
+
hog
[
r
/
cell_draw_size
][
c
/
cell_draw_size
](
d
+
mbars
.
size
())
+
hog
[
r
/
cell_draw_size
][
c
/
cell_draw_size
](
d
+
mbars
.
size
()
*
2
);
hog
[
r
/
cell_draw_size
][
c
/
cell_draw_size
](
d
+
mbars
.
size
()
*
2
);
if
(
val
>
0
)
if
(
val
>
min_response_threshold
)
{
{
set_subm
(
himg
,
r
,
c
,
cell_draw_size
,
cell_draw_size
)
+=
val
*
mbars
[
d
%
mbars
.
size
()];
set_subm
(
himg
,
r
,
c
,
cell_draw_size
,
cell_draw_size
)
+=
val
*
mbars
[
d
%
mbars
.
size
()];
}
}
...
...
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