Store details of a binary image consisting simple polygons

后端 未结 4 1507
礼貌的吻别
礼貌的吻别 2020-12-22 14:56

This question relates to somewhat practice and experienced based process. I have an Mat binary image which consist of simple white color polygons in a black background. Actu

4条回答
  •  一生所求
    2020-12-22 15:30

    It depends how generic the polygons can be. If the edges of the polygon are always parallel to x and y axes, then you could look at pixels in 8-neigborhood of a particular pixel and if there are odd number of white pixels you have found a corner. Or use a 4-neighborhood and test for even number of white pixels.

提交回复
热议问题