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.
