how can we find the length of an irregular shape in matlab

조회 수: 4 (최근 30일)
halima jamil
halima jamil 2015년 8월 12일
댓글: Image Analyst 2018년 11월 16일
I am here to ask a question. how can we find the length of an irregular shape in matlab.For example if we have so many objects(grains) in an image and want to get the length of each object. what will be the method to do. give me the right direction
  댓글 수: 2
Cedric
Cedric 2015년 8월 12일
If you have an image that you could provide as an example, please insert it into your question using the image tool/icon (don't forget to click on [Insert Image] after you have chosen it).
halima jamil
halima jamil 2015년 8월 13일
this is the image of my problem. how we can find the length of each rice. as it is a irregular shape so which method will be better and how we can implement that. thanks

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2015년 8월 12일
regionprops() requesting the Perimeter value?
  댓글 수: 6
halima jamil
halima jamil 2015년 8월 15일
check it out. now tell me how to find the length.
Walter Roberson
Walter Roberson 2015년 8월 15일
When you used the major axis length, what part did you find was "not working" ?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 8월 14일
It seems as though you're up and running with major axis length (since you accepted that answer), but I'd do it differently. MajorAxisLength will give you the length of an ellipse fitted to your blob. If you want the actual length between the two farthest points, then you need to call bwboundaries() and compute all the distances and take the longest one. I do that in my attached demo. There is no built in function or option of MATLAB or regionprops() to do that, that's why I had to write it myself.
  댓글 수: 7
Jasleen Kaur
Jasleen Kaur 2018년 11월 16일
sir can you send the code of this problem plz??
Image Analyst
Image Analyst 2018년 11월 16일
Who are you talking to? What code? I attached my code. Code that does what?
See the link below:

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by