How can I color only specific blobs in my segmented image?
1 次查看(过去 30 天)
显示 更早的评论
I have a segmented/labeled image. There are some segments that are too big, and I have their blob indices. I would like to color those blobs red while keeping the other blobs white. How can I do that? My current code below keeps the badBlobs, but turns the other blobs black.
Also, I would like the badBlobs to all be red, not with a spectrum like in the hsv colormap. How can I do that?
I am attaching the image that I am using.
And this is the result that I'm getting:
I want all other blobs to be visible as well, but in white.
Thanks.
Edit: wording
badBlobs = [25];
newImage = segmentedImage;
%Keep only blobs that are too big
binaryImage = ismember(newImage, badBlobs);
labeledImage = bwlabel(binaryImage);
%Show bad openings
figure('Name', 'Bad openings', 'numbertitle', 'off');
imshow(labeledImage);
colormap('hsv')
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Red 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!