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 onplot(x(idx),y(idx),'r','linewidth',3)Code taken from: https://in.mathworks.com/matlabcentral/answers/343337-how-to-remove-small-portion-in-an-imageIf boundary doesn't work, use convexhull Related SolutionsMATLAB: How to cut out the white border in this binary image, but keep the rest Another possible way is to use bwconvfull function, like:% Read and binarize the imageI = imread('inTT.png');BW = imbinarize(rgb2gray(I));% Delete white background using bwconvfullBWConv = bwconvhull(~BW);BW2 = BW & BWConv; MATLAB: How to remove small portion in an image the result is a binary image but the part is extracted.if trueI=imread('liver.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); end Related QuestionDetect and Fill Edges of a Binary ImageHow to generate random integer between two no (say 12 and 35) without repeat? randperm(n) give only 1 to n, but I need m to n.I tried to find inner and outer diameter of an circle using this code but it didn’t give me outputs images like below I’ve attached
Best Answer