Answer the question
In order to leave comments, you need to log in
How to find the distance between two recognized objects in MATLAB?
Using the Viola-Jones method, I had to make a simple program that would determine the different parts of the face in the photo. That is, eyes (eyes recognition), nose (nose recognition), and mouth (mouth recognition). This task was not difficult. But I can't figure out the next point. Now my program should find the distance between the eyes, between the nose and mouth of each face. That is, I load the picture into some kind of GUI, click on the button that defines all parts of the face, and the second button will have to determine the distance. Tell me in which direction to move, and whether it is realistic to do so.
Answer the question
In order to leave comments, you need to log in
If there are coordinates of the boundaries of the object and assume that the face is a plane, then the distance between them can be calculated simply as the distance between two points.
If you already want to take into account that the face is not flat, then you can draw an ellipse on paper and calculate the distance between objects lying on its border. And then use these calculations to determine the distance within your program.
What you need to know for this: the proportions of the head (to determine the distance) + some object in the photo whose size you know (which will be used as a scaling factor to determine the actual size). For example, you know that the pupil size is (15 mm). The distance between the eyes is three such pupils. Those. 45 mm.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question