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
8194f4ab
"git@developer.sourcefind.cn:OpenDAS/torch-sparce.git" did not exist on "b2ba34bde9229613559af6c8d5789dbdc6124f77"
Commit
8194f4ab
authored
Nov 19, 2013
by
Davis King
Browse files
Fixed off by one bug in resize_image()
parent
be6a1be4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+6
-4
No files found.
dlib/image_transforms/interpolation.h
View file @
8194f4ab
...
...
@@ -650,8 +650,7 @@ namespace dlib
const
simd4f
_x_scale
=
4
*
x_scale
;
simd4f
_x
(
x
,
x
+
x_scale
,
x
+
2
*
x_scale
,
x
+
3
*
x_scale
);
long
c
=
0
;
const
long
num_simd_blocks
=
static_cast
<
long
>
(
out_img
.
nc
()
-
3
*
x_scale
)
-
1
;
for
(;
c
<
num_simd_blocks
;
c
+=
4
)
for
(;;
c
+=
4
)
{
_x
+=
_x_scale
;
simd4i
left
=
simd4i
(
_x
);
...
...
@@ -670,6 +669,8 @@ namespace dlib
left
.
store
(
fleft
);
right
.
store
(
fright
);
if
(
fright
[
3
]
>=
in_img
.
nc
())
break
;
simd4f
tl
(
in_img
[
top
][
fleft
[
0
]],
in_img
[
top
][
fleft
[
1
]],
in_img
[
top
][
fleft
[
2
]],
in_img
[
top
][
fleft
[
3
]]);
simd4f
tr
(
in_img
[
top
][
fright
[
0
]],
in_img
[
top
][
fright
[
1
]],
in_img
[
top
][
fright
[
2
]],
in_img
[
top
][
fright
[
3
]]);
simd4f
bl
(
in_img
[
bottom
][
fleft
[
0
]],
in_img
[
bottom
][
fleft
[
1
]],
in_img
[
bottom
][
fleft
[
2
]],
in_img
[
bottom
][
fleft
[
3
]]);
...
...
@@ -748,8 +749,7 @@ namespace dlib
const
simd4f
_x_scale
=
4
*
x_scale
;
simd4f
_x
(
x
,
x
+
x_scale
,
x
+
2
*
x_scale
,
x
+
3
*
x_scale
);
long
c
=
0
;
const
long
num_simd_blocks
=
static_cast
<
long
>
(
out_img
.
nc
()
-
3
*
x_scale
)
-
1
;
for
(;
c
<
num_simd_blocks
;
c
+=
4
)
for
(;;
c
+=
4
)
{
_x
+=
_x_scale
;
simd4i
left
=
simd4i
(
_x
);
...
...
@@ -767,6 +767,8 @@ namespace dlib
left
.
store
(
fleft
);
right
.
store
(
fright
);
if
(
fright
[
3
]
>=
in_img
.
nc
())
break
;
simd4f
tl
(
in_img
[
top
][
fleft
[
0
]].
red
,
in_img
[
top
][
fleft
[
1
]].
red
,
in_img
[
top
][
fleft
[
2
]].
red
,
in_img
[
top
][
fleft
[
3
]].
red
);
simd4f
tr
(
in_img
[
top
][
fright
[
0
]].
red
,
in_img
[
top
][
fright
[
1
]].
red
,
in_img
[
top
][
fright
[
2
]].
red
,
in_img
[
top
][
fright
[
3
]].
red
);
simd4f
bl
(
in_img
[
bottom
][
fleft
[
0
]].
red
,
in_img
[
bottom
][
fleft
[
1
]].
red
,
in_img
[
bottom
][
fleft
[
2
]].
red
,
in_img
[
bottom
][
fleft
[
3
]].
red
);
...
...
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