In Dlib, how do I save an overlay image?

I am trying to modify the Dlib face detection example to save the image with the detection to a file since I am using a server without a GUI. So far I have only decided how to save the image, but not the overlay. How to save both files in one file?

//win.add_overlay(dets, rgb_pixel(255,0,0)); save_png(img, "detected.png"); 
+7
c ++ dlib
source share
2 answers

You can call draw_rectangle on the image before saving.

+5
source share

Try the following: dlib::draw_rectangle()

Example:

 dlib::draw_rectangle(rect_image, rect, dlib::rgb_pixel(255, 0, 0), 1); 
+2
source share

All Articles