"git@developer.sourcefind.cn:OpenDAS/dlib.git" did not exist on "0db8713a6d5cb1dd152f31e404f2fefd9e3470b9"
Commit 23343f3d authored by Patrick Snape's avatar Patrick Snape
Browse files

Add overlay overload for drectangle

This is useful for visualizing the tracking results.
parent 60475dda
...@@ -54,6 +54,16 @@ void add_overlay_rect ( ...@@ -54,6 +54,16 @@ void add_overlay_rect (
win.add_overlay(rect, color); win.add_overlay(rect, color);
} }
void add_overlay_drect (
image_window& win,
const drectangle& drect,
const rgb_pixel& color
)
{
rectangle rect(drect.left(), drect.top(), drect.right(), drect.bottom());
win.add_overlay(rect, color);
}
void add_overlay_parts ( void add_overlay_parts (
image_window& win, image_window& win,
const full_object_detection& detection, const full_object_detection& detection,
...@@ -106,6 +116,8 @@ void bind_gui() ...@@ -106,6 +116,8 @@ void bind_gui()
"Add a list of rectangles to the image_window. They will be displayed as red boxes by default, but the color can be passed.") "Add a list of rectangles to the image_window. They will be displayed as red boxes by default, but the color can be passed.")
.def("add_overlay", add_overlay_rect, (arg("rectangle"), arg("color")=rgb_pixel(255, 0, 0)), .def("add_overlay", add_overlay_rect, (arg("rectangle"), arg("color")=rgb_pixel(255, 0, 0)),
"Add a rectangle to the image_window. It will be displayed as a red box by default, but the color can be passed.") "Add a rectangle to the image_window. It will be displayed as a red box by default, but the color can be passed.")
.def("add_overlay", add_overlay_drect, (arg("rectangle"), arg("color")=rgb_pixel(255, 0, 0)),
"Add a rectangle to the image_window. It will be displayed as a red box by default, but the color can be passed.")
.def("add_overlay", add_overlay_parts, (arg("detection"), arg("color")=rgb_pixel(0, 0, 255)), .def("add_overlay", add_overlay_parts, (arg("detection"), arg("color")=rgb_pixel(0, 0, 255)),
"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("wait_until_closed", &type::wait_until_closed, .def("wait_until_closed", &type::wait_until_closed,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment