select labeled object in image
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
researcher
am 2 Jul. 2012
Kommentiert: SSC
am 7 Jan. 2021
Dear all,
i've made labeling to an image and i'm trying to select objects by mouse click in order to delete them.
can anyone help me to do this. i've been trying for long time but couldn't do it,
thanks in advance
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 2 Jul. 2012
Bearbeitet: Sean de Wolski
am 2 Jul. 2012
Here, your very own Blob remover:
function removeBlob
I = bwlabel(imfill(imread('coins.png')>100,'holes'));
h = imshow(label2rgb(I,jet(numel(unique(I(:)))),[0 0 0]));
set(h,'buttondownfcn',{@removeIt,I})
end
function removeIt(src,~,I)
cp = round(get(get(src,'parent'),'currentpoint'));
val = I(cp(3),cp(1));
I(I==val) = 0;
set(src,'cdata',bsxfun(@times,uint8(logical(I)),get(src,'cdata')));
end
2 Kommentare
SSC
am 7 Jan. 2021
Hi Sean,
how can I modify the code for selecting the blobs from binary Image by mouse click and delete remaining of the blobs (Objects).
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!