Volume
import { Volume } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods.
volume value in the OpenCV API.
Constructors and members
static new
Constructor of custom volume.
new(vtype: VolumeType, settings: VolumeSettings): Volume;3 available overloads
new(): Volume;new(vtype: VolumeType): Volume;new(vtype: VolumeType, settings: VolumeSettings): Volume;vtypethe volume type [TSDF, HashTSDF, ColorTSDF].
settingsthe custom settings for volume.
The Volume 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;The this result.
integrateFrame
Integrates the input data to the volume.
Camera intrinsics are taken from volume settings structure.
integrateFrame(frame: OdometryFrame, pose: Mat): void;framethe object from which to take depth and image data. For color TSDF a depth data should be registered with color data, i.e. have the same intrinsics & camera pose. This can be done using function registerDepth() from 3d module.
posethe pose of camera in global coordinates.
integrate
Integrates the input data to the volume.
Camera intrinsics are taken from volume settings structure.
integrate(depth: Mat, pose: Mat): void;depththe depth image.
posethe pose of camera in global coordinates.
integrateColor
Integrates the input data to the volume.
Camera intrinsics are taken from volume settings structure.
integrateColor(depth: Mat, image: Mat, pose: Mat): void;depththe depth image.
imagethe color image (only for ColorTSDF). For color TSDF a depth data should be registered with color data, i.e. have the same intrinsics & camera pose. This can be done using function registerDepth() from 3d module.
posethe pose of camera in global coordinates.
raycast
Python bindings do not process noArray() default argument correctly, so the raycast() method is repeated several times Renders the volume contents into an image. The resulting points and normals are in camera's coordinate system.
Rendered image size and camera intrinsics are taken from volume settings structure.
raycast(cameraPose: Mat, points: Mat, normals: Mat): void;cameraPosethe pose of camera in global coordinates.
pointsOutput destination, filled by the native operation. image to store rendered points.
normalsOutput destination, filled by the native operation. image to store rendered normals corresponding to points.
raycastColor
Renders the volume contents into an image. The resulting points and normals are in camera's coordinate system.
Rendered image size and camera intrinsics are taken from volume settings structure.
raycastColor(cameraPose: Mat, points: Mat, normals: Mat, colors: Mat): void;cameraPosethe pose of camera in global coordinates.
pointsOutput destination, filled by the native operation. image to store rendered points.
normalsOutput destination, filled by the native operation. image to store rendered normals corresponding to points.
colorsOutput destination, filled by the native operation. image to store rendered colors corresponding to points (only for ColorTSDF).
raycastEx
Renders the volume contents into an image. The resulting points and normals are in camera's coordinate system.
Rendered image size and camera intrinsics are taken from volume settings structure.
raycastEx(cameraPose: Mat, height: number, width: number, K: Mat, points: Mat, normals: Mat): void;cameraPosethe pose of camera in global coordinates.
heightthe height of result image
widththe width of result image
Kcamera raycast intrinsics
pointsOutput destination, filled by the native operation. image to store rendered points.
normalsOutput destination, filled by the native operation. image to store rendered normals corresponding to points.
raycastExColor
Renders the volume contents into an image. The resulting points and normals are in camera's coordinate system.
Rendered image size and camera intrinsics are taken from volume settings structure.
raycastExColor(cameraPose: Mat, height: number, width: number, K: Mat, points: Mat, normals: Mat, colors: Mat): void;cameraPosethe pose of camera in global coordinates.
heightthe height of result image
widththe width of result image
Kcamera raycast intrinsics
pointsOutput destination, filled by the native operation. image to store rendered points.
normalsOutput destination, filled by the native operation. image to store rendered normals corresponding to points.
colorsOutput destination, filled by the native operation. image to store rendered colors corresponding to points (only for ColorTSDF).
fetchNormals
Extract the all data from volume.
fetchNormals(points: Mat, normals: Mat): void;pointsthe input exist point.
normalsOutput destination, filled by the native operation. the storage of normals (corresponding to input points) in the image.
fetchPointsNormals
Extract the all data from volume.
fetchPointsNormals(points: Mat, normals: Mat): void;pointsOutput destination, filled by the native operation. the storage of all points.
normalsOutput destination, filled by the native operation. the storage of all normals, corresponding to points.
fetchPointsNormalsColors
Extract the all data from volume.
fetchPointsNormalsColors(points: Mat, normals: Mat, colors: Mat): void;pointsOutput destination, filled by the native operation. the storage of all points.
normalsOutput destination, filled by the native operation. the storage of all normals, corresponding to points.
colorsOutput destination, filled by the native operation. the storage of all colors, corresponding to points (only for ColorTSDF).
reset
clear all data in volume.
reset(): void;getVisibleBlocks
TODO: remove this return visible blocks in volume.
getVisibleBlocks(): number;The number result.
getTotalVolumeUnits
return number of volume units in volume.
getTotalVolumeUnits(): number;The number result.
getBoundingBox
Gets bounding box in volume coordinates with given precision: VOLUME_UNIT - up to volume unit VOXEL - up to voxel (currently not supported)
getBoundingBox(bb: Mat, precision: number): void;bbOutput destination, filled by the native operation. 6-float 1d array containing (min_x, min_y, min_z, max_x, max_y, max_z) in volume coordinates
precisionbounding box calculation precision
setEnableGrowth
Enables or disables new volume unit allocation during integration. Makes sense for HashTSDF only.
setEnableGrowth(v: boolean): void;vv argument (boolean).
getEnableGrowth
Returns if new volume units are allocated during integration or not. Makes sense for HashTSDF only.
getEnableGrowth(): boolean;The boolean result.
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.