MATLAB: Hi ı am a master student and I have a home work

Image Processing Toolbox

I have A BİNARY PİCTURE AND I WANT TO CALCULATE İT'S MAXİMUM width and length.can you help me?

Best Answer

The properties 'MajorAxisLength' and 'MinorAxisLength' might be useful. Please try to call regionprops with them.
I hesitate to post the code, because you should be able to provide it as solution without cheating. Your professor knows this forum also. If I post the corresponding line of code, he could think that you have just copied them from me.
[EDITED] I trust Image Analyst's statement, that regionprops is not perfect, but a cheap approxination only. But your professor asked explicitely for this command. Perhaps he only wants to encourage you to play with this command to get familar with it. Therefore an alternative cheap and rough idea:
Determine the 'Orientation' with regionprops. Then rotate the image with imrotate and call regionprops again to determine the 'BoundingBox'. This might not be perfect, but perhaps it satisfies your professor and solves the homework with some lines of code.
And for a serious solution, please consider Image Analyst's valuable answer.