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
57e4fd20
"git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "b622fb2e29f44d64a704b91a07b659ef7f6a9397"
Commit
57e4fd20
authored
May 25, 2018
by
Davis King
Browse files
Added a .add_overlay_circle() to dlib.image_window.
parent
91e64dfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
tools/python/src/gui.cpp
tools/python/src/gui.cpp
+15
-0
No files found.
tools/python/src/gui.cpp
View file @
57e4fd20
...
@@ -79,6 +79,17 @@ void add_overlay_line (
...
@@ -79,6 +79,17 @@ void add_overlay_line (
win
.
add_overlay
(
l
,
color
);
win
.
add_overlay
(
l
,
color
);
}
}
template
<
typename
point_type
>
void
add_overlay_circle
(
image_window
&
win
,
const
point_type
&
c
,
const
double
radius
,
const
rgb_pixel
&
color
)
{
win
.
add_overlay
(
image_window
::
overlay_circle
(
c
,
std
::
round
(
radius
),
color
));
}
template
<
typename
T
>
template
<
typename
T
>
std
::
shared_ptr
<
image_window
>
make_image_window_from_image
(
const
numpy_image
<
T
>&
img
)
std
::
shared_ptr
<
image_window
>
make_image_window_from_image
(
const
numpy_image
<
T
>&
img
)
{
{
...
@@ -161,6 +172,10 @@ void bind_gui(py::module& m)
...
@@ -161,6 +172,10 @@ void bind_gui(py::module& m)
"Add full_object_detection parts to the image window. They will be displayed as blue lines by default, but the color can be passed."
)
"Add full_object_detection parts to the image window. They will be displayed as blue lines by default, but the color can be passed."
)
.
def
(
"add_overlay"
,
add_overlay_line
,
py
::
arg
(
"line"
),
py
::
arg
(
"color"
)
=
rgb_pixel
(
255
,
0
,
0
),
.
def
(
"add_overlay"
,
add_overlay_line
,
py
::
arg
(
"line"
),
py
::
arg
(
"color"
)
=
rgb_pixel
(
255
,
0
,
0
),
"Add line to the image window."
)
"Add line to the image window."
)
.
def
(
"add_overlay_circle"
,
add_overlay_circle
<
point
>
,
py
::
arg
(
"center"
),
py
::
arg
(
"radius"
),
py
::
arg
(
"color"
)
=
rgb_pixel
(
255
,
0
,
0
),
"Add circle to the image window."
)
.
def
(
"add_overlay_circle"
,
add_overlay_circle
<
dpoint
>
,
py
::
arg
(
"center"
),
py
::
arg
(
"radius"
),
py
::
arg
(
"color"
)
=
rgb_pixel
(
255
,
0
,
0
),
"Add circle to the image window."
)
.
def
(
"wait_until_closed"
,
&
type
::
wait_until_closed
,
.
def
(
"wait_until_closed"
,
&
type
::
wait_until_closed
,
"This function blocks until the window is closed."
);
"This function blocks until the window is closed."
);
}
}
...
...
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