开发者

How can I analyze morphological features of image regions in MATLAB?

I have to spread rice grains on a sheet and t开发者_如何学运维hen find the average length of the rice grains spread. Any ideas how to do this in MATLAB?


If you have a good contrast between the background and the rice, you can follow a simple (though naive algorithm) recipe (I don't remember the commands in Matlab but it will be easy using the help)

1 - Threshold

2- Component Labeling

3- Get the length of each component (as pointed by @second) and use it to reckon the average size.


This exact situation can be found as an image processing example in the online MathWorks documentation for the Image Processing Toolbox:

  • Example 2 — Analyzing Images

Seriously, they use a picture of rice grains and everything! The only difference would be that you would want to look at a different property of the image when using the function REGIONPROPS, probably the 'MajorAxisLength' property (which requires using the labeled matrix from the example).


sounds like homework but here are some ideas

look at regionprops in the image processing toolbox.

there are a bunch of properties it can help you find, 'majoraxislength' may be apropriate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜