Skip to content

computeCorrespondEpilines

geometryfunctionOpenCV 5.0.0
import { computeCorrespondEpilines } from '@banou/opencv-wasm'

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

For points in an image of a stereo pair, computes the corresponding epilines in the other image.

computeCorrespondEpilines(points: Mat, whichImage: number, F: Mat, lines: Mat): void;
points

Input points. N \times 1 or 1 \times N matrix of type CV_32FC2 or vector<Point2f> .

whichImage

Index of the image (1 or 2) that contains the points .

F

Fundamental matrix that can be estimated using #findFundamentalMat or #stereoRectify .

lines

Output destination, filled by the native operation. Output vector of the epipolar lines corresponding to the points in the other image. Each line ax + by + c=0 is encoded by 3 numbers (a, b, c) .

For every point in one of the two images of a stereo pair, the function finds the equation of the corresponding epipolar line in the other image.

From the fundamental matrix definition (see #findFundamentalMat ), line l^{(2)}_i in the second image for the point p^{(1)}_i in the first image (when whichImage=1 ) is computed as:

l^{(2)}_i = F p^{(1)}_i

And vice versa, when whichImage=2, l^{(1)}_i is computed from p^{(2)}_i as:

l^{(1)}_i = F^T p^{(2)}_i

Line coefficients are defined up to a scale. They are normalized so that a_i^2+b_i^2=1 .

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.