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

4 次查看(过去 30 天)
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 个评论
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 个评论
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