MATLAB: Measuring Integrated Intensity using regioprops

imageintegrated intensityregionprops

Hi. I have an image that I threshold to create a binary image.
I then use regioprops to create regions
labeledImage = bwlabel(Binary, 8); % Label each blob so we can make measurements of it
blobMeasurements = regionprops(labeledImage, ROI, 'all'); %ROI is original image
I undestand I can obtain the max or mean intesnities of each region such a s:
allBlobIntensities = [blobMeasurements.MaxIntensity];
However, I need to calculate the integrated intensity of each region (and then take the mean of all of these).
I don't see a way to do it using regionprops as there is no
blobMeasurements.IntegratedIntensity
Any suggestions?
thanks Jason

Best Answer

Ask for PixelValues to get you the values of every pixel in the blob. Then sum them up to get your values. Something like
[labeledImage, numBlobs] = bwlabel(binaryImage);
props = regionprops(labeledImage, grayImage, 'PixelValues');
for k = 1 : numBlobs
thisBlobsValues = props(k).PixelValues;
integratedGrayValues(k) = sum(thisBlobsValues);
end
where grayImage is the original image that you want to get the intensities (gray levels) from.