I have two images - one binarized, and one original.
I use the binarized image to segment using bwconncomp and then for every blob/region, I want to sum the pixel-intensities from the original image.
I do that by:
blobMeasurements = regionprops(binarizedImage, originalImage, 'pixelvalues');
Now, I have a struct with a 'p x 1' vector for each blob/region. I need to sum these pixel intensities, such that I have one 'sum' value for each blob/region. How do I perform this operation? Is there a better way of doing this?
Thanks.
Try this:
arrayfun
runs the given function@(x) sum(x.pixelvalues(:))
on each of thep
element of the structure arrayblobMeasurements
. Hope this helps.