In Dlib how do I save image with overlay?
Asked Answered
B

2

8

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");
Brian answered 21/4, 2015 at 4:13 Comment(2)
How to use draw_rectangle in c++, Please helpArithmetician
I have asked about it but It seems not got attention ..can u please tell me how did u saved image with overlay...You can also answer my question.link to questionArithmetician
L
5

You can call draw_rectangle on the image before saving it.

Laurynlausanne answered 21/4, 2015 at 8:38 Comment(1)
what is the syntax to use draw_rectangle.Arithmetician
P
2

Try this: dlib::draw_rectangle()

Example:

dlib::draw_rectangle(rect_image, rect, dlib::rgb_pixel(255, 0, 0), 1);
Punctuate answered 12/10, 2016 at 8:43 Comment(1)
What's the syntax to use it in Python?Catinacation

© 2022 - 2024 — McMap. All rights reserved.