Skip to content

sfm_BaseSFM

sfmclassOpenCV 5.0.0
import { sfm_BaseSFM } from '@banou/opencv-wasm'

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

ARGUMENTSConstructor or factory
CLASSsfm_BaseSFM
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods.

base class BaseSFM declares a common API that would be used in a typical scene reconstruction scenario

Constructors and members

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

run

Run structure-from-motion reconstruction from tracked 2D points and update the stored cameras and 3D points.

run(points2d: MatVector): void;
points2d

points2d argument (MatVector).

run1

Reconstruct tracked 2D points, refine the input intrinsic matrix and fill the output rotations, translations and 3D points.

run1(points2d: MatVector, K: Mat, Rs: MatVector, Ts: MatVector, points3d: MatVector): void;
points2d

points2d argument (MatVector).

K

Input/output value, modified by the native operation. k argument (Mat).

Rs

Output destination, filled by the native operation. rs argument (MatVector).

Ts

Output destination, filled by the native operation. ts argument (MatVector).

points3d

Output destination, filled by the native operation. points3d argument (MatVector).

getError

Return the error configured on this sfm_BaseSFM object.

getError(): number;
Returns

The number result.

getPoints

Return the points configured on this sfm_BaseSFM object.

getPoints(points3d: MatVector): void;
points3d

Output destination, filled by the native operation. points3d argument (MatVector).

getIntrinsics

Return the intrinsics configured on this sfm_BaseSFM object.

getIntrinsics(): Mat;
Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

getCameras

Return the cameras configured on this sfm_BaseSFM object.

getCameras(Rs: MatVector, Ts: MatVector): void;
Rs

Output destination, filled by the native operation. rs argument (MatVector).

Ts

Output destination, filled by the native operation. ts argument (MatVector).

setReconstructionOptions

Set the reconstruction options used by this sfm_BaseSFM object.

setReconstructionOptions(libmv_reconstruction_options: sfm_libmv_ReconstructionOptions): void;
libmv_reconstruction_options

libmv reconstruction options argument (sfm_libmv_ReconstructionOptions).

setCameraIntrinsicOptions

Set the camera intrinsic options used by this sfm_BaseSFM object.

setCameraIntrinsicOptions(libmv_camera_intrinsics_options: sfm_libmv_CameraIntrinsicsOptions): void;
libmv_camera_intrinsics_options

libmv camera intrinsics options argument (sfm_libmv_CameraIntrinsicsOptions).

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.