I want save each each white nodules as an image from the below binary image?

1 回表示 (過去 30 日間)
Ibrahim Ullah
Ibrahim Ullah 2020 年 2 月 1 日
回答済み: Image Analyst 2020 年 2 月 1 日
region_of_interest.PNG
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 2 月 1 日
Question is not clear?
Ibrahim Ullah
Ibrahim Ullah 2020 年 2 月 1 日
i am a doing a project on lung nodule detection, i want to take GLCM features of all those white objects separately whose area is less than 250

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

回答 (1 件)

Image Analyst
Image Analyst 2020 年 2 月 1 日
You can use regionprops() to get the bounding box of each blob, then crop it and use imwrite() to write it out as its own image. Something like this untested code:
props = regionprops(binaryImage, 'BoundingBox');
for k = 1 : length(props)
croppedImage = imcrop(binaryImage, props(k).BoundingBox);
fileName = sprintf('Blob %2.2d', k);
imwrite(croppedImage, filename);
end
This just does what your subject line asked - how to save each blob as an image. It does not compute the GLCM of each blob. If you want, you can call glcm() on each cropped image and save the results in a .mat file using save().

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by