MATLAB: How can i remove the white object from binary image binary imageimage processing I have a image with my needed object (green) and the noise (white). I want to delete the noise but have no idea for that. anyone can help Best Answer You can use regionprops to compute circularity, eccentricity, or use major axis and minor axis lengths to find required shape of blob.I used major and minor axis:img = logical(rgb2gray(imread('green.png')));dilate_img = imdilate(img,strel('disk',2));BW = bwlabel(dilate_img);blobprops = regionprops(BW, 'MajorAxisLength','MinorAxisLength', 'Eccentricity');allMajorAxisLength = [blobprops.MajorAxisLength];allMinorAxisLength = [blobprops.MinorAxisLength];allEccentricity = [blobprops.Eccentricity];MajorbyMinor = allMajorAxisLength./allMinorAxisLength;[B,I] = sort(MajorbyMinor);BW2 = ismember(BW,I(1));% Using eccentricity% [B,I] = sort(allEccentricity); % eccentricity = 0: circle, = 1: line% BW2 = ismember(BW,I(1));figure, subplot(131), imshow(img), title('Original');subplot(132), imshow(BW), title('Label');subplot(133), imshow(BW2), title('desired'); Related QuestionHow to make binary image more rounded, closer to ellipsoid shapeRemove specific objects from an imageReference to non-existent field ‘BoundingBox’. Error in findVehicle (line 10) bboxes = regions.BoundingBox; can anyone explainI 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 attachedHow to measure the horizontal and vertical axis length of an object
Best Answer