Ask Your Question
3

Why do python bindings for v3 still use package name "cv2"?

asked 2015-06-06 23:40:11 -0600

hoju gravatar image

I compiled the python bindings for latest version and found the package name is still cv2:

>>> import cv3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named cv3
>>> import cv2
>>> cv2.__version__
'3.0.0'

Is the package name going to be updated to cv3?

edit retag flag offensive close merge delete

Comments

1

I guess, cv2 means cv "convert to" ,it's not version.:)

wuling gravatar imagewuling ( 2015-06-07 00:49:57 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
4

answered 2015-06-07 03:34:51 -0600

@wuling HAHA this is really the funniest explanation I have read around here.

@hoju, actually the 2 does not refer to the version number of OpenCV. Basically it is the difference between the underlying C API, which is denoted by the cv prefix and the C++ API which is denoted by the cv2 prefix. This is mainly a historical matter and it is kept to keep backwards compatibility. It also allows you to combine the C and C++ interface if you really need it, but which is discouraged a lot!

edit flag offensive delete link more

Comments

1

got it - thanks!

hoju gravatar imagehoju ( 2015-06-08 02:50:13 -0600 )edit
1

Afaik cv2.cv doesn't exist any more for v3.0.

Guanta gravatar imageGuanta ( 2015-06-08 07:50:25 -0600 )edit
1

@Guanta, that is because they want to kick out the C-API and replace it in the near future by auto generated C-wrappers based on numl, a functional language able to create vectorized C code as seen in the CVPR presentation of last sunday.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-06-08 08:05:25 -0600 )edit

Do you know of a guide/table for porting code which used cv2.cv to using plain cv2 ?? Thanks!

hayd gravatar imagehayd ( 2015-08-17 14:25:46 -0600 )edit

The easiest way is to use the 2.4.11 documentation. You search based on the C function and it will show you the equivalent C++ option. For python that is cv and cv2.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-08-18 02:06:01 -0600 )edit

@StevenPuttemans can you provide a link to this numl language? I can't seem to find anything like that, except for numl.net, which I guess is probably not what you meant.

glopes gravatar imageglopes ( 2015-08-23 08:01:40 -0600 )edit

I did not yet found a page explaining it. I only read it in a the OpenCV CVPR2015 presentation.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-08-31 08:15:10 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-06-06 23:40:11 -0600

Seen: 33,515 times

Last updated: Jun 07 '15