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

5 次查看(过去 30 天)
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?

采纳的回答

DGM
DGM 2021-7-4
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 个评论
Image Analyst
Image Analyst 2021-7-7
@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 2021-7-8
编辑:Mohsin Zubair 2021-7-8
@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

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by