Help integrating particle intensity
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Image Analyst
2020년 7월 26일
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
Image Analyst
2020년 8월 4일
You should know how many rows and columns your image has. If you don't, get them this way:
[rows, columns, numberOfColorChannels] = size(grayImage);
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!