Drawing polygons in numpy arrays

前端 未结 3 1174
灰色年华
灰色年华 2020-12-19 12:22

I\'m trying to draw polygons like this:

In [1]: canvas = numpy.zeros((12, 12), dtype=int)

In [2]: mahotas.polygon.fill_polygon(
   ...: [(1, 1), (1, 10), (1         


        
3条回答
  •  萌比男神i
    2020-12-19 13:01

    I think the reversal is required because numpy references array coordinates as y,x (row, column) where most other programs issue coordinates as x,y.

提交回复
热议问题