MATLAB: How to find the height and width of an alphabet/letter

Image Processing Toolboximage segmentation

i have a letter in which I want to find the height and width of this letter
any algorithm or code can suggest by anyoneb.jpg

Best Answer

Try
binaryImage = grayImage < 128;
props = regionprops(binaryImage, 'BoundingBox');
width = props.BoundingBox(3);
height = props.BoundingBox(4);