Hi.
I have an image that I create a binary image from with an aim to use this as a mask to read values of the foreground on the original image.
I use the following code to obtain the regions that I then mask back onto the raw image and take the mean of them.
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; %Get mean intensity of foreground by blobmeasurements
allBlobIntensities = [blobMeasurements.MeanIntensity] meanI=mean(allBlobIntensities(:))
My question is, I want to exclude the values that are say within 1 pixel of the actual region boundary (for all boundaries, i.e exclude the perimeter of each boundary.
Is this possible? Thanks Jason
Best Answer