Como ve, tengo formas y sus límites blancos. Quiero llenar las formas en color blanco.formas de relleno Matlab por blanco
La entrada es:
me gustaría conseguir este resultado:
Puede alguien ayudarme por favor con este código? no cambia las elipsis negras a blanco. Muchas gracias:]]
I = imread('untitled4.bmp');
Ibw = im2bw(I);
CC = bwconncomp(Ibw); %Ibw is my binary image
stats = regionprops(CC,'pixellist');
% pass all over the stats
for i=1:length(stats),
size = length(stats(i).PixelList);
% check only the relevant stats (the black ellipses)
if size >150 && size < 600
% fill the black pixel by white
x = round(mean(stats(i).PixelList(:,2)));
y = round(mean(stats(i).PixelList(:,1)));
Ibw = imfill(Ibw, [x, y]);
end;
end;
imshow(Ibw);
relacionada a http://stackoverflow.com/questions/10053651/ obtener los píxeles que pertenecen a una forma – Gray