Before you can actually start capturing images from a Raytrix light field camera you have to make sure that the Camera is initialized and prepared correctly. To achieve this goal we recommend to follow the instructions of the chapter: Camera Source. Furthermore you can consult the section: Using the Raytrix Light Field API.
Assuming we have prepared, opened and bound the Raytrix camera we can start the capturing process. The Raytrix Light Field API allows three different triggering modes:
The way to retrieve images from a Raytrix light field camera depends on whether you are using managed or unmanaged c++.
Either way we recommend to work with the camera image callback that comes with the Ratrix Light Field API. Nevertheless the programmer has to ensure thread safeness, particularly with regard to GUI interactions. The following image demonstrates the problematic:
There are several ways to implement the interactions between a Raytrix light field camera and a custom application. In this page we are going to introduce two approaches. The first one is an event-based camera communication while the second one shows a more direct communication.
The event-based camera communication shows the most modular approach. This approach needs you to start an independent worker-thread that literally waits on an event to operate. The events can be set by different sources, whereby the camera callback is the one we are most interested in. A great advantage of this implementation is that the GUI thread is encapsulated from the actual image processing, which allows the GUI to be, simultaneously to the worker-thread, responsive. For example the GUI can display the process of the process that is done in the background. The following image illustrates the event-based camera communication:
A simpler way to implement the camera communication would be a direct interaction of camera callback and image processing.
This approach is not as sophisticated as the Event-Based Camera Communication as it blocks the GUI during the image processing. At this implementation a worker-thread is not required since its task is taken on by the GUI thread. As a consequence all user interaction with the GUI are blocked at the time of processing the image. In more detail the difference between the event-based and the direct camera communication is that the image callback does not set an event that an image is available but invokes the processing in the GUI thread directly. The following code example shows the basic idea of the direct camera communication: