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
f85cd73e
Commit
f85cd73e
authored
Jan 01, 2012
by
Davis King
Browse files
minor cleanup
parent
226f5af1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
15 deletions
+40
-15
dlib/image_keypoint/build_separable_poly_filters.h
dlib/image_keypoint/build_separable_poly_filters.h
+4
-4
dlib/image_keypoint/poly_image.h
dlib/image_keypoint/poly_image.h
+19
-5
dlib/image_keypoint/poly_image_abstract.h
dlib/image_keypoint/poly_image_abstract.h
+17
-6
No files found.
dlib/image_keypoint/build_separable_poly_filters.h
View file @
f85cd73e
...
...
@@ -19,8 +19,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
std
::
vector
<
std
::
vector
<
separable_filter_type
>
>
build_separable_poly_filters
(
const
long
window_size
,
const
long
order
=
2
const
long
order
,
const
long
window_size
)
/*!
requires
...
...
@@ -137,8 +137,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
std
::
vector
<
std
::
vector
<
separable_int32_filter_type
>
>
build_separable_int32_poly_filters
(
const
long
order
,
const
long
window_size
,
const
long
order
=
2
,
const
double
max_range
=
300.0
)
/*!
...
...
@@ -150,7 +150,7 @@ namespace dlib
- the "first" element is the row_filter, the second is the col_filter.
!*/
{
const
std
::
vector
<
std
::
vector
<
separable_filter_type
>
>&
filters
=
build_separable_poly_filters
(
window_size
,
order
);
const
std
::
vector
<
std
::
vector
<
separable_filter_type
>
>&
filters
=
build_separable_poly_filters
(
order
,
window_size
);
std
::
vector
<
std
::
vector
<
separable_int32_filter_type
>
>
int_filters
(
filters
.
size
());
for
(
unsigned
long
i
=
0
;
i
<
filters
.
size
();
++
i
)
...
...
dlib/image_keypoint/poly_image.h
View file @
f85cd73e
...
...
@@ -25,6 +25,14 @@ namespace dlib
public:
typedef
matrix
<
double
,
0
,
1
>
descriptor_type
;
poly_image
(
long
order_
,
long
window_size_
)
{
setup
(
order_
,
window_size_
);
}
poly_image
(
)
{
...
...
@@ -40,7 +48,7 @@ namespace dlib
border_size
=
(
long
)
std
::
ceil
(
std
::
floor
(
window_size
/
2.0
)
/
downsample
);
num_rows
=
0
;
num_cols
=
0
;
filters
=
build_separable_poly_filters
(
window_size
,
order
);
filters
=
build_separable_poly_filters
(
order
,
window_size
);
}
long
get_order
(
...
...
@@ -77,7 +85,7 @@ namespace dlib
border_size
=
(
long
)
std
::
ceil
(
std
::
floor
(
window_size
/
2.0
)
/
downsample
);
num_rows
=
0
;
num_cols
=
0
;
filters
=
build_separable_poly_filters
(
window_size
,
order
);
filters
=
build_separable_poly_filters
(
order
,
window_size
);
}
void
copy_configuration
(
...
...
@@ -221,25 +229,31 @@ namespace dlib
friend
void
serialize
(
const
poly_image
&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
poly_coef
,
out
);
serialize
(
item
.
order
,
out
);
serialize
(
item
.
window_size
,
out
);
serialize
(
item
.
border_size
,
out
);
serialize
(
item
.
num_rows
,
out
);
serialize
(
item
.
num_cols
,
out
);
serialize
(
item
.
filters
,
out
);
}
friend
void
deserialize
(
poly_image
&
item
,
std
::
istream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
dlib
::
serialization_error
(
"Unexpected version found while deserializing dlib::poly_image"
);
deserialize
(
item
.
poly_coef
,
in
);
deserialize
(
item
.
order
,
in
);
deserialize
(
item
.
window_size
,
in
);
deserialize
(
item
.
border_size
,
in
);
deserialize
(
item
.
num_rows
,
in
);
deserialize
(
item
.
num_cols
,
in
);
// just rebuild the filters instead of loading them
item
.
filters
=
build_separable_poly_filters
(
item
.
window_size
,
item
.
order
);
deserialize
(
item
.
filters
,
in
);
}
private:
...
...
dlib/image_keypoint/poly_image_abstract.h
View file @
f85cd73e
...
...
@@ -19,11 +19,6 @@ namespace dlib
REQUIREMENTS ON TEMPLATE PARAMETERS
- downsample >= 1
INITIAL VALUE
- size() == 0
- get_order() == 3
- get_window_size() == 13
WHAT THIS OBJECT REPRESENTS
This object is a tool for extracting local feature descriptors from an image.
In particular, it fits a polynomial to every local pixel patch in an image and
...
...
@@ -54,7 +49,23 @@ namespace dlib
);
/*!
ensures
- this object is properly initialized
- #get_order() == 3
- #get_window_size() == 13
- #size() == 0
!*/
poly_image
(
long
order
,
long
window_size
);
/*!
requires
- 1 <= order <= 6
- window_size >= 3 && window_size is odd
ensures
- #get_order() == order
- #get_window_size() == window_size
- #size() == 0
!*/
void
clear
(
...
...
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