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
673ccbbf
Commit
673ccbbf
authored
Oct 02, 2013
by
Davis King
Browse files
Made interpolate_bilinear a little bit faster.
parent
e3a43652
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+5
-5
No files found.
dlib/image_transforms/interpolation.h
View file @
673ccbbf
...
@@ -60,18 +60,18 @@ namespace dlib
...
@@ -60,18 +60,18 @@ namespace dlib
{
{
COMPILE_TIME_ASSERT
(
pixel_traits
<
typename
image_type
::
type
>::
has_alpha
==
false
);
COMPILE_TIME_ASSERT
(
pixel_traits
<
typename
image_type
::
type
>::
has_alpha
==
false
);
const
long
top
=
static_cast
<
long
>
(
std
::
floor
(
p
.
y
()));
const
long
bottom
=
static_cast
<
long
>
(
std
::
ceil
(
p
.
y
()));
const
long
left
=
static_cast
<
long
>
(
std
::
floor
(
p
.
x
()));
const
long
left
=
static_cast
<
long
>
(
std
::
floor
(
p
.
x
()));
const
long
right
=
static_cast
<
long
>
(
std
::
ceil
(
p
.
x
()));
const
long
top
=
static_cast
<
long
>
(
std
::
floor
(
p
.
y
()));
const
long
right
=
left
+
1
;
const
long
bottom
=
top
+
1
;
// if the interpolation goes outside img
// if the interpolation goes outside img
if
(
!
get_rect
(
img
).
contains
(
rectangle
(
left
,
top
,
right
,
bottom
)))
if
(
!
get_rect
(
img
).
contains
(
rectangle
(
left
,
top
,
right
,
bottom
)))
return
false
;
return
false
;
const
double
lr_frac
=
p
.
x
()
-
std
::
floor
(
p
.
x
())
;
const
double
lr_frac
=
p
.
x
()
-
left
;
const
double
tb_frac
=
p
.
y
()
-
std
::
floor
(
p
.
y
())
;
const
double
tb_frac
=
p
.
y
()
-
top
;
double
tl
=
0
,
tr
=
0
,
bl
=
0
,
br
=
0
;
double
tl
=
0
,
tr
=
0
,
bl
=
0
,
br
=
0
;
...
...
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