开发者

How do I Calculate the area of polygons in the checkerboard image in MATLAB?

开发者 https://www.devze.com 2023-02-24 02:13 出处:网络
Please guide me to write the program in MATLAB. I have a checkerboard image. Each square of the chess board has given a number (index number).

Please guide me to write the program in MATLAB.

I have a checkerboard image. Each square of the chess board has given a number (index number).

On this image, a series of parallel lines are d开发者_JAVA百科rawn.

How do I calculate the area of ​​each square of the chess board that is located within the parallel lines?


Well.. What do you mean polygons? They are all squares. Anyhow, the code is :

function CalculateAreas()
   I = logical(checkerboard(20));
   B = bwlabel(I,4);
   props = regionprops(B,'Area');
   disp([props.Area]);
end
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号