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");
You can call draw_rectangle on the image before saving it.
Try this: dlib::draw_rectangle()
Example:
dlib::draw_rectangle(rect_image, rect, dlib::rgb_pixel(255, 0, 0), 1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With