How to find the coordinates of the white square ?

2 次查看(过去 30 天)

采纳的回答

Matt J
Matt J 2019-2-20
编辑:Matt J 2019-2-20
Some simple morphological operations are all you need.
A=imbinarize((imread('image.jpeg')));
A=bwareafilt( imopen(A,strel('disk',5)) ,1);
[I,J] = find(A); %The desired coordinates??
imshow(A)
  4 个评论
Matt J
Matt J 2019-2-21
编辑:Matt J 2019-2-21
A is the image, as displayed above, with everything but the square removed. I and J are the matrix coordinates of the non-zero pixels of A, see FIND.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by