stereoRectifyUncalibrated
import { stereoRectifyUncalibrated } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;points1Array of feature points in the first image.
points2The corresponding points in the second image. The same formats as in #findFundamentalMat are supported.
FInput fundamental matrix. It can be computed from the same set of point pairs using #findFundamentalMat .
imgSizeSize of the image.
H1Output destination, filled by the native operation. Output rectification homography matrix for the first image.
H2Output destination, filled by the native operation. Output rectification homography matrix for the second image.
thresholdOptional 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] .
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.