问题
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