![](https://secure.gravatar.com/avatar/afdaaab755ef79ac9e1374882d60ae9f.jpg?s=120&d=mm&r=g)
Fantastic! This is great news. On Oct 8, 2009, at 3:37 PM, Chris Colbert wrote:
At least I think it is great!
I've managed (with the help of the community) to get ctypes function pointers to play nice with cython.
I've also re-implented the IplImage struct in cython and figured out how to populate the struct with numpy stride information and the numpy data pointer.
This all means that we now have the ability to to call OpenCV functions with plain numpy arrays as arguments, and the array gets modified in place!. And since i'm using ctypes to grab the function handle, OpenCV is not required to be on the users machine during build time, but if and when they install the opencv lib, they automagically work!
I've a got a working (albeit ugly) example attached. You'll obviously need opencv installed if you want to test it.
Just use PIL to open any image on your system then dump it into a numpy array then call testnumpy.test(arr) on that array.
Dump the array back into a PIL image and call show() on it. Voila! your image has been guassianed blurred courtesy of OpenCV.
So, now that I have the logistics of this figured out and I know it actually works, looks like I'll have plenty to implement during the upcoming sprint.
Cheers!
Chris <testnumpy.pyx>