Functions needed to manipulate the TriclopsContext structure
The Triclops software system allows specifying all characteristics of stereo processing discussed above. Furthermore, the software system allows the specification of multiple stereo processing that may occur on a single set of images. To enable efficient stereo processing of different kinds on the same set of images, the concept of Triclops Contexts is introduced.
By using the Triclops context it is possible to encapsulate all of the information required for a specific kind of stereo processing. Furthermore, multiple Triclops contexts allow for the sharing of data and processing with minimal effort on the user's part. Triclops contexts store camera configuration, parameters of stereo processing, input data and results.
A Triclops context must first be initialized using the configuration of the camera module. Configuration contains information about the number and geometry of the sensors, as well as the intrinsic and extrinsic parameters of the sensors.
A Triclops context is then configured for the specific kind of stereo processing. Parameters such as the processing resolution, disparity range and validations can be specified in order to control the output of the depth computation.
Next, a Triclops context must be assigned images that are to be processed by the stereo kernel. This is done by passing into a context information obtained from the stereo device, or by loading the image information from the file.
The Triclops context is then used for performing image pre-processing and the stereo processing. The results of stereo processing can then be retrieved from the context.
Copies the contents of a context to another context.
This function copies all the parameters and buffer pointers from the source context to the destination context. The buffers will be decoupled once either context will change their contents.
- Parameters
-
contextIn | The source context |
contextOut | The destination context |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorFileWrite | The system returned an error while trying to write the file on disk |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- triclopsDestroyContext()
Destroys a context.
- Parameters
-
context | The context to destroy |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidContext | The provided context is invalid |
Sets up a new context using the information retrieved from a configuration file.
If the configuration did not end correctly the context pointer is set to NULL.
- Parameters
-
defaultContext | The context to be initialized |
filename | The path to the configuration file |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidFilename | The provided filename is invalid (i.e. NULL pointer) |
TriclopsErrorBadMemoryAllocation | The operating system could not initialize a new context |
TriclopsErrorFileRead | The provided context is invalid |
TriclopsErrorCorruptConfigFile | The provided config file is invalid |
TriclopsErrorCameraConfigAlreadySet | The provided context has been already initialized |
TriclopsErrorInvalidContext | The function resulted in an invalid context |
- See also
- triclopsGetDefaultContextFromMemory()
-
triclopsWriteDefaultContextToFile()
-
triclopsWriteCurrentContextToFile()
Writes on file the current context configuration.
The configuration written on file by this function is the configuration that is currently in use by the context, including additional configurations such as stereo and rectification parameters.
- Parameters
-
context | The context from which to retrieve the default configuration |
filename | The path to the configuration file |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorFileWrite | The system returned an error while trying to write the file on disk |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- triclopsWriteDefaultContextToFile()
Writes on file the default context configuration.
The configuration written on file by this function is the original configuration that would be retrieved from a device or a device-specific configuration file.
- Parameters
-
context | The context from which to retrieve the default configuration |
filename | The path to the configuration file |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorFileWrite | The system returned an error while trying to write the file on disk |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- triclopsGetDefaultContextFromFile()
-
triclopsWriteCurrentContextToFile()