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

1 visualización (últimos 30 días)
region_of_interest.PNG
  2 comentarios
Ibrahim Ullah
Ibrahim Ullah el 1 de Feb. de 2020
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

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 1 de Feb. de 2020
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().

Categorías

Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by