Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
f10c3389
Commit
f10c3389
authored
Nov 01, 2013
by
Davis King
Browse files
Added another draw_fhog() overload.
parent
555b7c8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
dlib/image_transforms/fhog.h
dlib/image_transforms/fhog.h
+27
-0
dlib/image_transforms/fhog_abstract.h
dlib/image_transforms/fhog_abstract.h
+17
-0
No files found.
dlib/image_transforms/fhog.h
View file @
f10c3389
...
@@ -494,6 +494,33 @@ namespace dlib
...
@@ -494,6 +494,33 @@ namespace dlib
return
matrix_cast
<
unsigned
char
>
(
upperbound
(
round
(
himg
*
255
/
thresh
),
255
));
return
matrix_cast
<
unsigned
char
>
(
upperbound
(
round
(
himg
*
255
/
thresh
),
255
));
}
}
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
matrix
<
unsigned
char
>
draw_fhog
(
const
std
::
vector
<
matrix
<
T
>
>&
hog
,
const
long
w
=
15
)
{
// Just convert the input into the right object and then call the above draw_fhog()
// function on it.
dlib
::
array
<
array2d
<
T
>
>
temp
(
hog
.
size
());
for
(
unsigned
long
i
=
0
;
i
<
temp
.
size
();
++
i
)
{
temp
[
i
].
set_size
(
hog
[
i
].
nr
(),
hog
[
i
].
nc
());
for
(
long
r
=
0
;
r
<
hog
[
i
].
nr
();
++
r
)
{
for
(
long
c
=
0
;
c
<
hog
[
i
].
nc
();
++
c
)
{
temp
[
i
][
r
][
c
]
=
hog
[
i
](
r
,
c
);
}
}
}
return
draw_fhog
(
temp
,
w
);
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
template
<
...
...
dlib/image_transforms/fhog_abstract.h
View file @
f10c3389
...
@@ -175,6 +175,23 @@ namespace dlib
...
@@ -175,6 +175,23 @@ namespace dlib
pixels wide and tall.
pixels wide and tall.
!*/
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
matrix
<
unsigned
char
>
draw_fhog
(
const
std
::
vector
<
matrix
<
T
>
>&
hog
,
const
long
cell_draw_size
=
15
);
/*!
requires
- cell_draw_size > 0
ensures
- This function just converts the given hog object into an array<array2d<T>>
and passes it to the above draw_fhog() routine and returns the results.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
template
<
...
...
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