can some one help me with this problem. i want each cell separately from this input image. i am uploading the output images which i wants from this input image. you can check the output images in comments. thanks for your time
2 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198041/image.png)
采纳的回答
Guillaume
2018-12-3
Labelise your image, then extract each unique label:
sourceimage = imread('index.png');
labelimage = bwlabel(sourceimage);
numobjects = max(labelimage(:)); %in R2018b: numobjects = max(labelimage, [], 'all');
objectimages = cell(1, numobjects);
for label = 1:numobjects
objectimages{label} = labelimage == label;
figure; imshow(objectimages{label}); %optional display
end
3 个评论
Guillaume
2018-12-3
If you're trying to isolate the black blobs instead of the white blobs as in your original then you'll have to invert the imge. bwlabel only detects white blobs. Black is always considered background.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!