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

M
Mohsin Zubair · Feb 22, 2022 · 2K views
Question
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 PhD Expert
Answered Aug 25, 2026
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')

 

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!