MCPcopy Create free account
hub / github.com/davisking/dlib / add_overlay_pylist

Function add_overlay_pylist

tools/python/src/gui.cpp:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void add_overlay_pylist (
94 image_window& win,
95 const py::list& objs,
96 const rgb_pixel& color
97)
98{
99 std::vector<rectangle> rects;
100 for (const auto& obj : objs)
101 {
102 try { rects.push_back(obj.cast<rectangle>()); continue; } catch(py::cast_error&) { }
103 try { rects.push_back(obj.cast<drectangle>()); continue; } catch(py::cast_error&) { }
104 try { win.add_overlay(obj.cast<line>(), color); continue; } catch(py::cast_error&) { }
105 add_overlay_parts(win, obj.cast<full_object_detection>(), color);
106 }
107 win.add_overlay(rects, color);
108}
109
110void wait_for_keypress_char(image_window& win, const char wait_key) {
111 unsigned long key;

Callers

nothing calls this directly

Calls 3

add_overlay_partsFunction · 0.85
push_backMethod · 0.45
add_overlayMethod · 0.45

Tested by

no test coverage detected