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

6 views (last 30 days)
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?

Accepted Answer

DGM
DGM on 4 Jul 2021
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')
  13 Comments
Image Analyst
Image Analyst on 7 Jul 2021
@Mohsin Zubair, so it looks like your original images are pretty contrasty black and white, though some of the blobs might be brighter or fainter than the others. But again, you have given us no idea of how you decided to outline those particular blobs and not the others. Do you just want to take a large grouping that is roughly in the center of the image? Or can the ROI be anywhere in the image? Is there more thought put into deciding which ones to include than just taking the blobs within a radius of half the image from the center? If so, what is your thought process in deciding which ones to include and which to exclude? We need to know that if we're to develop any sort of automatic way of getting the ROI.
Also, include the original image because the screenshot with the blue stuff in the overlay, while good for showing us which blobs you chose to include, won't be any good when we try to develop an automated method.
Mohsin Zubair
Mohsin Zubair on 8 Jul 2021
Edited: Mohsin Zubair on 8 Jul 2021
@Image Analyst I solved ROI problem by just saved ROI information externally in and then load this information later and draw ROI from this saved ROI information as it doesn't seem feasible to draw ROI automatically any other way, As for how do I determine the DOTS I draw ROI where I need and then do analysis on them

Sign in to comment.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!