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