Skip to content

depthTo3d

ptcloudfunctionOpenCV 5.0.0
import { depthTo3d } from '@banou/opencv-wasm'

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

ARGUMENTSdepth, K, points3d, mask
FUNCTIONdepthTo3d
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Converts a depth image to 3d points. If the mask is empty then the resulting array has the same dimensions as depth, otherwise it is 1d vector containing mask-enabled values only. The coordinate system is x pointing left, y down and z away from the camera

depthTo3d(depth: Mat, K: Mat, points3d: Mat, mask: Mat): void;
2 available overloads
depthTo3d(depth: Mat, K: Mat, points3d: Mat): void;
depthTo3d(depth: Mat, K: Mat, points3d: Mat, mask: Mat): void;
depth

the depth image (if given as short int CV_U, it is assumed to be the depth in millimeters (as done with the Microsoft Kinect), otherwise, if given as CV_32F or CV_64F, it is assumed in meters)

K

The calibration matrix

points3d

Output destination, filled by the native operation. the resulting 3d points (point is represented by 4 channels value [x, y, z, 0]). They are of the same depth as depth if it is CV_32F or CV_64F, and the depth of K if depth is of depth CV_16U or CV_16S

mask

the mask of the points to consider (can be empty)

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.