How to find the coordinates ( x-axis and y-axis) of the white square

1 view (last 30 days)

Answers (1)

Cris LaPierre
Cris LaPierre on 5 Apr 2019
Just the x and y coordinate of every white pixel?
img=imread('image.jpeg');
imshow(img)
[m,n] = find(img==255);
If you want to verify, do something like this. For an image, rows are on the Y axis, colums on the x
hold on
plot(n,m,'g.')
If you actually want the perimeter, that's a little tougher, but perhaps this can get you started?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!