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 | ProcessDisparity (const ImagePtr &disparityImage, const ImagePtr &rectifiedImage, const DisparityProcessingMethod processingMethod, const StereoCameraParameters &stereoCameraParameters) |
| Post-process the disparity image by filling in holes and reducing noise using the specified disparity processing method. | |
| static void | ProcessDisparityFromImage (ImagePtr &disparityImage, const ImagePtr &rectifiedImage, const DisparityProcessingMethod processingMethod, const StereoCameraParameters &stereoCameraParameters) |
| static ImagePtr | FilterSpeckles (const ImagePtr &disparityImage, const int maxSpeckleSize, const float 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 float speckleThreshold, const float disparityScaleFactor, const float invalidDataValue) |
| Filters speckles in-place on the input mono disparity image. | |
| static ImagePtr | CreateGradientImage (const ImagePtr &rectifiedImage) |
| Creates an 8-bit gradient magnitude image from rectified image. | |
| static void | CreateGradientImage (const ImagePtr &rectifiedImage, ImagePtr &gradientImage) |
| Creates an 8-bit gradient magnitude image from rectified image. | |
| static ImagePtr | EdgeInterpolation (const ImagePtr &disparityImage, const float invalidDataValue, const ImagePtr &gradientImage, const float edgeThreshold, const int maxDistance) |
| Performs edge-aware interpolation on the input disparity image to fill in invalid pixels, using information from nearby valid pixels and edges. | |
| static void | EdgeInterpolationFromImage (ImagePtr &disparityImage, const float invalidDataValue, const ImagePtr &gradientImage, const float edgeThreshold, const int maxDistance) |
| Performs edge-aware interpolation in-place on the input disparity image to fill in invalid pixels, using information from nearby valid pixels and edges. | |
| static ImagePtr | JointBilateral (const ImagePtr &disparityImage, const ImagePtr &rectifiedImage, const float sigmaSpatial, const float sigmaColor, const int filterDiameter) |
| Applies a joint bilateral filter on the input disparity image using the corresponding rectified image as a guide. | |
| static void | JointBilateralFromImage (ImagePtr &disparityImage, const ImagePtr &rectifiedImage, const float sigmaSpatial, const float sigmaColor, const int filterDiameter) |
| Applies a joint bilateral filter in-place on the input disparity image using the corresponding rectified image as a guide. | |
| static ImagePtr | DomainTransform (const ImagePtr &disparityImage, const ImagePtr &rectifiedImage, const float sigmaSpatial, const float sigmaColor, const int numIterations=3) |
| Applies a fast, edge-preserving filter on the input disparity image using the domain transform normalized convolution technique. | |
| static void | DomainTransformFromImage (ImagePtr &disparityImage, const ImagePtr &rectifiedImage, const float sigmaSpatial, const float sigmaColor, const int numIterations=3) |
| Applies a fast, edge-preserving filter in-place on the input disparity image using the domain transform normalized convolution technique. | |
| 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 &rectifiedImage, const PointCloudParameters &pointCloudParameters, const StereoCameraParameters &stereoCameraParameters) |
| Computes 3D point cloud from a stereo pair consisting of a disparity/rectified image using a stereo matching algorithm. | |
| static void | ComputePointCloud (const ImagePtr &disparityImage, const ImagePtr &rectifiedImage, const PointCloudParameters &pointCloudParameters, const StereoCameraParameters &stereoCameraParameters, PointCloud &pointCloud) |
| Computes 3D point cloud from a stereo pair consisting of a disparity/rectified image 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. | |
Static Public Attributes | |
| static uint16_t | maxDepthThresholdInMm |
| static uint16_t | maxDepthThresholdInMeter |
Static helper functions for stereo related computations.
|
static |
Computes 3D point from disparity value.
| disparity | The disparity value |
| stereoCameraParameters | The parameters for the stereo camera |
| stereo3DPoint | The computed 3D point |
|
static |
Computes the distance between two points in the disparity image.
| disparityImage | The disparity image |
| stereoParam | The stereo camera parameters |
| imagePixel1 | The first pixel in the image |
| imagePixel2 | The second pixel in the image |
| distance | The distance between the two points |
|
static |
Computes the distance of a point to the camera world coordinates origin, from the disparity image.
| disparityImage | The disparity image |
| stereoParam | The stereo camera parameters |
| imagePixel | The pixel in the image |
| distance | The distance of the point to the camera world coordinates origin |
|
static |
Computes 3D point cloud from a stereo pair consisting of a disparity/rectified image using a stereo matching algorithm.
| disparityImage | The disparity image from a stereo pair consisting of a disparity/rectified image. |
| rectifiedImage | The rectified image from a stereo pair consisting of a disparity/rectified image. |
| pointCloudParameters | The parameters for computing the point cloud |
| stereoCameraParameters | The parameters for the stereo camera |
|
static |
Computes 3D point cloud from a stereo pair consisting of a disparity/rectified image using a stereo matching algorithm.
| disparityImage | The disparity image from a stereo pair consisting of a disparity/rectified image. |
| rectifiedImage | The rectified image from a stereo pair consisting of a disparity/rectified image. |
| pointCloudParameters | The parameters for computing the point cloud |
| stereoCameraParameters | The parameters for the stereo camera |
| pointCloud | The computed point cloud will be stored in this object |
|
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.
| disparityImage | The source image from which to create the depth values |
| invalidDepthVal | value to mark invalid pixels, where the depth should not be computed for |
| minDepthVal | The actual minimum depth in the image |
| maxDepthVal | The actual maximum depth in the image |
|
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.
| disparityImage | The source image from which to create the depth values |
| stereoCameraParameters | The stereo camera parameters |
| invalidDepthVal | value to mark invalid pixels, where the depth should not be computed for |
| depthImage | The destination image in which to store the created depth values |
| minDepthVal | The actual minimum depth in the image |
| maxDepthVal | The actual maximum depth in the image |
Creates an 8-bit gradient magnitude image from rectified image.
The gradient magnitude is computed by converting rectified image to a grayscale image and applying Sobel filters in the X and Y direction.
| rectifiedImage | Rectified image |
|
static |
Creates an 8-bit gradient magnitude image from rectified image.
The gradient magnitude is computed by converting rectified image to a grayscale image and applying Sobel filters in the X and Y direction. Resulting gradient data is stored in the provided gradientImage object.
| rectifiedImage | Rectified image |
| gradientImage | The image where the gradient data will be stored |
|
static |
Applies a fast, edge-preserving filter on the input disparity image using the domain transform normalized convolution technique.
The filter uses a joint image to guide smoothing, preserving edges present in the guide while smoothing the target image. Note that only Mono16 pixel format disparity image is supported.
| disparityImage | The disparity image (Mono16) |
| rectifiedImage | The rectified image |
| sigmaSpatial | The spatial standard deviation for the filter |
| sigmaColor | The color standard deviation for the filter |
| numIterations | The number of iterations to perform (default is 3) |
|
static |
Applies a fast, edge-preserving filter in-place on the input disparity image using the domain transform normalized convolution technique.
The filter uses a joint image to guide smoothing, preserving edges present in the guide while smoothing the target image. Note that only Mono16 pixel format disparity image is supported.
| disparityImage | The disparity image (Mono16) |
| rectifiedImage | The rectified image |
| sigmaSpatial | The spatial standard deviation for the filter |
| sigmaColor | The color standard deviation for the filter |
| numIterations | The number of iterations to perform (default is 3) |
|
static |
Performs edge-aware interpolation on the input disparity image to fill in invalid pixels, using information from nearby valid pixels and edges.
Note that only Mono16 pixel format disparity image is supported.
| disparityImage | The disparity image (Mono16) |
| invalidDataValue | The value assigned to invalid data |
| gradientImage | The gradient magnitude image (Mono8) |
| edgeThreshold | The threshold for edge detection |
| maxDistance | The maximum distance to search for valid pixels |
|
static |
Performs edge-aware interpolation in-place on the input disparity image to fill in invalid pixels, using information from nearby valid pixels and edges.
Note that only Mono16 pixel format disparity image is supported.
| disparityImage | The disparity image (Mono16) |
| invalidDataValue | The value assigned to invalid data |
| gradientImage | The gradient magnitude image (Mono8) |
| edgeThreshold | The threshold for edge detection |
| maxDistance | The maximum distance to search for valid pixels |
|
static |
Filters speckles from a copy of the input mono disparity image.
Note that only Mono16 pixel format image is supported.
| disparityImage | The disparity image |
| maxSpeckleSize | The maximum allowed speckle size |
| speckleThreshold | The speckle size threshold |
| disparityScaleFactor | The coordinate scale factor |
| invalidDataValue | The value assigned to invalid data |
|
static |
Filters speckles in-place on the input mono disparity image.
Note that only Mono16 pixel format image is supported.
| disparityImage | The disparity image |
| maxSpeckleSize | The maximum allowed speckle size |
| speckleThreshold | The speckle size threshold |
| disparityScaleFactor | The coordinate scale factor |
| invalidDataValue | The value assigned to invalid data |
|
static |
Returns true if the camera is a stereo camera or false otherwise.
| pCamera | The camera |
|
static |
Applies a joint bilateral filter on the input disparity image using the corresponding rectified image as a guide.
This edge-preserving filter smooths the disparity image while maintaining sharp edges aligned with the guide image. The filter uses both spatial and color information to determine the influence of neighboring pixels. Only Mono16 pixel format disparity images are supported.
| disparityImage | The disparity image to be filtered (Mono16) |
| rectifiedImage | The rectified image used as the guide for edge preservation |
| sigmaSpatial | The spatial standard deviation for the filter kernel |
| sigmaColor | The color standard deviation for the filter kernel |
| filterDiameter | The diameter of the filter kernel |
|
static |
Applies a joint bilateral filter in-place on the input disparity image using the corresponding rectified image as a guide.
This edge-preserving filter smooths the disparity image while maintaining sharp edges aligned with the guide image. The filter uses both spatial and color information to determine the influence of neighboring pixels. Only Mono16 pixel format disparity images are supported.
| disparityImage | The disparity image to be filtered (Mono16) |
| rectifiedImage | The rectified image used as the guide for edge preservation |
| sigmaSpatial | The spatial standard deviation for the filter kernel |
| sigmaColor | The color standard deviation for the filter kernel |
| filterDiameter | The diameter of the filter kernel |
|
static |
Post-process the disparity image by filling in holes and reducing noise using the specified disparity processing method.
The disparity image is expected to be a Mono16 pixel format image.
| disparityImage | The disparity image to fill |
| rectifiedImage | The rectified image used for filling |
| processingMethod | The method to use for post processing the disparity image |
|
static |
|
static |
|
static |