Spinnaker SDK C++
4.1.0.338
 
 

 
Loading...
Searching...
No Matches
ImageUtilityStereo Class Reference

Static helper functions for stereo related computations. More...

#include <ImageUtilityStereo.h>

Static Public Member Functions

static bool IsStereoCamera (CameraPtr pCamera)
 Returns true if the camera is a stereo camera or false otherwise.
 
static ImagePtr FilterSpeckles (const ImagePtr &disparityImage, const int maxSpeckleSize, const int speckleThreshold, const float disparityScaleFactor, const float invalidDataValue)
 Filters speckles from a copy of the input mono disparity image.
 
static void FilterSpecklesFromImage (ImagePtr &disparityImage, const int maxSpeckleSize, const int speckleThreshold, const float disparityScaleFactor, const float invalidDataValue)
 Filters speckles in-place on the input mono disparity image.
 
static bool Compute3DPointFromPixel (const uint16_t disparity, const StereoCameraParameters &stereoCameraParameters, Stereo3DPoint &stereo3DPoint)
 Computes 3D point from disparity value.
 
static PointCloud ComputePointCloud (const ImagePtr &disparityImage, const ImagePtr &referenceImage, const PointCloudParameters &pointCloudParameters, const StereoCameraParameters &stereoCameraParameters)
 Computes 3D point cloud from disparity and reference images using a stereo matching algorithm.
 
static void ComputePointCloud (const ImagePtr &disparityImage, const ImagePtr &referenceImage, const PointCloudParameters &pointCloudParameters, const StereoCameraParameters &stereoCameraParameters, PointCloud &pointCloud)
 Computes 3D point cloud from disparity and reference images using a stereo matching algorithm.
 
static bool ComputeDistanceToPoint (const ImagePtr &disparityImage, const StereoCameraParameters &stereoParam, const ImagePixel &imagePixel, float &distance)
 Computes the distance of a point to the camera world coordinates origin, from the disparity image.
 
static bool ComputeDistanceBetweenPoints (const ImagePtr &disparityImage, const StereoCameraParameters &stereoParam, const ImagePixel &imagePixel1, const ImagePixel &ImagePixel2, float &distance)
 Computes the distance between two points in the disparity image.
 
static ImagePtr CreateDepthImage (const ImagePtr &disparityImage, const StereoCameraParameters &stereoCameraParameters, const uint16_t invalidDepthVal, float &minDepthVal, float &maxDepthVal)
 Computes a depth image.
 
static void CreateDepthImage (const ImagePtr &disparityImage, const StereoCameraParameters &stereoCameraParameters, const uint16_t invalidDepthVal, ImagePtr &depthImage, float &minDepthVal, float &maxDepthVal)
 Computes a depth image.
 

Detailed Description

Static helper functions for stereo related computations.

Member Function Documentation

◆ Compute3DPointFromPixel()

static bool Compute3DPointFromPixel ( const uint16_t  disparity,
const StereoCameraParameters stereoCameraParameters,
Stereo3DPoint stereo3DPoint 
)
static

Computes 3D point from disparity value.

Parameters
disparityThe disparity value
stereoCameraParametersThe parameters for the stereo camera
stereo3DPointThe computed 3D point
See also
StereoCameraParameters
Returns
True if the function finished successfully, or false otherwise

◆ ComputeDistanceBetweenPoints()

static bool ComputeDistanceBetweenPoints ( const ImagePtr disparityImage,
const StereoCameraParameters stereoParam,
const ImagePixel imagePixel1,
const ImagePixel ImagePixel2,
float &  distance 
)
static

Computes the distance between two points in the disparity image.

Parameters
disparityImageThe disparity image
stereoParamThe stereo camera parameters
imagePixel1The first pixel in the image
imagePixel2The second pixel in the image
distanceThe distance between the two points
Returns
True if the function finished successfully, or false otherwise

◆ ComputeDistanceToPoint()

static bool ComputeDistanceToPoint ( const ImagePtr disparityImage,
const StereoCameraParameters stereoParam,
const ImagePixel imagePixel,
float &  distance 
)
static

Computes the distance of a point to the camera world coordinates origin, from the disparity image.

Parameters
disparityImageThe disparity image
stereoParamThe stereo camera parameters
imagePixelThe pixel in the image
distanceThe distance of the point to the camera world coordinates origin
Returns
True if the function finished successfully, or false otherwise.

◆ ComputePointCloud() [1/2]

static PointCloud ComputePointCloud ( const ImagePtr disparityImage,
const ImagePtr referenceImage,
const PointCloudParameters pointCloudParameters,
const StereoCameraParameters stereoCameraParameters 
)
static

Computes 3D point cloud from disparity and reference images using a stereo matching algorithm.

Parameters
disparityImageThe disparity image from a stereo pair
referenceImageThe reference image from a stereo pair. This is the image that is used as a reference for the disparity image.
pointCloudParametersThe parameters for computing the point cloud
stereoCameraParametersThe parameters for the stereo camera
See also
StereoCameraParameters
PointCloudParameters
Returns
A PointCloud object containing the computed point cloud

◆ ComputePointCloud() [2/2]

static void ComputePointCloud ( const ImagePtr disparityImage,
const ImagePtr referenceImage,
const PointCloudParameters pointCloudParameters,
const StereoCameraParameters stereoCameraParameters,
PointCloud pointCloud 
)
static

Computes 3D point cloud from disparity and reference images using a stereo matching algorithm.

Parameters
disparityImageThe disparity image from a stereo pair
referenceImageThe reference image from a stereo pair. This is the image that is used as a reference for the disparity image.
pointCloudParametersThe parameters for computing the point cloud
stereoCameraParametersThe parameters for the stereo camera
pointCloudThe computed point cloud will be stored in this object
See also
StereoCameraParameters
PointCloudParameters

◆ CreateDepthImage() [1/2]

static ImagePtr CreateDepthImage ( const ImagePtr disparityImage,
const StereoCameraParameters stereoCameraParameters,
const uint16_t  invalidDepthVal,
float &  minDepthVal,
float &  maxDepthVal 
)
static

Computes a depth image.

A depth image reinterprets disparity data by mapping the disparity for each pixel to a depth (z) value based on the image focal length and baseline. The source image is required to carry disparity information.

Parameters
disparityImageThe source image from which to create the depth values
stereoCameraParametersThe stereo camera parameters
invalidDepthValvalue to mark invalid pixels, where the depth should not be computed for
minDepthValThe actual minimum depth in the image
maxDepthValThe actual maximum depth in the image
Returns
The depth image

◆ CreateDepthImage() [2/2]

static void CreateDepthImage ( const ImagePtr disparityImage,
const StereoCameraParameters stereoCameraParameters,
const uint16_t  invalidDepthVal,
ImagePtr depthImage,
float &  minDepthVal,
float &  maxDepthVal 
)
static

Computes a depth image.

A depth image reinterprets disparity data by mapping the disparity for each pixel to a depth (z) value based on the image focal length and baseline. The source image is required to carry disparity information. The destination is required to be initialized with Mono16 pixel format, and have the same width, height, x offset, and y offset as the source image.

Parameters
disparityImageThe source image from which to create the depth values
stereoCameraParametersThe stereo camera parameters
invalidDepthValvalue to mark invalid pixels, where the depth should not be computed for
depthImageThe destination image in which to store the created depth values
minDepthValThe actual minimum depth in the image
maxDepthValThe actual maximum depth in the image

◆ FilterSpeckles()

static ImagePtr FilterSpeckles ( const ImagePtr disparityImage,
const int  maxSpeckleSize,
const int  speckleThreshold,
const float  disparityScaleFactor,
const float  invalidDataValue 
)
static

Filters speckles from a copy of the input mono disparity image.

Note that only Mono16 pixel format image is supported.

Parameters
disparityImageThe disparity image
maxSpeckleSizeThe maximum allowed speckle size
speckleThresholdThe speckle size threshold
disparityScaleFactorThe coordinate scale factor
invalidDataValueThe value assigned to invalid data
Returns
Speckle filtered image

◆ FilterSpecklesFromImage()

static void FilterSpecklesFromImage ( ImagePtr disparityImage,
const int  maxSpeckleSize,
const int  speckleThreshold,
const float  disparityScaleFactor,
const float  invalidDataValue 
)
static

Filters speckles in-place on the input mono disparity image.

Note that only Mono16 pixel format image is supported.

Parameters
disparityImageThe disparity image
maxSpeckleSizeThe maximum allowed speckle size
speckleThresholdThe speckle size threshold
disparityScaleFactorThe coordinate scale factor
invalidDataValueThe value assigned to invalid data

◆ IsStereoCamera()

static bool IsStereoCamera ( CameraPtr  pCamera)
static

Returns true if the camera is a stereo camera or false otherwise.

Parameters
pCameraThe camera
Returns
True if the camera is stereo camera, or false otherwise

The documentation for this class was generated from the following file: