Suppose I have an image
and then I use the code below
I=imread("image.bmp");
imshow(I); hold on; [B,L,N] = bwboundaries(I);
for k=1:length(B),
boundary = B{k};
plot(boundary(:,2), boundary(:,1),'.r')
end
The boundaries then look like
However, I don't just want the x,y coordinates of each pixel ON the boundaries. I also want the x,y coordinates of each pixel INSIDE the boundaries also
Is there a way to do this in Matlab?
EDIT: I want to store the row/column numbers for each object in separate matrices. So matrix A1 should store the row/column numbers for the white pixels in the big object, matrix A2 should store the row/column numbers for the white pixels in the circular object