Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get real size of someone's face

Tags:

I am developing an iOS app where I want to get the size of user's real face so that I can suggest him/her suitable (matched) sized glasses.

I have detected user's face using OpenCV and got various dimensions of eyes, nose, face, etc.

But I want the real size from that dimensions (i.e in millimetres that I am getting in pixels).

I have searched a lot but could not get any solution matching with my requirement.

Has anyone idea how to calculate real size (i.e in millimetres) of the someone's face?

Thank you.

like image 907
Rohan Avatar asked Mar 20 '18 09:03

Rohan


People also ask

How do you measure face width?

Hold the ruler horizontally across your face and below your eyes. Measure the distance between left and right temples. Record the measurement in millimeters. Use your temple-to-temple width to find the total width of your glasses.

Can you measure something in a picture iPhone?

The Measure app uses augmented reality (AR) technology to turn your device into a tape measure. You can gauge the size of objects, automatically detect the dimensions of rectangular objects, and save a photo of the measurement.

How do you measure someone's iPhone?

On supported models, you can use the Measure app to instantly measure a person's height from the floor to the top of their head, hair, or hat. (You can even measure the seated height of a person in a chair.) Position iPhone so that the person you want to measure appears on the screen from head to toe.

Can I use my iPhone as a tape measure?

Use the Measure app and your iPhone camera to measure nearby objects. iPhone automatically detects the dimensions of rectangular objects, or you can manually set the start and end points of a measurement. For best results, use Measure on well-defined objects located 0.5 to 3 meters (2 to 10 feet) from iPhone.


2 Answers

I think there are two ways of doing it.

  1. You have an object of known size in the image that you can use to compare with. That object must also be at the same (or known) distance from the camera as the face.

  2. If the camera supports depth, you can get the distance to the face from the camera, and using that to calculate the actual size of the face. This option is currently only available on iPhone X. The accuracy of the depth data can vary, so I am not sure how well it might work for you.

Read more about capturing depth data here

Read more on depth data accuracy here

like image 110
LGP Avatar answered Sep 19 '22 13:09

LGP


If you have no reference point for size in the image, i guess there is really no way to tell the exact size. You would need at least one length that correlates to your picture to get some sort of a result.

That said, this would only work a 100% accurately on images of plain objects, because objects further away seem to be smaller in an image (like, e.g. here). You would need multiple pictures from different sides (all with a size reference) and there would be a horrendous amount of calculations to do.

The focal length of the camera will distort your image as well, making accurate measurement even harder (see comparision of different focal lengths with different distances to the face).

like image 35
NickG Avatar answered Sep 21 '22 13:09

NickG