Skip to content

rescaleDepth

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

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

ARGUMENTSin_, type_, out_, depth_factor
FUNCTIONrescaleDepth
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

If the input image is of type CV_16UC1 (like the Kinect one), the image is converted to floats, divided by depth_factor to get a depth in meters, and the values 0 are converted to std::numeric_limits<float>::quiet_NaN() Otherwise, the image is simply converted to floats

rescaleDepth(in_: Mat, type_: number, out_: Mat, depth_factor: number): void;
2 available overloads
rescaleDepth(in_: Mat, type_: number, out_: Mat): void;
rescaleDepth(in_: Mat, type_: number, out_: Mat, depth_factor: number): void;
in_

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), it is assumed in meters)

type_

the desired output depth (CV_32F or CV_64F)

out_

Output destination, filled by the native operation. The rescaled float depth image

depth_factor

(optional) factor by which depth is converted to distance (by default = 1000.0 for Kinect sensor)

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.