MATLAB: Regionprops

regionprops

I would like someone to give me a good example to understand the use of regionprops with 'PixelList' as a parameter

Best Answer

Try this for a start:
img = zeros(5,5);
img(2:4, 2:4) = 1;
props = regionprops(img, 'PixelList');
disp(img);
disp(props.PixelList);
You can change the pattern of ones in img until you're clear about how the result is structured. Another simple but informative example:
img = zeros(5,5);
img(2,2) = 1;
img(4,4) = 2;
props = regionprops(img, 'PixelList');
disp(props(1).PixelList);
disp(props(2).PixelList);