0

What technique/library is used for Python binding in OpenCV2.0?

I am aware there there are a number of libraries for C++/Python binding and that previous versions of OpenCV were using SWING library.

I am testing Python in Python Tools for Visual Studio which has code completition (intellisense) built in. However, for current OpenCV Python bindings it displays only function names in interactive window. In editor, it does not even display the function names.

Is it possible to have intellisense working on parameter level for C++ Python bindings?

2
  • 1
    answers.opencv.org/question/6618/how-python-api-is-generated Commented Apr 19, 2013 at 18:38
  • @AbidRahmanK: You should post that as an answer. Unless you think the question needs to be closed, what else could an answer say besides that link, and maybe a brief summary of its contents? Commented Apr 19, 2013 at 18:47

1 Answer 1

3

What technique/library is used for Python binding in OpenCV2.0?

Vadim Pisarevsky, one of the core developers of OpenCV, has given a brief answer for this question here: How Python API is generated?. He says:

We do not use SWIG or any other standard wrapper generation tool. We did not find such tools that would produce satisfying results.

Instead, we use our own purely Python-based solution for parsing OpenCV headers

The parser is at opencv/modules/python/src2/hdr_parser.py

After all the API is extracted, we use some more python code (opencv/modules/python/src2/gen2.py) to produce Python wrappers.

Sign up to request clarification or add additional context in comments.

4 Comments

Does it mean that if OpenCV used different binding, the code competition would work? Or am I doing something wrong?
I am sorry, I didn't get "code competition"? Did you mean code completion? If so, default Python IDLE in windows has code completion. It even shows arguments also.
@AbidRahmanK Do you think that trying to use cython to call the C++ api for OpenCV would provide a speed gain over using the standard python bindings?
@Raoul: sorry, no idea. As far as I know, Cython is a translator from Python to C. So I doubt if it will bring any speed gain over original C.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.