Help integrating particle intensity
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to integrate the intensity from each of the particles in the following image to determine if there are any outliers that need to be discarded:

From what I understand, this is done by summing all the pixels in the PSF by summing the value of the all the pixels contained within a box surrounding each particle defined my the size of the maximum FWHM value.
So right now I have x and y locations for each particle and sigma values for the PSF. Here's the code I have now:
numParticles = numel(sigma);
fwhm = 2.355*sigma;
fwhm = max(fwhm);
fwhm = round(fwhm);
x0 = round(position(:,1)); y0 = round(position(:,2));
for ii=1:numParticles
x = x0(ii)+(-fwhm:fwhm); y = y0(ii)+(-fwhm:fwhm);
x = x(x>0); y = y(y>0);
intensity(ii) = sum(sum(im(x,y),2),1);
end
The problem I'm having is that I'm getting a lot of negative values, which doesn't make sense to me. Can someone point out if I'm doing something wrong?
0 commentaires
Réponses (1)
Image Analyst
le 26 Juil 2020
If you have the x and y coordinates of the particles, then just turn them into a binary image and compute the mean intensity and multiply by the areas:
mask = false(rows, columns);
for k = 1 : length(x)
mask(y(k), x(k)) = true;
end
props = regionprops(mask, grayImage, 'MeanIntensity', 'Area')
allAreas = [props.Area]
allIntensities = [props.MeanIntensity]
% Find integrated Gray Value, IGV
igv = allAreas .* allIntensities
5 commentaires
Image Analyst
le 4 Août 2020
You should know how many rows and columns your image has. If you don't, get them this way:
[rows, columns, numberOfColorChannels] = size(grayImage);
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
