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
46079862
Commit
46079862
authored
May 02, 2018
by
Guillaume "Vermeille" Sanchez
Committed by
Davis E. King
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parallelize image rotations (#1281)
parent
46052db0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
array_kernel.h
dlib/array/array_kernel.h
+1
-0
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