This chapter is a quick guide to setting up Python 2.7, OpenCV, and related libraries. After setup, we also look at OpenCV's Python sample scripts and documentation.
The following related libraries are covered:
NumPy: This is a dependency of OpenCV's Python bindings. It provides numeric computing functionality, including efficient arrays.
SciPy: This is a scientific computing library that is closely related to NumPy. It is not required by OpenCV but it is useful for manipulating the data in OpenCV images.
OpenNI: This is an optional dependency of OpenCV. It adds support for certain depth cameras, such as Asus XtionPRO.
SensorKinect: This is an OpenNI plugin and optional dependency of OpenCV. It adds support for the Microsoft Kinect depth camera.
For this book's purposes, OpenNI and SensorKinect can be considered optional. They are used throughout Chapter 5, Separating Foreground/Background Regions Depth, but are not used in the other chapters or appendices.
At the time of writing, OpenCV 2.4.3 is the latest version. On some operating systems, it is easier to set up an earlier version (2.3.1). The differences between these versions should not affect the project that we are going to build in this book.
Some additional information, particularly about OpenCV's build options and their dependencies, is available in the OpenCV wiki at http://opencv.willowgarage.com/wiki/InstallGuide. However, at the time of writing, the wiki is not up-to-date with OpenCV 2.4.3.