开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜