필터 지우기
필터 지우기

select labeled object in image

조회 수: 22 (최근 30일)
researcher
researcher 2012년 7월 2일
댓글: SSC 2021년 1월 7일
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

채택된 답변

Sean de Wolski
Sean de Wolski 2012년 7월 2일
편집: Sean de Wolski 2012년 7월 2일
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
Image Analyst
Image Analyst 2015년 1월 31일
sara's "Flag" removed and moved here:
Simple and short and useful.
SSC
SSC 2021년 1월 7일
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).

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by