Ask Your Question

Measure the size of face

asked 2018-10-06 10:17:28 -0600

Ihor gravatar image

updated 2018-10-06 10:36:50 -0600

berak gravatar image

Hi everybody

I am trying to measure the size of face and eyes on the photo. I am using Python and library OpenCV. To detect eyes and face on photo I used auxiliary files shape_predictor_68_face_landmarks.dat and haarcascade_frontalface_alt.xml.

The result is :

image description

This is correct, but I want also to get the size of nose and eyes etc in centimeters. Is the way how I can do this?

Sorry if this is a bit basic of a question, but for some reason I could not find much online to guide me on this. I have googled a lot, read different articles but nothing helps me.


edit retag flag offensive close merge delete


as always: pinhole model

if this is a bit basic of a question,

indeed ! (you probably had that in school already !)

berak gravatar imageberak ( 2018-10-06 10:27:59 -0600 )edit

Not that I've actually used OpenCV but what about having a reference face shot that you know the dimensions of the features. Then line up both with the same reference symmetry and calculate the difference from reference to supplied face. I'm just thinking out loud on this one.

I've played with an Android app called "ON 3D-CameraMeasure" []. It gets you to place a reference object (A4 paper, Credit Card) in the photo to then use for calculating the size and distance of other objects in the scene. Obviously the photo you've provided doesn't have a reference object available but this may provide some clues.

Also have a read of this []

ConceptRat gravatar imageConceptRat ( 2018-10-06 18:59:04 -0600 )edit

@ConceptRa Thank you, it is very helpful!

Ihor gravatar imageIhor ( 2018-10-12 08:09:08 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-10-06 10:30:52 -0600

berak gravatar image

updated 2018-10-06 11:36:09 -0600

so, there's fov, size and distance, you need to know 2 of them, to calculate the third.

and you probably don't have any of it, given arbitrary images as input.

(you can get the fov from calibrating your camera, also you can get the distance, if you're using a stereo rig or a depth cam, like kinect)

(again, as long as long as you use arbitrary images, and have no control about the camera params -- what you want is simply not possible)

edit flag offensive delete link more


If I have two of this how can I measure size of eyes?

Ihor gravatar imageIhor ( 2018-10-06 12:38:14 -0600 )edit

apply maths

berak gravatar imageberak ( 2018-10-06 12:41:22 -0600 )edit

Question Tools

1 follower


Asked: 2018-10-06 10:17:28 -0600

Seen: 1,162 times

Last updated: Oct 06 '18