MATLAB: How detect spot white circle on image

Image Processing Toolboxspot white detection

I would like detect spot white are like below image . Hope anyone help . Thanks!

Best Answer

I = imread('Screen Shot 2017-06-06 at 3.54.58 PM.png') ;
im = imclearborder(im2bw(I));
im_fill = imfill(im, 'holes');
s = regionprops(im_fill, 'Area', 'PixelList');
[~,ind] = max([s.Area]);
pix = sub2ind(size(im), s(ind).PixelList(:,2), s(ind).PixelList(:,1));
out = zeros(size(im));
out(pix) = im(pix);
% imshow(out);
[y,x] = find(out) ;
idx = boundary(x,y) ;
% idx = convhull(x,y) ;
imshow(I)
hold on
plot(x(idx),y(idx),'r','linewidth',3)
If boundary doesn't work, use convexhull