Skip to content

OdometryFrame

ptcloudclassOpenCV 5.0.0
import { OdometryFrame } from '@banou/opencv-wasm'

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

ARGUMENTSConstructor or factory
CLASSOdometryFrame
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.

An object that keeps per-frame data for Odometry algorithms from user-provided images to algorithm-specific precalculated data. When not empty, it contains a depth image, a mask of valid pixels and a set of pyramids generated from that data. A BGR/Gray image and normals are optional. OdometryFrame is made to be used together with Odometry class to reuse precalculated data between Rt data calculations. A correct way to do that is to call Odometry::prepareFrames() on prev and next frames and then pass them to Odometry::compute() method.

Constructors and members

static new

Construct a new OdometryFrame object. All non-empty images should have the same size.

new(depth: Mat, image: Mat, mask: Mat, normals: Mat): OdometryFrame;
5 available overloads
new(): OdometryFrame;
new(depth: Mat): OdometryFrame;
new(depth: Mat, image: Mat): OdometryFrame;
new(depth: Mat, image: Mat, mask: Mat): OdometryFrame;
new(depth: Mat, image: Mat, mask: Mat, normals: Mat): OdometryFrame;
depth

A depth image, should be CV_8UC1

image

An BGR or grayscale image (or noArray() if it's not required for used ICP algorithm). Should be CV_8UC3 or CV_8C4 if it's BGR image or CV_8UC1 if it's grayscale. If it's BGR then it's converted to grayscale image automatically.

mask

A user-provided mask of valid pixels, should be CV_8UC1

normals

A user-provided normals to the depth surface, should be CV_32FC4

Returns

The OdometryFrame result.

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.

getImage

Get the original user-provided BGR/Gray image

getImage(image: Mat): void;
image

Output destination, filled by the native operation. Output image

getGrayImage

Get the gray image generated from the user-provided BGR/Gray image

getGrayImage(image: Mat): void;
image

Output destination, filled by the native operation. Output image

getDepth

Get the original user-provided depth image

getDepth(depth: Mat): void;
depth

Output destination, filled by the native operation. Output image

getProcessedDepth

Get the depth image generated from the user-provided one after conversion, rescale or filtering for ICP algorithm needs

getProcessedDepth(depth: Mat): void;
depth

Output destination, filled by the native operation. Output image

getMask

Get the valid pixels mask generated for the ICP calculations intersected with the user-provided mask

getMask(mask: Mat): void;
mask

Output destination, filled by the native operation. Output image

getNormals

Get the normals image either generated for the ICP calculations or user-provided

getNormals(normals: Mat): void;
normals

Output destination, filled by the native operation. Output image

getPyramidLevels

Get the amount of levels in pyramids (all of them if not empty should have the same number of levels) or 0 if no pyramids were prepared yet

getPyramidLevels(): number;
Returns

The number result.

getPyramidAt

Get the image generated for the ICP calculations from one of the pyramids specified by pyrType. Returns empty image if the pyramid is empty or there's no such pyramid level

getPyramidAt(img: Mat, pyrType: number, level: number): void;
img

Output destination, filled by the native operation. Output image

pyrType

Type of pyramid

level

Level in the pyramid

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.