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
0f169ed7
Commit
0f169ed7
authored
Jul 03, 2018
by
Davis King
Browse files
Just a bit of code cleanup
parent
ee5bb2a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
17 deletions
+5
-17
tools/imglab/src/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
;
metadata
.
images
[
i
].
boxes
[
j
].
rect
=
rtran
(
metadata
.
images
[
i
].
boxes
[
j
].
rect
);
// 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
);
}
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