Measuring Integrated Intensity using regioprops

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

5 件のコメント

Massimo Zanetti
Massimo Zanetti 2016 年 9 月 26 日
What is exactly the "integrated intensity"? Do you have any formula?
Jason
Jason 2016 年 9 月 26 日
Hi, its the sum of all pixels values within a a region. I then want to take the average over all regions.
Youtao Liu
Youtao Liu 2018 年 5 月 30 日
Hi Jason, may I ask you how did you circle those blobs with varied line? Thanks!
Jason
Jason 2018 年 6 月 1 日
Hi, I used this:
%DrawRegions from Binary to raw image:
labeledImage = bwlabel(Binary, 8); % Label each blob so we can make measurements of it
blobMeasurements = regionprops(labeledImage, ROI, 'all'); %ROI is original image
numberOfBlobs = size(blobMeasurements, 1);
hold on;
boundaries = bwboundaries(Binary);
numberOfBoundaries = size(boundaries);
subplot(4,5,[3,4,8,9])
hold on
for k = 1 : numberOfBoundaries
thisBoundary = boundaries{k};
plot(thisBoundary(:,2), thisBoundary(:,1), 'g', 'LineWidth', 1);
end
hold off;
Youtao Liu
Youtao Liu 2018 年 6 月 5 日
Hi, Jason, thanks a lot! appreciated!

サインインしてコメントする。

 採用された回答

Image Analyst
Image Analyst 2016 年 9 月 26 日

4 投票

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.

その他の回答 (1 件)

Massimo Zanetti
Massimo Zanetti 2016 年 9 月 26 日

4 投票

You may ask the REGIONPROP function to provide you the pixel indexes of the regions detected by the algorithm. Then you can use such indexes to do whatever you want in the target image (including summing the values in correspondence of the regions). See below.
%binary image containing blobs (here rectangles for simplicty)
labelImg = zeros(30,30);
labelImg(12:18,4:9) = 1;
labelImg(21:26,16:24) = 5;
%region props (optional argument to get pixel idx in a list)
meas = regionprops(logical(labelImg),'PixelIdxList');
%get a list which elements are vectors of linear indexes (each vector
%contains indexes of the connected components)
indexes = {meas.PixelIdxList};
numComp = numel(indexes);
intDens = zeros(numComp,1);
for k = 1:numComp
%sum the pixel values of each component (integrated density)
intDens(k) = sum(labelImg(indexes{k}));
end

質問済み:

2016 年 9 月 26 日

コメント済み:

2018 年 6 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by