remove the edges present outside the circle

1 回表示 (過去 30 日間)
akshatha nayak
akshatha nayak 2019 年 5 月 6 日
編集済み: KALYAN ACHARJYA 2019 年 5 月 6 日
i am able to detect the circle in an eye image but along with circle i am also getting other extra edges . how do i remove that?please help i have uploaded both original image008_1_1.jpg and processed image 100.png
gray=imread('008_1_1.jpg');
%gray=rgb2gray(gray);
t4=imresize(gray,[512,512],'bilinear');
%imshow(t4);
%set(gcf,'Units','Normalized','OuterPosition',[0 0 1 1]);
binary=imbinarize(t4,.4);
%imshow(binary);
%binary=imcrop(binary);
g=fspecial('gaussian',[512 512],15);
ig=imfilter(binary,g,'same');
bw2=edge(ig,'canny',0.53,10);
%k=get(handles.id1,'String');
filen=['100.png'];
%basefile=sprintf('%d.png',k);
fullfilenam=fullfile('C:\Users\AKSHATHA\Documents\MATLAB\database\eyeimages',filen);
imwrite(bw2,fullfilenam);

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 5 月 6 日
編集済み: KALYAN ACHARJYA 2019 年 5 月 6 日
Is this one you are looking for? This bwareafilt extract objects from binary image by size.
Here assuming that the circle size is maximum in all cases, if not result will different
result=bwareafilt(binary_image,1);
imshow(result);
Hope it Helps!
  1 件のコメント
akshatha nayak
akshatha nayak 2019 年 5 月 6 日
It work only for some images

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by