|
enum TriclopsError | triclopsBuildColorStereoPairFromBuffers (const TriclopsContext context, TriclopsColorImage *right, TriclopsColorImage *left, TriclopsColorStereoPair *triclopsInput) |
| Joins two color images in a single side-by-side structure. More...
|
|
enum TriclopsError | triclopsBuildColorStereoPairFromFile (const TriclopsContext context, const char *filename, TriclopsColorPixelFormat pixelFormat, TriclopsColorStereoPair *triclopsInput) |
| Loads a color picture from file in a side-by-side structure. More...
|
|
enum TriclopsError | triclopsBuildMonoStereoPairFromBuffers (const TriclopsContext context, TriclopsImage *right, TriclopsImage *left, TriclopsMonoStereoPair *triclopsInput) |
| Joins two greyscale images in a single side-by-side structure. More...
|
|
enum TriclopsError | triclopsBuildMonoStereoPairFromFile (const TriclopsContext context, const char *filename, TriclopsMonoStereoPair *triclopsInput) |
| Loads a greyscale picture from file in a side-by-side structure. More...
|
|
enum TriclopsError | triclopsFreeColorStereoPair (TriclopsColorStereoPair *stereoPair, bool isSingleBuffer) |
| Releases a color side-by-side image structure. More...
|
|
enum TriclopsError | triclopsFreeMonoStereoPair (TriclopsMonoStereoPair *stereoPair, bool isSingleBuffer) |
| Releases a greyscale side-by-side image structure. More...
|
|
enum TriclopsError | triclopsGetColorImage (const TriclopsContext context, TriclopsColorImageType imageType, TriclopsCamera camera, TriclopsColorImage *image) |
| Retrieves a 32-bit color image form a context. More...
|
|
enum TriclopsError | triclopsGetImage (const TriclopsContext context, TriclopsImageType imageType, TriclopsCamera camera, TriclopsImage *image) |
| Retrieves an 8-bit greyscale image form a context. More...
|
|
enum TriclopsError | triclopsGetImage16 (const TriclopsContext context, TriclopsImage16Type imageType, TriclopsCamera camera, TriclopsImage16 *image) |
| Retrieves a 16-bit greyscale image form a context. More...
|
|
enum TriclopsError | triclopsLoadColorImageFromBuffer (TriclopsColorPixel *buffer, unsigned int nrows, unsigned int ncols, unsigned int rowinc, TriclopsColorImage *image) |
| Load a color image from a buffer. More...
|
|
enum TriclopsError | triclopsLoadColorImageFromFile (const char *filename, TriclopsColorPixelFormat pixelFormat, TriclopsColorImage *image) |
| Load a color image from a file. More...
|
|
enum TriclopsError | triclopsLoadImage16FromBuffer (unsigned short *buffer, unsigned int nrows, unsigned int ncols, unsigned int rowinc, TriclopsImage16 *image) |
| Load a 16-bit image from a buffer. More...
|
|
enum TriclopsError | triclopsLoadImage16FromFile (const char *filename, TriclopsImage16 *image) |
| Load a 16-bit image from a file. More...
|
|
enum TriclopsError | triclopsLoadImageFromBuffer (unsigned char *buffer, unsigned int nrows, unsigned int ncols, unsigned int rowinc, TriclopsImage *image) |
| Load a 8-bit image from a buffer. More...
|
|
enum TriclopsError | triclopsLoadImageFromFile (const char *filename, TriclopsImage *image) |
| Load a 8bit image from a file. More...
|
|
enum TriclopsError | triclopsSaveColorImage (TriclopsColorImage *image, const char *filename, TriclopsColorPixelFormat pixelFormat) |
| Saves a color image to memory. More...
|
|
enum TriclopsError | triclopsSaveImage (TriclopsImage *image, const char *filename) |
| Saves a greyscale image to memory. More...
|
|
enum TriclopsError | triclopsSaveImage16 (TriclopsImage16 *image, const char *filename) |
| Saves a 16-bit image to memory. More...
|
|
General image functions using to manipulate image structures used in Triclops. Triclops uses 8-bit greyscale images as inputs for Edge filtering and disparity computations and accepts both 8-bit greyscale and 32-bit color images for frame rectification. The images have to be packed in specific structures (i.e. TriclopsMonoStereoPair and TriclopsColorStereoPair) in order to be accepted as valid stereo inputs.
Depth maps are stored as 16-bit images, with every pixel representing a depth in fixed point format (12 integer bits, 4 decimal bits).
Triclops' Image management
All of the functions that retrieve frames from contexts perform only shallow copies of the frames, effectively pointing at internal data locations. This means that it is necessary to perform a hard copy of the image data every time the frame data is needed after destroying the context or after refreshing a context's internal buffers.
The file formats currently supported are PGM, PPM, PNG and TIFF formats.
Joins two color images in a single side-by-side structure.
This function performs the same operation than triclopsBuildMonoStereoPairFromBuffers() but it is intended for color images
- Parameters
-
context | Any context |
right | The right image of the pair |
left | The left image of the pair |
triclopsInput | The stereo pair to populate using the images |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidBuffers | Either one or both input images pointers are NULL |
TriclopsErrorInvalidSourceResolution | The resolutions of the input images are different |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- triclopsBuildColorStereoPairFromFile()
-
triclopsBuildMonoStereoPairFromBuffers()
-
triclopsFreeColorStereoPair()
Loads a color picture from file in a side-by-side structure.
This function performs the same operation than triclopsBuildMonoStereoPairFromFile() but it is intended for color images.
- Parameters
-
context | Any context |
filename | Path to the side-by-side picture |
pixelFormat | Pixel color encoding of the picture to load |
triclopsInput | The stereo pair to populate using the image from memory |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidBuffers | The image load function returned a NULL pointer [This should never happen] |
TriclopsErrorInvalidSourceResolution | One of the two dimensions of the input image is invalid (e.g. too large) |
TriclopsErrorNotSupportedImageFileFormat | The format of the provided image is not supported |
TriclopsErrorInvalidContext | The provided context is invalid |
TriclopsErrorInvalidBitdepthImage | The size of one pixel in terms of number of bits is invalid. |
- See also
- triclopsBuildColorStereoPairFromBuffers()
-
triclopsBuildMonoStereoPairFromFile()
-
triclopsFreeColorStereoPair()
Joins two greyscale images in a single side-by-side structure.
This function performs only a shallow copy of the two images provided, meaning that both images should be valid for the whole life of the stereo pair structure. The two images need to have the same resolution for this function to correctly execute.
- Parameters
-
context | Any context |
right | The right image of the pair |
left | The left image of the pair |
triclopsInput | The stereo pair to populate using the images |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidBuffers | Either one or both input images pointers are NULL |
TriclopsErrorInvalidSourceResolution | The resolutions of the input images are different |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- triclopsBuildMonoStereoPairFromFile()
-
triclopsBuildColorStereoPairFromBuffers()
-
triclopsFreeMonoStereoPair()
Loads a greyscale picture from file in a side-by-side structure.
- Parameters
-
context | Any context |
filename | Path to the side-by-side picture |
triclopsInput | The stereo pair to populate using the image from memory |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidBuffers | The image load function returned a NULL pointer [This should never happen] |
TriclopsErrorInvalidSourceResolution | One of the two dimensions of the input image is invalid (e.g. too large) |
TriclopsErrorNotSupportedImageFileFormat | The format of the provided image is not supported |
TriclopsErrorInvalidContext | The provided context is invalid |
TriclopsErrorInvalidBitdepthImage | The size of one pixel in terms of number of bits is invalid. |
- See also
- triclopsBuildMonoStereoPairFromBuffers()
-
triclopsBuildColorStereoPairFromFile()
-
triclopsFreeMonoStereoPair()
Retrieves a 32-bit color image form a context.
The function performs the same operation as triclopsGetImage(), but retrieves color frames (i.e. colored unrectified and rectified images)
- Parameters
-
context | The context where to retrieve the frame |
imageType | The frame to retrieve |
camera | The sensor relative to the frame |
image | The image to fill with the data retrieved |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidCamera | The chosen sensor is non-existent (e.g. int casted to TriclopsCamera) |
TriclopsErrorInvalidParameter | The chosen frame is non-existent (e.g. int casted to TriclopsCamera) |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- TriclopsColorImage
-
triclopsSaveColorImage()
-
triclopsGetImage()
Retrieves an 8-bit greyscale image form a context.
The function retrieves an image from the internal frame buffers of the provided context. The frame can be relative to either sensor of the camera.
- Parameters
-
context | The context where to retrieve the frame |
imageType | The frame to retrieve |
camera | The sensor relative to the frame |
image | The image to fill with the data retrieved |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidCamera | The chosen sensor is non-existent (e.g. int casted to TriclopsCamera) |
TriclopsErrorInvalidRequest | The chosen frame is TriImg_EDGE even though Edge filtering is deactivated |
TriclopsErrorInvalidParameter | The chosen frame is non-existent (e.g. int casted to TriclopsCamera) |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- TriclopsImage
-
triclopsSaveImage()
-
triclopsGetImage16()
Retrieves a 16-bit greyscale image form a context.
The function performs the same operation as triclopsGetImage(), but only retrieves 16-bit frames (i.e. depth maps).
- Parameters
-
context | The context where to retrieve the frame |
imageType | The frame to retrieve |
camera | The sensor relative to the frame |
image | The image to fill with the data retrieved |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidCamera | The chosen sensor is non-existent (e.g. int casted to TriclopsCamera) |
TriclopsErrorInvalidParameter | The chosen frame is non-existent (e.g. int casted to TriclopsCamera) |
TriclopsErrorInvalidContext | The provided context is invalid |
- See also
- TriclopsImage16
-
triclopsSaveImage16()
-
triclopsGetImage()
Load a color image from a buffer.
The function performs the same operation as triclopsLoadColorImageFromFile(), but only retrieves a color frames from a buffer rather than a file. It carries out a shallow copy of the buffer.
- Parameters
-
buffer | The pointer to the buffer containing image values |
nrows | The number of rows of the buffer |
ncols | The number of columns of the buffer |
rowinc | The pitch, or row increment for the image. rowinc must be a multiple of cols |
image | The pointer to the structure describing the image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidBuffer | The buffer is null |
TriclopsErrorInvalidRowInc | The row increment is invalid. |
- See also
- triclopsLoadImageFromBuffer()
-
triclopsLoadImage16FromBuffer()
-
triclopsLoadColorImageFromFile()
Load a color image from a file.
The function performs the same operation as triclopsLoadImageFromFile(), triclopsLoadImage16FromFile(), but only retrieves color frames (i.e. raw and rectified images).
The path should contain a full filename, including the extension, in order for the function to understand which
- Parameters
-
filename | The path to the image filename |
pixelFormat | The format of the color pixel |
image | The pointer to the structure describing the loaded image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorFileRead | The image has not been successfully from file |
TriclopsErrorNotSupportedImageFileFormat | The image format is not supported or unknown |
TriclopsErrorInvalidBitdepthImage | The size of one pixel in bits is invalid. Supported pixel size values are 24 and 32. |
TriclopsErrorNotSupportedColorPixelFormat | The format of pixels is not supported |
- See also
- triclopsLoadImageFromFile()
-
triclopsLoadImage16FromFile()
enum TriclopsError triclopsLoadImage16FromBuffer |
( |
unsigned short * |
buffer, |
|
|
unsigned int |
nrows, |
|
|
unsigned int |
ncols, |
|
|
unsigned int |
rowinc, |
|
|
TriclopsImage16 * |
image |
|
) |
| |
Load a 16-bit image from a buffer.
The function performs the same operation as triclopsLoadImage16FromFile(), but only retrieves 16-bit frames from a buffer rather than a file. It carries out a shallow copy of the buffer.
- Parameters
-
buffer | The pointer to the buffer containing image values |
nrows | The number of rows of the buffer |
ncols | The number of columns of the buffer |
rowinc | The pitch, or row increment for the image. rowinc must be a multiple of cols |
image | The pointer to the structure describing the image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidBuffer | The buffer is null |
TriclopsErrorInvalidRowInc | The row increment is invalid. |
- See also
- triclopsLoadImageFromBuffer()
-
triclopsLoadColorImageFromBuffer()
-
triclopsLoadImage16FromFile()
Load a 16-bit image from a file.
The function performs the same operation as triclopsLoadImageFromFile(), triclopsLoadColorImageFromFile(), but only retrieves 16-bit frames (i.e. disparity maps).
The path should contain a full filename, including the extension, in order for the function to understand which
- Parameters
-
filename | The path to the image filename. |
image | The pointer to the structure describing the loaded image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorFileRead | The image has not been successfully from file |
TriclopsErrorNotSupportedImageFileFormat | The image format is not supported or unknown |
TriclopsErrorInvalidBitdepthImage | The size of one pixel in bits is not 16, as expected |
- See also
- triclopsLoadImageFromFile()
-
triclopsLoadColorImageFromFile()
enum TriclopsError triclopsLoadImageFromBuffer |
( |
unsigned char * |
buffer, |
|
|
unsigned int |
nrows, |
|
|
unsigned int |
ncols, |
|
|
unsigned int |
rowinc, |
|
|
TriclopsImage * |
image |
|
) |
| |
Load a 8-bit image from a buffer.
The function performs the same operation as triclopsLoadImageFromFile(), but only retrieves 8-bit frames from a buffer rather than a file. It carries out a shallow copy of the buffer.
- Parameters
-
buffer | The pointer to the buffer containing image values |
nrows | The number of rows of the buffer |
ncols | The number of columns of the buffer |
rowinc | The pitch, or row increment for the image. rowinc must be a multiple of cols |
image | The pointer to the structure describing the image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidBuffer | The buffer is null |
TriclopsErrorInvalidRowInc | The row increment is invalid. |
- See also
- triclopsLoadImage16FromBuffer()
-
triclopsLoadColorImageFromBuffer()
-
triclopsLoadImageFromFile()
Load a 8bit image from a file.
The function performs the same operation as triclopsLoadImage16FromFile(), triclopsLoadColorImageFromFile(), but only retrieves 8-bit frames (i.e. raw, rectified and edge images).
The path should contain a full filename, including the extension, in order for the function to understand which file format to use when loading the image.
- Parameters
-
filename | The path to the image filename. |
image | The pointer to the structure describing the loaded image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorFileRead | The image has not been successfully from file |
TriclopsErrorNotSupportedImageFileFormat | The image format is not supported or unknown |
TriclopsErrorInvalidBitdepthImage | The size of one pixel in bits is not 8, as expected |
- See also
- triclopsLoadImage16FromFile()
-
triclopsLoadColorImageFromFile()
Saves a color image to memory.
This function saves color frames (i.e. colored unrectified and rectified images)
The path should contain a full filename, including the extension, in order for the function to understand which file format to use when saving the image.
- Parameters
-
image | The image to save to memory |
filename | The path where to save the image |
pixelFormat | The format of the color pixel |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidFilename | The provided file path is invalid |
TriclopsErrorNotSupportedImageFileFormat | The chosen image format is not supported |
TriclopsErrorNotSupportedColorPixelFormat | The format of pixels is not supported |
- See also
- triclopsSaveImage()
-
triclopsSaveImage16()
Saves a greyscale image to memory.
The path should contain a full filename, including the extension, in order for the function to understand which file format to use when saving the image.
- Parameters
-
image | The image to save to memory |
filename | The path where to save the image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidParameter | The provided path is an empty string |
TriclopsErrorNotSupportedImageFileFormat | The chosen image format is not supported |
- See also
- triclopsSaveImage16()
-
triclopsSaveColorImage()
Saves a 16-bit image to memory.
The path should contain a full filename, including the extension, in order for the function to understand which file format to use when saving the image.
- Parameters
-
image | The image to save to memory |
filename | The path where to save the image |
- Returns
- An error code representing the outcome of the function
- Return values
-
TriclopsErrorOk | The function completed successfully |
TriclopsErrorInvalidParameter | The provided path is an empty string |
TriclopsErrorNotSupportedImageFileFormat | The chosen image format is not supported |
- See also
- triclopsSaveImage()
-
triclopsSaveColorImage()