Skip to content

findPlanes

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

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

ARGUMENTSpoints3d, normals, mask, plane_coefficients
FUNCTIONfindPlanes
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Find the planes in a depth image

findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number, min_size: number, threshold: number, sensor_error_a: number, sensor_error_b: number, sensor_error_c: number, method: number): void;
8 available overloads
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat): void;
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number): void;
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number, min_size: number): void;
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number, min_size: number, threshold: number): void;
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number, min_size: number, threshold: number, sensor_error_a: number): void;
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number, min_size: number, threshold: number, sensor_error_a: number, sensor_error_b: number): void;
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number, min_size: number, threshold: number, sensor_error_a: number, sensor_error_b: number, sensor_error_c: number): void;
findPlanes(points3d: Mat, normals: Mat, mask: Mat, plane_coefficients: Mat, block_size: number, min_size: number, threshold: number, sensor_error_a: number, sensor_error_b: number, sensor_error_c: number, method: number): void;
points3d

the 3d points organized like the depth image: rows x cols with 3 channels

normals

the normals for every point in the depth image; optional, can be empty

mask

Output destination, filled by the native operation. An image where each pixel is labeled with the plane it belongs to and 255 if it does not belong to any plane

plane_coefficients

Output destination, filled by the native operation. the coefficients of the corresponding planes (a,b,c,d) such that ax+by+cz+d=0, norm(a,b,c)=1 and c < 0 (so that the normal points towards the camera)

block_size

The size of the blocks to look at for a stable MSE

min_size

The minimum size of a cluster to be considered a plane

threshold

The maximum distance of a point from a plane to belong to it (in meters)

sensor_error_a

coefficient of the sensor error. 0 by default, use 0.0075 for a Kinect

sensor_error_b

coefficient of the sensor error. 0 by default

sensor_error_c

coefficient of the sensor error. 0 by default

method

The method to use to compute the planes.

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.