How to measure the length of banana in binary
4 views (last 30 days)
Show older comments
Hello everyone..
I have a problem in measuring the length and width of the banana image. First I would like to know the length and width of the banana (in pixels). Then, I would to convert it into centimeters. Actual length of bananas is 13 cm, while the width is 2.8 cm. I would like to compare between actual measurement and computational measurements results (in centimeters).
I already find the method regionprops (majoraxislength and minoraxislength) but I still difficulties in using it.

Thank you
0 Comments
Accepted Answer
Image Analyst
on 8 Jun 2013
First of all you need a spatial calibration, like a picture of a ruler. Let me know if you need a demo of how to do that. Then what I'd do, since it looks like you can assume the banana is more or less aligned with the image rows and columns is to sum the image horizontally to get the vertical profile. Then examine that to see where the tips of the banana are (say the top and bottom 20% of distance) and take the mean of the profile in between the tips. By knowing where the profile starts and stops, and by knowing the mean width, you can multiply by your spatial calibration to convert your numbers from pixels to cm. This is so simple that it looks like a homework question - is it?
0 Comments
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!