[Numpy-discussion] fast grayscale conversion

Alex Flint alex.flint@gmail....
Mon Jun 20 15:15:59 CDT 2011


At the moment I'm using numpy.dot to convert a WxHx3 RGB image to a
grayscale image:

src_mono = np.dot(src_rgb.astype(np.float), np.ones(3)/3.);

This seems quite slow though (several seconds for a 3 megapixel image) - is
there a more specialized routine better suited to this?

Cheers,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110620/aa73e6b1/attachment.html 


More information about the NumPy-Discussion mailing list