MATLAB: Study of properties of different regions in an image

imageImage Processing Toolboxpropertiesroi

Hi, I'm a student and I need some help with my programm. I'm doing a program with which you can process a greyscale image, reduce noise and change the contrast. I can do this in the whole image or select a number of region and process (in case I would process only a region (or 2,3…)). I did the process of different using a binary mask (one different in each case) and the instruction "roifilt2", and works well. My doubt came later, after I process my image (or the differents region that I chose) I want to study some different properties (intensity of pixel, area, ecc…). I used "regionprops" (with the image turned in a binaryimage like a mask) and works well with the whole image, but when I try to study the properties of different region (that I chose) in my image, I don`t know how. I can't use my own binary mask and study only the region that I selected with regionprops because I get only the properties of the binarymask, and I can't used "roifilt2" how a thought… Somebody could give me any idea about how solve that? Exist any function with which I could use my own function only in some regions like roifilt2?

Best Answer

Use your existing binary image to mask out just the region you want, like
thisBinaryImage = maskOfOneRegion .* binaryImageOfAllRegions;
labeledImage = bwlabel(thisBinaryImage);
measurements = regionprops(labeledImage, 'area');