[SciPy-User] Bresenham algorithm?

Zachary Pincus zachary.pincus at yale.edu
Sun Sep 20 13:47:06 EDT 2009


> Does scipy provide the Bresenham algorithm ?

Not that I know of... but would it be acceptable to interpolate  
values? Then you could just calculate floating-point x,y points evenly  
spaced along the line segment, and use scipy.ndimage.map_coordinates  
to sample the image (with spline interpolation of any desired order)  
at those points.

In some cases, this is probably an acceptable solution... in others,  
not so much.

Zach



More information about the SciPy-User mailing list