[−][src]Function opencv::calib3d::reproject_image_to_3d
pub fn reproject_image_to_3d(
disparity: &dyn ToInputArray,
_3d_image: &mut dyn ToOutputArray,
q: &dyn ToInputArray,
handle_missing_values: bool,
ddepth: i32
) -> Result<()>
Reprojects a disparity image to 3D space.
Parameters
- disparity: Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit floating-point disparity image. If 16-bit signed format is used, the values are assumed to have no fractional bits.
- _3dImage: Output 3-channel floating-point image of the same size as disparity . Each element of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity map.
- Q: perspective transformation matrix that can be obtained with stereoRectify.
- handleMissingValues: Indicates, whether the function should handle missing values (i.e. points where the disparity was not computed). If handleMissingValues=true, then pixels with the minimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed to 3D points with a very large Z value (currently set to 10000).
- ddepth: The optional output array depth. If it is -1, the output image will have CV_32F depth. ddepth can also be set to CV_16S, CV_32S or CV_32F.
The function transforms a single-channel disparity map to a 3-channel image representing a 3D surface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it computes:
The matrix Q can be an arbitrary matrix (for example, the one computed by stereoRectify). To reproject a sparse set of points {(x,y,d),...} to 3D space, use perspectiveTransform .
C++ default parameters
- handle_missing_values: false
- ddepth: -1