Triclops SDK
4.0.3.0
Functions
Triclops Context Manipulation

Functions

enum TriclopsError triclopsCopyContext (const TriclopsContext contextIn, TriclopsContext *contextOut)
 Copies the contents of a context to another context. More...
 
enum TriclopsError triclopsDestroyContext (TriclopsContext context)
 Destroys a context. More...
 
enum TriclopsError triclopsGetDefaultContextFromFile (TriclopsContext *defaultContext, const char *filename)
 Sets up a new context using the information retrieved from a configuration file. More...
 
enum TriclopsError triclopsGetDefaultContextFromMemory (TriclopsContext *defaultContext, void *fileData)
 Sets up a new context using the information retrieved from a configuration file loaded on memory. More...
 
enum TriclopsError triclopsWriteCurrentContextToFile (TriclopsContext context, const char *filename)
 Writes on file the current context configuration. More...
 
enum TriclopsError triclopsWriteDefaultContextToFile (TriclopsContext context, const char *filename)
 Writes on file the default context configuration. More...
 

Detailed Description

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.

Function Documentation

enum TriclopsError triclopsCopyContext ( const TriclopsContext  contextIn,
TriclopsContext contextOut 
)

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
contextInThe source context
contextOutThe destination context
Returns
An error code representing the outcome of the function
Return values
TriclopsErrorOkThe function completed successfully
TriclopsErrorFileWriteThe system returned an error while trying to write the file on disk
TriclopsErrorInvalidContextThe provided context is invalid
See also
triclopsDestroyContext()
enum TriclopsError triclopsDestroyContext ( TriclopsContext  context)

Destroys a context.

Parameters
contextThe context to destroy
Returns
An error code representing the outcome of the function
Return values
TriclopsErrorOkThe function completed successfully
TriclopsErrorInvalidContextThe provided context is invalid
enum TriclopsError triclopsGetDefaultContextFromFile ( TriclopsContext defaultContext,
const char *  filename 
)

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
defaultContextThe context to be initialized
filenameThe path to the configuration file
Returns
An error code representing the outcome of the function
Return values
TriclopsErrorOkThe function completed successfully
TriclopsErrorInvalidFilenameThe provided filename is invalid (i.e. NULL pointer)
TriclopsErrorBadMemoryAllocationThe operating system could not initialize a new context
TriclopsErrorFileReadThe provided context is invalid
TriclopsErrorCorruptConfigFileThe provided config file is invalid
TriclopsErrorCameraConfigAlreadySetThe provided context has been already initialized
TriclopsErrorInvalidContextThe function resulted in an invalid context
See also
triclopsGetDefaultContextFromMemory()
triclopsWriteDefaultContextToFile()
triclopsWriteCurrentContextToFile()
enum TriclopsError triclopsGetDefaultContextFromMemory ( TriclopsContext defaultContext,
void *  fileData 
)

Sets up a new context using the information retrieved from a configuration file loaded on memory.

This function performs the same operations as triclopsGetDefaultContextFromFile() but requires a pointer to the configuration data loaded in memory, instead of a configuration file path.

Parameters
defaultContextThe context to be initialized
fileDataPointer to the data loaded in memory
See also
triclopsGetDefaultContextFromFile()
triclopsWriteDefaultContextToFile()
triclopsWriteCurrentContextToFile()
enum TriclopsError triclopsWriteCurrentContextToFile ( TriclopsContext  context,
const char *  filename 
)

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
contextThe context from which to retrieve the default configuration
filenameThe path to the configuration file
Returns
An error code representing the outcome of the function
Return values
TriclopsErrorOkThe function completed successfully
TriclopsErrorFileWriteThe system returned an error while trying to write the file on disk
TriclopsErrorInvalidContextThe provided context is invalid
See also
triclopsWriteDefaultContextToFile()
enum TriclopsError triclopsWriteDefaultContextToFile ( TriclopsContext  context,
const char *  filename 
)

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
contextThe context from which to retrieve the default configuration
filenameThe path to the configuration file
Returns
An error code representing the outcome of the function
Return values
TriclopsErrorOkThe function completed successfully
TriclopsErrorFileWriteThe system returned an error while trying to write the file on disk
TriclopsErrorInvalidContextThe provided context is invalid
See also
triclopsGetDefaultContextFromFile()
triclopsWriteCurrentContextToFile()
Contact Support Triclops SDK Programmer's Guide and API Reference