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
46079862
Commit
46079862
authored
May 02, 2018
by
Guillaume "Vermeille" Sanchez
Committed by
Davis E. King
May 01, 2018
Browse files
parallelize image rotations (#1281)
parent
46052db0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
dlib/array/array_kernel.h
dlib/array/array_kernel.h
+1
-0
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+17
-18
No files found.
dlib/array/array_kernel.h
View file @
46079862
...
...
@@ -90,6 +90,7 @@ namespace dlib
_at_start
(
true
)
{}
array
(
const
array
&
)
=
delete
;
array
(
array
&&
item
)
:
array
()
...
...
dlib/image_transforms/interpolation.h
View file @
46079862
...
...
@@ -3,6 +3,9 @@
#ifndef DLIB_INTERPOlATIONh_
#define DLIB_INTERPOlATIONh_
#include <thread>
#include <algorithm>
#include "interpolation_abstract.h"
#include "../pixel.h"
#include "../matrix.h"
...
...
@@ -1543,33 +1546,29 @@ namespace dlib
<<
"
\n\t
objects2.size(): "
<<
objects2
.
size
()
);
image_array_type
new_images
;
std
::
vector
<
std
::
vector
<
T
>
>
new_objects
;
std
::
vector
<
std
::
vector
<
U
>
>
new_objects2
;
using
namespace
impl
;
using
namespace
impl
;
image_array_type
new_images
(
images
.
size
()
*
angles
.
size
());
std
::
vector
<
std
::
vector
<
T
>>
new_objects
(
images
.
size
()
*
angles
.
size
());
std
::
vector
<
std
::
vector
<
U
>>
new_objects2
(
images
.
size
()
*
angles
.
size
());
std
::
vector
<
T
>
objtemp
;
std
::
vector
<
U
>
objtemp2
;
typename
image_array_type
::
value_type
temp
;
for
(
long
i
=
0
;
i
<
angles
.
size
();
++
i
)
{
for
(
unsigned
long
j
=
0
;
j
<
images
.
size
();
++
j
)
dlib
::
parallel_for
(
0
,
images
.
size
(),
[
&
](
long
j
)
{
typename
image_array_type
::
value_type
temp
;
long
dst_base
=
j
*
angles
.
size
();
for
(
long
i
=
0
;
i
<
angles
.
size
();
++
i
)
{
long
dst
=
dst_base
+
i
;
const
point_transform_affine
tran
=
rotate_image
(
images
[
j
],
temp
,
angles
(
i
));
new_images
.
push_back
(
std
::
move
(
temp
)
)
;
exchange
(
new_images
[
dst
],
temp
);
objtemp
.
clear
();
for
(
unsigned
long
k
=
0
;
k
<
objects
[
j
].
size
();
++
k
)
objtemp
.
push_back
(
tform_object
(
tran
,
objects
[
j
][
k
]));
new_objects
.
push_back
(
objtemp
);
new_objects
[
dst
].
push_back
(
tform_object
(
tran
,
objects
[
j
][
k
]));
objtemp2
.
clear
();
for
(
unsigned
long
k
=
0
;
k
<
objects2
[
j
].
size
();
++
k
)
objtemp2
.
push_back
(
tform_object
(
tran
,
objects2
[
j
][
k
]));
new_objects2
.
push_back
(
objtemp2
);
new_objects2
[
dst
].
push_back
(
tform_object
(
tran
,
objects2
[
j
][
k
]));
}
}
}
);
new_images
.
swap
(
images
);
new_objects
.
swap
(
objects
);
...
...
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