In Dlib how do I save image with overlay?

蹲街弑〆低调 提交于 2019-12-22 04:37:11

问题


I'm trying to modify Dlib's face detection example to save an image with detections to a file since I'm using a server without GUI. So far I have only figured how to save the image but not the overlay. How do I save both to the same file?

//win.add_overlay(dets, rgb_pixel(255,0,0));
save_png(img, "detected.png");

回答1:


You can call draw_rectangle on the image before saving it.




回答2:


Try this: dlib::draw_rectangle()

Example:

dlib::draw_rectangle(rect_image, rect, dlib::rgb_pixel(255, 0, 0), 1);


来源:https://stackoverflow.com/questions/29762785/in-dlib-how-do-i-save-image-with-overlay

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!