MATLAB: Counting the number of objects image processing I have an brain image and there are three overlapped objects.The overlapped object is nails ..can i count these overlapped objects.in medical images Best Answer Hello, Pat.It is possible to count the nails.You just need to perform some morphologichal operations, such aserosion, area open, etc.Then, in the next step you need to count the objects. You can use regionsprops command.Here my demo :Irgb = imread('n7vGa.jpg');Igray = rgb2gray(Irgb);Ibw = im2bw(Igray, 0.9);se = strel('square',2);Imorph = imerode(Ibw,se);Iarea = bwareaopen(Imorph,130);Idiff = Imorph - Iarea;Ifinal = bwareaopen(Idiff,70);stat = regionprops(Ifinal,'BoundingBox');str = sprintf('number of detected nails : %d', length(stat));imshow(Irgb); title(str); hold on;for cnt = 1 : length(stat) bb = stat(cnt).BoundingBox; rectangle('position',bb,'edgecolor',rand(1,3)); endAnd the result :Is that you meant?? Related SolutionsMATLAB: Why does bwperim make the border WHITE?!! I don't think perim1 should have the edges of the image as white. Can you post the binary image so I can check it out? MATLAB: Reference to non-existent field solidity If stats was created by calling regionprops, then the field name should be Solidity with a capital S. Related QuestionThe centroids of objects in an image have been found. It has then been cropped to a certain area. IS it possible to tell if more than one centroid is in a cropped imageDetect square in image
Best Answer