First time here? Check out the FAQ!

Ask Your Question
0

Python and OpenCV installation

asked Nov 26 '12

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi guys, I am new to Python and OpenCV. So prob this will be a dumb question but I would very much appreciate the answer. thanks.

  1. Based on the web search I installed Python 2.7 WIN 32 bit, and the latest OpenCV 2.4.3. I also installed numpy.

  2. I copied cv2.pyd from opencv folder to lib/site-packages python folder

  3. import cv2 as cv in python

  4. looks ok... no error...

  5. there are no functions such as Load, LoadImage, LoadImageM.... basically no functions that are present in python cookbook http://opencv.willowgarage.com/documentation/python/cookbook.html ...

Now the most basic question:

How can I install opencv so I can go thorough examples from python cookbook from the above link???

Thank you.

Preview: (hide)

2 answers

Sort by » oldest newest most voted
2

answered Nov 27 '12

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi,
You have installed properly! The point is you should import cv not cv2 if you want to use the old functions.

import cv
import cv2

cv.LoadImage("your Image")
cv2.imread("your image")
Preview: (hide)

Comments

Thank you. Well if all that can be done with cv, can also be done with cv2, I'll stick with cv2.

noblerabbit gravatar imagenoblerabbit (Nov 27 '12)edit
0

answered Jul 5 '14

you can use 64bit OpenGl compiled OpenCV or use "cv2.waitkey()" after "imshow" like this: cv2.imshow('my Image', Img) a = cv2.waitkey(0) if (a == 27) cv2.destroyAllWindows()

Preview: (hide)

Question Tools

Stats

Asked: Nov 26 '12

Seen: 1,378 times

Last updated: Jul 21 '14