フィルターのクリア

Finding area, average and moments of parts of a segmented image

7 ビュー (過去 30 日間)
besaret koçak
besaret koçak 2023 年 9 月 27 日
編集済み: Image Analyst 2023 年 10 月 1 日
I have an image divided into sections. How can I find the area, mean, second moment and third moment of those sections? I used the "bwconncomp" function to detect the partitions.

回答 (1 件)

Image Analyst
Image Analyst 2023 年 9 月 30 日
It's a generic, general purpose demo of how to threshold an image to find blobs, and then measure things about the blobs, and extract certain blobs based on their areas or diameters.
Also check out the attached demo on image moments.
  3 件のコメント
besaret koçak
besaret koçak 2023 年 9 月 30 日
I want to find the area, mean, second moment, third moment and variance for each blob separately. I wrote a code like this for this. İs it true
for i=1:1:CC.NumObjects
moment1(i,1) = moment(image(CC.PixelIdxList{1,i}),1)
moment2(i,1) = moment(image(CC.PixelIdxList{1,i}),2)
moment3(i,1) = moment(image(CC.PixelIdxList{1,i}),3)
area(i,1) = bwarea(CC.PixelIdxList{1,i})
means(i,1) = mean(GPR(CC.PixelIdxList{1,i}))
var_result(i,1)= var(double(image(CC.PixelIdxList{1,i})))
end
Image Analyst
Image Analyst 2023 年 10 月 1 日
編集済み: Image Analyst 2023 年 10 月 1 日
image is a function so you would not want to use that for your variable name. PixelIdxList just gives indexes. I think you'd want PixelList which gives (x,y) coordinates. I don't know what your GPR function or array is, but your means and var_result do not make sense to me. Maybe by mean you mean the mean x and y, in other words the centroid which you should get directly from regionprops.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by