[Numpy-discussion] Help speeding up element-wise operations for video processing

Stéfan van der Walt stefan@sun.ac...
Thu Sep 18 02:25:08 CDT 2008


Hey Brendan

2008/9/17 Brendan Simons <spam4bsimons@yahoo.ca>:
> I would love a c-types code snippet.  I'm not very handy in c.  Since
> I gather numpy is row-major, I thought I up and down crops very
> quickly by moving the start and end pointers of the array.  For
> cropping left and right, is there a fast c command for "copy while
> skipping every nth hundred bytes"?

Not sure which way you decided to go, but here are some code snippets:

http://mentat.za.net/hg/graycomatrix

and

http://mentat.za.net/source/connected_components.tar.bz2

Also take a look at

http://scipy.org/Cookbook/Ctypes

Good luck!
Stéfan


More information about the Numpy-discussion mailing list