Python Fun

Jun 11, 2009 10:06

So, I work with images and Python a lot at work, and came across an interesting issue. I have a C++ DLL I need to pass an image to, but the image is stored internally as a list of integer pixel values, and the DLL expects a C char array. Obviously, a conversion needs to take place. However, this project is destined to run on a 400MHz Geode ( Read more... )

algorithm, vision, python, code, work

Leave a comment

Comments 3

jon787 June 12 2009, 02:33:31 UTC
Which method of integrating python with a C++ DLL are you using? Raw Python C API, pyrex, or what?

It may actually be smartest to do this type coercion right in between since its probably already doing a type coercion right there no matter what you do on each end.

Reply

jon787 June 12 2009, 05:33:24 UTC
I just spent 2 hours debugging a C wrapper for libpcap, now is your chance to pester me on the finer points of the Python C api :)

Reply

agmlego June 12 2009, 15:20:46 UTC
I have been using ctypes to talk to the DLL--seemed to be the most straightforward way of doing it.

Reply


Leave a comment

Up