I want to count bright spots in a region on an image. How to do it ?

22 visualizaciones (últimos 30 días)
bathery
bathery el 27 de Nov. de 2017
Respondida: Ryan Comeau el 15 de Abr. de 2020
There are images from microscope in which I need to count number of bright spots at some bright patches. Pls help.
  2 comentarios
Rik
Rik el 27 de Nov. de 2017
What have you tried already? My first thought would be to try some form of edge detection to see if it is easy on such an image to define a threshold.
bathery
bathery el 3 de Dic. de 2017
I had tried to threshold the binary image but I find problems - The central patch is brighter than many dots outside. Thus a simple threshold algorithm sees large patches at the central region.
My objective is to find (1) the bright dots outside this central bright patch and (2) the brighter dots seen on this central bright patch.

Iniciar sesión para comentar.

Respuestas (3)

Image Analyst
Image Analyst el 3 de Dic. de 2017
Editada: Image Analyst el 3 de Dic. de 2017
Try taking the red or blue channel, which ever has more contrast. if you want the small, compact bright spots, then try using a top hat filter, imtophat().
I tried to do something with it, but it's a JPG image so the jpg block artifacts are very severe - so severe that they basically prevent image analysis of this image. Please post the non-lossy image, like a PNG, BMP, or TIFF version.

Bshara Murr
Bshara Murr el 27 de Nov. de 2017
Editada: Bshara Murr el 27 de Nov. de 2017
I = imread('microscope.jpg');
gray = rgb2gray(I);
binaryImage = gray > 110;
imshow(binaryImage);
figure; imshow(I);
[labeledImage, numberOfCircles] = bwlabel(binaryImage);
numberOfCircles
I hope it does the job. You can change the threshold value(110 in my code) to what suites you. You can add a slider as well so you won't have to change it from your code.
  2 comentarios
bathery
bathery el 3 de Dic. de 2017
Thank you for the help but I had tried this way before and did not work. The central bright region appears as large patches giving errors.
My objective is to find (1) the bright dots outside this central bright patch and (2) the brighter dots seen on this central bright patch.
Can Koyuncu
Can Koyuncu el 29 de Dic. de 2017
You can use hmaxima transformation. Luckly, Matlab has built-in function. Usage is as following: First convert image into gray scale. gray = rgb2gray(im); Then extract regional maxima whose depth is larger than 25. (You can play with the h value) regions = imextendedmax(gray, 25);

Iniciar sesión para comentar.


Ryan Comeau
Ryan Comeau el 15 de Abr. de 2020
Hello, another technique that will maybe work is the use of regionprops. What you could do is, have RP return the brightest values on the image and then sort them yourself. If for example you require a specific shape, you can have RP return the Semi Major and semi Minor axis length for each region (look at the documentation, it's quite elaborate). Somthing like this maybe
image=imread('path/to/image');
imBW=imbinarize(image);
qq=regionprops(imBW,image,{'Centroids','MajorAxisLength','MinorAxisLength','MaxIntensity'});
for i=1:length(qq)
if qq(i).%conditions for bright circles(MajAL==MinAL, or use cicularity)
data_vault(i,:)=qq(i).Centroids
end
end
Hope this helps.

Categorías

Más información sobre 3-D Volumetric Image Processing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by