Write a text in dlib image

末鹿安然 提交于 2020-01-06 04:22:28

问题


i'm using dlib for face detection and i would like to write a text in the image. i've tried this win.add_overlay(dets, rgb_pixel(255,0,0),"test" ); but it's not working

Can you please help me.


回答1:


According to the dlib documentation, the add_overlay method takes an overlay as a parameter. Since you want to display rectangles you have to create an overlay_rect. You should try the following code :

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

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



来源:https://stackoverflow.com/questions/37552082/write-a-text-in-dlib-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!