OpenCV?

Chris Colbert sccolbert at gmail.com
Fri Oct 2 10:35:19 EDT 2009


The new interface however, still requires that the person "learn" opencv.

Since that wrapper is relatively complete (and i've heard actually
quite good) I see know reason to have my wrapper wrap the entire
library.

So i thought it would be better if I changed its focus to be
completely pythonic and work seamlessly with numpy. i.e. the user
shouldnt need to know (or care) that the backend is opencv.

Further, if I were to subclass ndarray, the only functions from opencv
we would need to wrap, are the ones we want... and then the lib could
be statically linked to eliminate the dependency...

Chris

On Fri, Oct 2, 2009 at 4:21 PM, Carlos da Silva Santos
<carlos.s.santos at gmail.com> wrote:
>
> I have no experience with OpenCV but I saw that OpenCV 2.O (released
> last week) has a new python interface. From what I could tell, they
> are using a custom wrapper generator (i.e no swig, ctypes or cython):
>
> http://opencv.willowgarage.com/wiki/PythonInterface
>
> Cheers,
>
> Carlos
>
> On Fri, Oct 2, 2009 at 2:03 PM, Chris Colbert <sccolbert at gmail.com> wrote:
>>
>> I actually started work on an OpenCV wrapper using Cython a couple of
>> months ago. I got about 25% complete but then got busy with other
>> things. I was real carefully about releasing the GIL whenever possible
>> to make multi-core usage a reality. In some basic tests, the
>> performance was on par with using opencv from pure C (more or less).
>>
>> 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 have some free time now again, and I could ramp back up my work on
>> this or perhaps merge the work into this project if the devs show
>> interest.
>>
>> You can take a look at the current code here:
>>
>> http://code.google.com/p/cython-opencv/
>>
>> Cheers!
>>
>> Chris
>>
>> On Sep 25, 11:21 am, Stéfan van der Walt <ste... at sun.ac.za> wrote:
>>> 2009/9/25 Damian Eads <e... at soe.ucsc.edu>:
>>>
>>> > Have you considered LIBCVD as an alternative to OpenCV? It is highly
>>> > optimized for frame-rate real-time applications but also has a nice,
>>> > succinct, simple (almost pythonic) syntax.
>>>
>>> What is the feature scope of CVD compared to OpenCV?
>>>
>>> Stéfan
>



More information about the scikit-image mailing list