Running samples

Running a few sample scripts is a good way to test whether OpenCV is correctly set up. The samples are included in OpenCV's source code archive.

On Windows, we should have already downloaded and unzipped OpenCV's self-extracting ZIP. Find the samples in <unzip_destination>/opencv/samples.

On Unix-like systems, including Mac, download the source code archive from https://github.com/Itseez/opencv/archive/3.0.0.zip and unzip it to any location (if we have not already done so). Find the samples in <unzip_destination>/OpenCV-3.0.0/samples.

Some of the sample scripts require command-line arguments. However, the following scripts (among others) should work without any arguments:

  • python/camera.py: This script displays a webcam feed (assuming ...

Get Learning OpenCV 3 Computer Vision with Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.