As we discussed at the start of this chapter, Sunbaker is a variant of Lazy Eyes with support for more cameras. As a starting point, make a copy of the completed LazyEyes.py script from Chapter 7, Seeing a Heartbeat with a Motion-Amplifying Camera, and rename it Sunbaker.py. The supported cameras in Sunbaker will vary depending on the modules that are available at runtime.
Add the following try/except block after the other import statements in Sunbaker.py:
try:
import PySpinCapture
except ImportError:
PySpinCapture = None
The preceding block of code tries to import our PySpinCapture module, which contains our getNumCameras function and our PySpinCapture class. The PySpinCapture module, in turn, imports the PySpin module, as we saw earlier in this chapter in the Capturing images from industrial cameras using PySpin section. If the...