optflow_calcOpticalFlowSparseRLOF
import { optflow_calcOpticalFlowSparseRLOF } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Calculates fast optical flow for a sparse feature set using the robust local optical flow (RLOF) similar to optflow::calcOpticalFlowPyrLK().
The RLOF is a fast local optical flow approach described in [Senst2012] [Senst2013] [Senst2014] and [Senst2016] similar to the pyramidal iterative Lucas-Kanade method as proposed by [Bouguet00]. More details and experiments can be found in the following thesis [Senst2019]. The implementation is derived from optflow::calcOpticalFlowPyrLK().
Note: SIMD parallelization is only available when compiling with SSE4.1.
Parameters have been described in [Senst2012], [Senst2013], [Senst2014] and [Senst2016]. For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details.
optflow_calcOpticalFlowSparseRLOF(prevImg: Mat, nextImg: Mat, prevPts: Mat, nextPts: Mat, status: Mat, err: Mat, rlofParam: optflow_RLOFOpticalFlowParameter | null, forwardBackwardThreshold: number): void;3 available overloads
optflow_calcOpticalFlowSparseRLOF(prevImg: Mat, nextImg: Mat, prevPts: Mat, nextPts: Mat, status: Mat, err: Mat): void;optflow_calcOpticalFlowSparseRLOF(prevImg: Mat, nextImg: Mat, prevPts: Mat, nextPts: Mat, status: Mat, err: Mat, rlofParam: optflow_RLOFOpticalFlowParameter | null): void;optflow_calcOpticalFlowSparseRLOF(prevImg: Mat, nextImg: Mat, prevPts: Mat, nextPts: Mat, status: Mat, err: Mat, rlofParam: optflow_RLOFOpticalFlowParameter | null, forwardBackwardThreshold: number): void;prevImgfirst 8-bit input image. If The cross-based RLOF is used (by selecting optflow::RLOFOpticalFlowParameter::supportRegionType = SupportRegionType::SR_CROSS) image has to be a 8-bit 3 channel image.
nextImgsecond 8-bit input image. If The cross-based RLOF is used (by selecting optflow::RLOFOpticalFlowParameter::supportRegionType = SupportRegionType::SR_CROSS) image has to be a 8-bit 3 channel image.
prevPtsvector of 2D points for which the flow needs to be found; point coordinates must be single-precision floating-point numbers.
nextPtsInput/output value, modified by the native operation. output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image; when optflow::RLOFOpticalFlowParameter::useInitialFlow variable is true the vector must have the same size as in the input and contain the initialization point correspondences.
statusOutput destination, filled by the native operation. output status vector (of unsigned chars); each element of the vector is set to 1 if the flow for the corresponding features has passed the forward backward check.
errOutput destination, filled by the native operation. output vector of errors; each element of the vector is set to the forward backward error for the corresponding feature.
rlofParamsee optflow::RLOFOpticalFlowParameter
forwardBackwardThresholdThreshold for the forward backward confidence check. If forewardBackwardThreshold <=0 the forward
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.