Face aspect ratio.

13 visualizaciones (últimos 30 días)
Christine Lim
Christine Lim el 31 de En. de 2018
Respondida: Rik el 31 de En. de 2018
I have used HSV segmentation to do skin detection on my image. Next thing that i need to do is to find the aspect ratio of the face (exclude hair) and i was told to find the height and width (rows & columns). May i know what way is the easiest to get the height and width of the face itself?

Respuestas (1)

Rik
Rik el 31 de En. de 2018
If you have a mask, using find it the easiest method to get the rows and cols. Then it is trivial to calculate the aspect ratio:
[r,c]=find(mask);
AspectRatio=(max(r)-min(r))/(max(c)-min(c));
(Note that the ratio might be inverted, due to Matlab using different directions for images than it does for matrices.)
If you need to process many faces, it might be faster to use any, specifying a dimension to work along.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by