I have a binary image with several objects. I'm using regionprops to create Bounding Boxes around each object. Now I need to find the coordinates of only white pixels within each Bounding Box. This is what I have so far. Thx for your time!
%%Load Image
image = imread ('testimage.png');image = im2bw (image, 0.01);%%Create Bounding Boxes
image = bwlabel (image);Properties = regionprops (image, 'BoundingBox');NumberOfBoxes = max(size(Properties));figure; imshow (image);for k = 1:NumberOfBoxes Box = Properties(k).BoundingBox; rectangle('Position', [Box(1), Box(2), Box(3), Box(4),],... 'EdgeColor', 'r', 'LineWidth', 2)end
Best Answer