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
de361671
Commit
de361671
authored
Oct 18, 2013
by
Davis King
Browse files
Added overloads of fhog_to_image() and image_to_fhog() that work on rectangles.
parent
075ed638
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
dlib/image_transforms/fhog.h
dlib/image_transforms/fhog.h
+22
-0
dlib/image_transforms/fhog_abstract.h
dlib/image_transforms/fhog_abstract.h
+28
-0
No files found.
dlib/image_transforms/fhog.h
View file @
de361671
...
@@ -415,6 +415,17 @@ namespace dlib
...
@@ -415,6 +415,17 @@ namespace dlib
return
p
/
cell_size
-
point
(
1
,
1
);
return
p
/
cell_size
-
point
(
1
,
1
);
}
}
// ----------------------------------------------------------------------------------------
inline
rectangle
image_to_fhog
(
const
rectangle
&
rect
,
int
cell_size
=
8
)
{
return
rectangle
(
image_to_fhog
(
rect
.
tl_corner
(),
cell_size
),
image_to_fhog
(
rect
.
br_corner
(),
cell_size
));
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
inline
point
fhog_to_image
(
inline
point
fhog_to_image
(
...
@@ -426,6 +437,17 @@ namespace dlib
...
@@ -426,6 +437,17 @@ namespace dlib
return
(
p
+
point
(
1
,
1
))
*
cell_size
+
point
(
1
,
1
)
+
point
(
cell_size
/
2
,
cell_size
/
2
);
return
(
p
+
point
(
1
,
1
))
*
cell_size
+
point
(
1
,
1
)
+
point
(
cell_size
/
2
,
cell_size
/
2
);
}
}
// ----------------------------------------------------------------------------------------
inline
rectangle
fhog_to_image
(
const
rectangle
&
rect
,
int
cell_size
=
8
)
{
return
rectangle
(
fhog_to_image
(
rect
.
tl_corner
(),
cell_size
),
fhog_to_image
(
rect
.
br_corner
(),
cell_size
));
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/image_transforms/fhog_abstract.h
View file @
de361671
...
@@ -100,6 +100,20 @@ namespace dlib
...
@@ -100,6 +100,20 @@ namespace dlib
input image.
input image.
!*/
!*/
// ----------------------------------------------------------------------------------------
inline
rectangle
image_to_fhog
(
const
rectangle
&
rect
,
int
cell_size
=
8
);
/*!
requires
- cell_size > 0
ensures
- maps a rectangle from image space to fhog space. In particular this function returns:
rectangle(image_to_fhog(rect.tl_corner(),cell_size), image_to_fhog(rect.br_corner(),cell_size))
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
inline
point
fhog_to_image
(
inline
point
fhog_to_image
(
...
@@ -118,6 +132,20 @@ namespace dlib
...
@@ -118,6 +132,20 @@ namespace dlib
cell_size should be set to the value used by the call to extract_fhog_features().
cell_size should be set to the value used by the call to extract_fhog_features().
!*/
!*/
// ----------------------------------------------------------------------------------------
inline
rectangle
fhog_to_image
(
const
rectangle
&
rect
,
int
cell_size
=
8
);
/*!
requires
- cell_size > 0
ensures
- maps a rectangle from fhog space to image space. In particular this function returns:
rectangle(fhog_to_image(rect.tl_corner(),cell_size), fhog_to_image(rect.br_corner(),cell_size))
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
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