OpenCV?

Stéfan van der Walt stefan at sun.ac.za
Fri Oct 2 18:14:48 EDT 2009


Hi Chris

2009/10/2 Chris Colbert <sccolbert at gmail.com>:
> I have since been wanting to get back to working on the wrapper, but
> I've been toying with the idea of instead of just wrapping the OpenCV
> array type and providing functions to convert to and from numpy
> arrays, to use a numpy array as the base data type (perhaps through
> subclassing or a hidden attribute; i havent yet decided) and
> dynamically creating/updating OpenCV array headers that point to the
> numpy data. I think this approach would be more natural and pythonic
> (at a small cost for speed). It would also eleminate the need to wrap
> the entire opencv library as simple manipulations can just be done
> with numpy or scipy.ndimage

I am not familiar with the OpenCV array type, but if it addresses
contiguous memory, this should be fairly easy to achieve by adding an
array interface.  The is basically how we are capable of reading PIL
arrays these days.

An alternative approach would be to write the converter you describe,
using this trick suggested by Travis Oliphant:

http://blog.enthought.com/?p=62

Thanks for contributing!

Regards
Stéfan



More information about the scikit-image mailing list