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
0f169ed7
Commit
0f169ed7
authored
Jul 03, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just a bit of code cleanup
parent
ee5bb2a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
17 deletions
+5
-17
main.cpp
tools/imglab/src/main.cpp
+5
-17
No files found.
tools/imglab/src/main.cpp
View file @
0f169ed7
...
...
@@ -342,25 +342,13 @@ void rotate_dataset(const command_line_parser& parser)
save_png
(
temp
,
filename
);
}
rectangle_transform
rtran
=
tran
;
for
(
unsigned
long
j
=
0
;
j
<
metadata
.
images
[
i
].
boxes
.
size
();
++
j
)
{
const
rectangle
rect
=
metadata
.
images
[
i
].
boxes
[
j
].
rect
;
rectangle
newrect
;
newrect
+=
tran
(
rect
.
tl_corner
());
newrect
+=
tran
(
rect
.
tr_corner
());
newrect
+=
tran
(
rect
.
bl_corner
());
newrect
+=
tran
(
rect
.
br_corner
());
// now make newrect have the same area as the starting rect.
double
ratio
=
std
::
sqrt
(
rect
.
area
()
/
(
double
)
newrect
.
area
());
newrect
=
centered_rect
(
newrect
,
newrect
.
width
()
*
ratio
,
newrect
.
height
()
*
ratio
);
metadata
.
images
[
i
].
boxes
[
j
].
rect
=
newrect
;
// rotate all the object parts
std
::
map
<
std
::
string
,
point
>::
iterator
k
;
for
(
k
=
metadata
.
images
[
i
].
boxes
[
j
].
parts
.
begin
();
k
!=
metadata
.
images
[
i
].
boxes
[
j
].
parts
.
end
();
++
k
)
{
k
->
second
=
tran
(
k
->
second
);
}
metadata
.
images
[
i
].
boxes
[
j
].
rect
=
rtran
(
metadata
.
images
[
i
].
boxes
[
j
].
rect
);
for
(
auto
&
p
:
metadata
.
images
[
i
].
boxes
[
j
].
parts
)
p
.
second
=
tran
(
p
.
second
);
}
metadata
.
images
[
i
].
filename
=
filename
;
...
...
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