Ask Your Question
1

What's the difference between cv and cv2 using python2?

asked Oct 15 '13

DralKhogo gravatar image

I've compiled OpenCV-2.4.6 on Windows machine and using Python2.7 to create OpenCV applications.

There lots of examples out there on the web but you can't use them right away and need to fix to make them run, because some of them use "cv", others use "cv2" or other packages. What's the main difference between import cv and import cv2 on python2? Is cv2 an extension to cv and you always must use cv2? Are there bigger amount of functions in cv2 but some of them are only in cv?

cv or cv2? or both?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
3

answered Oct 15 '13

berak gravatar image

import cv will load the old c-api bindings. IplImage and such. try not to use that, as the support for the old api will end soon.

instead, use import cv2, which wraps the c++ api, and uses numpy arrays for images

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Oct 15 '13

Seen: 14,668 times

Last updated: Oct 15 '13