Like any framework, Spinnaker has a learning curve. This answer should help you with the basics of using the SDK to control the camera and will point you to more detailed resources on specific topics.

A great first resource is our set of Spinnaker examples that are installed along with the SDK. Our examples can be found at:

  • Windows: C:\Program Files "FLIR Systems" (or C:\Program Files "Point Grey Research" for Spinnaker 1.)
  • Linux: /opt/spinnaker/src (or /usr/src/spinnaker/src for versions 2.1 and earlier)
  • macOS: /Applications/Spinnaker/src
  • Python: In the Examples folder of the PySpin download.

The Acquisition example is the best place to start. This answer will reference the Acquisition example throughout; it will focus on the C++ version, but the same steps are followed in other languages with minor syntax differences.

How can I access my camera via the API?

This is quite simple and is a common pattern in any Spinnaker code. First you get an instance of the Spinnaker System:

SystemPtr system = System::GetInstance();

Then use this system object to obtain a list of all cameras connected to the system:

CameraList camList = system->GetCameras();

Finally, get the camera from the list. The easiest way to do this is with the GetByIndex method:

CameraPtr pCam = camList.GetByIndex(i);

How do I start transmitting the camera and taking images?

The code to achieve this is also simple, but there are some important concepts to keep in mind. Start the camera transmission with

pCam->BeginAcquisition();

This causes the camera to start acquiring images. It is important to note that at this point, the camera is running asynchronously to the code. In simple terms, after the camera begins acquisition, it will continue to capture images, even while the program is doing nothing. Once the camera captures an image, it is automatically transferred to the PC and stored in the PC's RAM. The space allocated to store that image in memory is called a buffer. A user can only interact with an image once it has been retrieved from the buffer using this method:

ImagePtr pResultImage = pCam->GetNextImage(1000);

The asynchronous nature of the system means that GetNextImage must be called approximately as often as the camera captures an image to avoid losing frames. If GetNextImage is not called often enough, the image buffer may fill up and frames may be lost.

How can I change the camera settings?

This is done through the camera's nodemap which can be accessed with

INodeMap& nodeMap = pCam->GetNodeMap();

Using Spinview to accelerate debugging and development

Spinview is a GUI software that is installed together with Spinnaker. Although it is designed as a demonstration software to show the camera features, this GUI can be very useful during application development. With Spinview it is very easy to quickly read and write to the camera nodemap. At the beginning of development, we recommend using Spinview to configure the camera as desired. This will help to visualize the required node operations, as well as to verify that the camera is able to operate as desired. A quick guide to Spinview is available

Restoration of machine vision cameras

Occasionally, cameras may fall into a bad state and need to be recovered. The easiest way to recover from this is to load the factory default settings on the camera by loading the default user set.

If you have any doubts or questions, please contact us.