sampsonDistance
import { sampsonDistance } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
ARGUMENTSpt1, pt2, F
FUNCTIONsampsonDistance
RETURN TYPEnumber
Calculates the Sampson Distance between two points.
The function cv::sampsonDistance calculates and returns the first order approximation of the geometric error as:
sd( \texttt{pt1} , \texttt{pt2} )=
\frac{(\texttt{pt2}^t \cdot \texttt{F} \cdot \texttt{pt1})^2}
{((\texttt{F} \cdot \texttt{pt1})(0))^2 +
((\texttt{F} \cdot \texttt{pt1})(1))^2 +
((\texttt{F}^t \cdot \texttt{pt2})(0))^2 +
((\texttt{F}^t \cdot \texttt{pt2})(1))^2}
The fundamental matrix may be calculated using the #findFundamentalMat function. See [HartleyZ00] 11.4.3 for details.
sampsonDistance(pt1: Mat, pt2: Mat, F: Mat): number;pt1first homogeneous 2d point
pt2second homogeneous 2d point
Ffundamental matrix
Returns
The computed Sampson distance.
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.