Back

Installing OpenCV 2 on Your Computer

Follow the links and note:

Windows

In step 8, the cv2.pyd is in your x86/ folder.

Mac

You may need to install homebrew first.
Install CV 2, rather than the newest CV 3. Most test codes and existing projects are written in CV 2.

Linux

If you have a RaspberryPi, you may want to run OpenCV on it.

Testing

Download the test codes from course website.

You may need to modify the path of test images in the code.
Create a directory on your computer for your CV class. Dropbox is highly recommended.
Suppose you're under the root of Dropbox. Create a folder called csc391CV/.
In this folder, create a folder called slides/; create another folder called codes/.
The idea is to keep your files well organized, rather than putting everything on your Desktop/.
Put the sample codes in codes/.

Now open the executable in Windows, or type python in terminal.
You should see a terminal environment with >>> sign.
Type:
>>> import cv2, numpy 
>>> cv2.__version__
You should see the version information if you have installed OpenCV correctly.
Exit the python environment, and type:
$ python 1-1-show.py 
			
An image window should appear. Click on it and press any key to close it.
Try the other samples using the same method.

You can also terminate the tests by pressing Ctrl+C (Win) or Cmd+C(Mac).