I want save each each white nodules as an image from the below binary image?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
2 comentarios
Respuestas (1)
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().
0 comentarios
Ver también
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!