uricamic / clandmark

Open Source Landmarking Library
http://cmp.felk.cvut.cz/~uricamic/clandmark
GNU General Public License v3.0
199 stars 111 forks source link

Question on the green box #43

Closed bettyyy closed 8 years ago

bettyyy commented 8 years ago

Hi! I am currently working your wonderful face detection program. I want to ask how can I get/draw the green box as stated in the below screen capture? image

Thank you very much for answering! It will mean a lot to me!

uricamic commented 8 years ago

Hi @bettyyy,

the green box is constructed from the response of C-DPM within C2F-DPM detector. Check the helper function in C2F-DPM code snippets - there is a function getUpdatedBBOX which returns the corrected face box (green box in the image). It has the same format as the expected face box on input.

bettyyy commented 8 years ago

Thank you for your quick response! I will have a look on it and try to do it!

uricamic commented 8 years ago

Hi @bettyyy,

getUpdatedBBOX takes landmarks from the C-DPM detector and returns the corrected face box. The corrected box is calculated from landmarks as follows - the in-plane rotation is calculated as the deviation of least squares best line fitted to landmarks corresponding to eyes from the x-axis. The center of the corrected box is put on the centeroid of all landmarks and the size is computed based on the distance of centeroid of both eyes.

It works best for the near-frontal face orientations, it gets worse when the face is close to profile pose.