Software 2

Now we’re ready to install the rest of the software.  This includes opencv, the package that helps us collect, save, and display frames. You can read about it here.  Then we can build the programs I wrote that tell the camera how big the subframe should be, how many frames to collect at what rate, and where to store the frames.

Install OpenCV.

First we need to install CMake, a program that helps us build big programs.  We’ll use MacPorts to help us install CMake.

  1. Get MacPorts.  Go to https://www.macports.org/install.php and follow the directions.  When that’s installed, in Terminal, type
  2. sudo port -v selfupdate    — “sudo” lets you do things you need extra permissions for.  You’ll need to put in your password.  A bunch of stuff will go by, then end with:
    The ports tree has been updated. To upgrade your installed ports, you should run port upgrade outdated
  3. $ sudo port install cmake
    bunch of stuff. Should end with “no broken files found”

Now, download OpenCV from OpenCV for Linux/Mac and copy “opencv-3.0.0.zip” from ~/Downloads to ~/src and unpack it.

$ cd ~/src/opencv-3.0.0
$ mkdir build
$ cd build
cmake -G “Unix Makefiles” ..

A whole bunch of stuff will go by, but if you scroll up a bit, you’ll see:

--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     QuickTime:                   NO
--     QTKit:                       YES

We need PvAPI to talk to our camera (most people don’t have a superfast, expensive camera like that, so it doesn’t include the code for it automatically). Do this:

emacs CMakeCache.txt      — “emacs” is a text editor.  If you don’t know how to use it, you can probably use TextEdit, but make sure it’s in plain-text mode.

search for lines with PvAPI and change them to:

PVAPI_INCLUDE_PATH:PATH=/usr/local/include
PVAPI_LIBRARY:PATH=/usr/local/lib/libPvAPI.dylib
WITH_PVAPI:BOOL=ON

save the file and exit the editor.  Next,  while still in the ‘build’ directory

$ make -j8
and wait a long time for it to all compile.  Then, if there are no errors,

$ sudo make install

Now, we’re done with this part.