Skip to content

stereoRectifyUncalibrated

stereofunctionOpenCV 5.0.0
import { stereoRectifyUncalibrated } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSpoints1, points2, F, imgSize
FUNCTIONstereoRectifyUncalibrated
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Computes a rectification transform for an uncalibrated stereo camera.

Note: While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion, it would be better to correct it before computing the fundamental matrix and calling this function. For example, distortion coefficients can be estimated for each head of stereo camera separately by using #calibrateCamera . Then, the images can be corrected using #undistort , or just the point coordinates can be corrected with #undistortPoints .

stereoRectifyUncalibrated(points1: Mat, points2: Mat, F: Mat, imgSize: Size, H1: Mat, H2: Mat, threshold: number): boolean;
2 available overloads
stereoRectifyUncalibrated(points1: Mat, points2: Mat, F: Mat, imgSize: Size, H1: Mat, H2: Mat): boolean;
stereoRectifyUncalibrated(points1: Mat, points2: Mat, F: Mat, imgSize: Size, H1: Mat, H2: Mat, threshold: number): boolean;
points1

Array of feature points in the first image.

points2

The corresponding points in the second image. The same formats as in #findFundamentalMat are supported.

F

Input fundamental matrix. It can be computed from the same set of point pairs using #findFundamentalMat .

imgSize

Size of the image.

H1

Output destination, filled by the native operation. Output rectification homography matrix for the first image.

H2

Output destination, filled by the native operation. Output rectification homography matrix for the second image.

threshold

Optional threshold used to filter out the outliers. If the parameter is greater than zero, all the point pairs that do not comply with the epipolar geometry (that is, the points for which |\texttt{points2[i]}^T \cdot \texttt{F} \cdot \texttt{points1[i]}|>\texttt{threshold} ) are rejected prior to computing the homographies. Otherwise, all the points are considered inliers.

The function computes the rectification transformations without knowing intrinsic parameters of the cameras and their relative position in the space, which explains the suffix "uncalibrated". Another related difference from #stereoRectify is that the function outputs not the rectification transformations in the object (3D) space, but the planar perspective transformations encoded by the homography matrices H1 and H2 . The function implements the algorithm [Hartley99] .

Returns

The boolean result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.