Skip to content
Advertisement

How can I draw lines into numpy arrays?

I would like to be able to draw lines into numpy arrays to get off-line features for on-line handwriting recognition. This means I don’t need the image at all, but I need for some positions in a numpy array who an image of a given size would look like.

I would like to be able to specify an image size and then draw strokes like this:

JavaScript

Is something simple like that possible (preferably directly with numpy / scipy)?

(Please note that I want grey-scale interpolation. So features should be a matrix of values in [0, 255].)

Advertisement

Answer

Thanks to Joe Kington for the answer! I was looking for skimage.draw.line_aa.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement