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
725805a3
Commit
725805a3
authored
Mar 01, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filled out spec
parent
20837ab9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
interpolation.h
dlib/image_transforms/interpolation.h
+16
-16
interpolation_abstract.h
dlib/image_transforms/interpolation_abstract.h
+0
-0
No files found.
dlib/image_transforms/interpolation.h
View file @
725805a3
...
...
@@ -321,7 +321,7 @@ namespace dlib
typename
background_type
>
void
transform_image
(
const
image_type
&
img
,
const
image_type
&
i
n_i
mg
,
image_type
&
out_img
,
const
interpolation_type
&
interp
,
const
point_mapping_type
&
map_point
,
...
...
@@ -332,14 +332,14 @@ namespace dlib
requires
- get_rect(out_img).contains(area) == true
ensures
- map_point maps from out_img to img
- map_point maps from out_img to i
n_i
mg
!*/
{
for
(
long
r
=
area
.
top
();
r
<=
area
.
bottom
();
++
r
)
{
for
(
long
c
=
area
.
left
();
c
<=
area
.
right
();
++
c
)
{
if
(
!
interp
(
img
,
map_point
(
dlib
::
vector
<
double
,
2
>
(
c
,
r
)),
out_img
[
r
][
c
]))
if
(
!
interp
(
i
n_i
mg
,
map_point
(
dlib
::
vector
<
double
,
2
>
(
c
,
r
)),
out_img
[
r
][
c
]))
set_background
(
out_img
[
r
][
c
]);
}
}
...
...
@@ -354,14 +354,14 @@ namespace dlib
typename
background_type
>
void
transform_image
(
const
image_type
&
img
,
const
image_type
&
i
n_i
mg
,
image_type
&
out_img
,
const
interpolation_type
&
interp
,
const
point_mapping_type
&
map_point
,
const
background_type
&
set_background
)
{
transform_image
(
img
,
out_img
,
interp
,
map_point
,
set_background
,
get_rect
(
out_img
));
transform_image
(
i
n_i
mg
,
out_img
,
interp
,
map_point
,
set_background
,
get_rect
(
out_img
));
}
// ----------------------------------------------------------------------------------------
...
...
@@ -372,13 +372,13 @@ namespace dlib
typename
point_mapping_type
>
void
transform_image
(
const
image_type
&
img
,
const
image_type
&
i
n_i
mg
,
image_type
&
out_img
,
const
interpolation_type
&
interp
,
const
point_mapping_type
&
map_point
)
{
transform_image
(
img
,
out_img
,
interp
,
map_point
,
black_background
(),
get_rect
(
out_img
));
transform_image
(
i
n_i
mg
,
out_img
,
interp
,
map_point
,
black_background
(),
get_rect
(
out_img
));
}
// ----------------------------------------------------------------------------------------
...
...
@@ -388,13 +388,13 @@ namespace dlib
typename
interpolation_type
>
void
rotate_image
(
const
image_type
&
img
,
const
image_type
&
i
n_i
mg
,
image_type
&
out_img
,
double
angle
,
const
interpolation_type
&
interp
)
{
const
rectangle
rimg
=
get_rect
(
img
);
const
rectangle
rimg
=
get_rect
(
i
n_i
mg
);
// figure out bounding box for rotated rectangle
...
...
@@ -407,7 +407,7 @@ namespace dlib
const
matrix
<
double
,
2
,
2
>
R
=
rotation_matrix
(
angle
);
transform_image
(
img
,
out_img
,
interp
,
transform_image
(
i
n_i
mg
,
out_img
,
interp
,
point_transform_affine
(
R
,
-
R
*
dcenter
(
get_rect
(
out_img
))
+
dcenter
(
rimg
)));
}
...
...
@@ -418,12 +418,12 @@ namespace dlib
typename
image_type
>
void
rotate_image
(
const
image_type
&
img
,
const
image_type
&
i
n_i
mg
,
image_type
&
out_img
,
double
angle
)
{
rotate_image
(
img
,
out_img
,
angle
,
interpolate_quadratic
());
rotate_image
(
i
n_i
mg
,
out_img
,
angle
,
interpolate_quadratic
());
}
// ----------------------------------------------------------------------------------------
...
...
@@ -432,11 +432,11 @@ namespace dlib
typename
image_type
>
void
flip_image_left_right
(
const
image_type
&
img
,
const
image_type
&
i
n_i
mg
,
image_type
&
out_img
)
{
assign_image
(
out_img
,
fliplr
(
array_to_matrix
(
img
)));
assign_image
(
out_img
,
fliplr
(
array_to_matrix
(
i
n_i
mg
)));
}
// ----------------------------------------------------------------------------------------
...
...
@@ -445,11 +445,11 @@ namespace dlib
typename
image_type
>
void
flip_image_up_down
(
const
image_type
&
img
,
const
image_type
&
i
n_i
mg
,
image_type
&
out_img
)
{
assign_image
(
out_img
,
flipud
(
array_to_matrix
(
img
)));
assign_image
(
out_img
,
flipud
(
array_to_matrix
(
i
n_i
mg
)));
}
// ----------------------------------------------------------------------------------------
...
...
dlib/image_transforms/interpolation_abstract.h
View file @
725805a3
This diff is collapsed.
Click to expand it.
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