[Numpy-discussion] fast grayscale conversion

Alex Flint alex.flint at gmail.com
Mon Jun 20 16:15:59 EDT 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.python.org/pipermail/numpy-discussion/attachments/20110620/aa73e6b1/attachment.html>


More information about the NumPy-Discussion mailing list