matlab - How to find aspect ratio of an image -
take, example, character 'b','m' or number '1','2' image.
have find out aspect ratio of character or number.
did not correct value, code:
e = imread('1.jpg'); level = graythresh(e); bw = im2bw(e,level); [m,n]=size(bw); ar=m/n 
you need take aspect ratio of bounding box of character
s = regionprops( bw, 'boundingbox' ); ar = s.boundingbox(4) / s.boundingbox(3); see doc of regionprops values in 'boundingbox'.
Comments
Post a Comment