How to count dots and mark those dots with crosses in an Image?

Illustration
Mohsin Zubair - 2022-02-22T15:57:13+00:00
Question: How to count dots and mark those dots with crosses in an Image?

I have an image with bright dots over a dark back ground, I have created a ROI in it and then created a binary image, Now I want to count number of dots in this image inside ROI region and produce a result like "desired_result.jpg", any ideas or suggestions how can I do it?  

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

As far as I can tell, your sample image is corrupted. Either way, you can do this:
 
% find centers of objects
S = regionprops(mybinaryimage,'centroid');
C = vertcat(S.Centroid);	
numspots = numel(S) % count objects

% show image and plot markers
imshow(mybinaryimage); hold on
plot(C(:,1),C(:,2),'x')

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!