Writing text to dlib image

I am using dlib for face detection and I would like to write text on the image. I tried this win.add_overlay(dets, rgb_pixel(255,0,0),"test" );

but it doesn't work

Could you help me.

+1


source to share


1 answer


According to the dlib documentation , the method add_overlay

takes an overlay as a parameter. Since you want to display rectangles, you need to create overlay_rect

. You should try the following code:

win.add_overlay(dlib::image_window::overlay_rect(dets, rgb_pixel(255,0,0),"test" ));



The dlib documentation is really well done (Davis King props), you should take some time to read and understand it.

+6


source







All Articles