Class Volume
java.lang.Object
org.opencv.ptcloud.Volume
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longstatic final intstatic final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionVolume()Constructor of custom volume.Volume(int vtype) Constructor of custom volume.Volume(int vtype, VolumeSettings settings) Constructor of custom volume.protectedVolume(long addr) -
Method Summary
Modifier and TypeMethodDescriptionstatic Volume__fromPtr__(long addr) voidfetchNormals(Mat points, Mat normals) Extract the all data from volume.voidfetchPointsNormals(Mat points, Mat normals) Extract the all data from volume.voidfetchPointsNormalsColors(Mat points, Mat normals, Mat colors) Extract the all data from volume.voidgetBoundingBox(Mat bb, int precision) Gets bounding box in volume coordinates with given precision: VOLUME_UNIT - up to volume unit VOXEL - up to voxel (currently not supported)booleanReturns if new volume units are allocated during integration or not.longlongreturn number of volume units in volume.intreturn visible blocks in volume.voidIntegrates the input data to the volume.voidintegrateColor(Mat depth, Mat image, Mat pose) Integrates the input data to the volume.voidintegrateFrame(OdometryFrame frame, Mat pose) Integrates the input data to the volume.voidRenders the volume contents into an image.voidraycastColor(Mat cameraPose, Mat points, Mat normals, Mat colors) Renders the volume contents into an image.voidRenders the volume contents into an image.voidRenders the volume contents into an image.voidreset()clear all data in volume.voidsetEnableGrowth(boolean v) Enables or disables new volume unit allocation during integration.
-
Field Details
-
nativeObj
protected final long nativeObj -
VOLUME_UNIT
public static final int VOLUME_UNIT- See Also:
-
VOXEL
public static final int VOXEL- See Also:
-
-
Constructor Details
-
Volume
protected Volume(long addr) -
Volume
Constructor of custom volume.- Parameters:
vtype- the volume type [TSDF, HashTSDF, ColorTSDF].settings- the custom settings for volume.
-
Volume
public Volume(int vtype) Constructor of custom volume.- Parameters:
vtype- the volume type [TSDF, HashTSDF, ColorTSDF].
-
Volume
public Volume()Constructor of custom volume.
-
-
Method Details
-
getNativeObjAddr
public long getNativeObjAddr() -
__fromPtr__
-
integrateFrame
Integrates the input data to the volume. Camera intrinsics are taken from volume settings structure.- Parameters:
frame- the 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.pose- the pose of camera in global coordinates.
-
integrate
-
integrateColor
Integrates the input data to the volume. Camera intrinsics are taken from volume settings structure.- Parameters:
depth- the depth image.image- the 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.pose- the pose of camera in global coordinates.
-
raycast
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.- Parameters:
cameraPose- the pose of camera in global coordinates.points- image to store rendered points.normals- 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.- Parameters:
cameraPose- the pose of camera in global coordinates.points- image to store rendered points.normals- image to store rendered normals corresponding to points.colors- 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.- Parameters:
cameraPose- the pose of camera in global coordinates.height- the height of result imagewidth- the width of result imageK- camera raycast intrinsicspoints- image to store rendered points.normals- image to store rendered normals corresponding to points.
-
raycastExColor
public void raycastExColor(Mat cameraPose, int height, int width, Mat K, Mat points, Mat normals, Mat colors) 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.- Parameters:
cameraPose- the pose of camera in global coordinates.height- the height of result imagewidth- the width of result imageK- camera raycast intrinsicspoints- image to store rendered points.normals- image to store rendered normals corresponding to points.colors- image to store rendered colors corresponding to points (only for ColorTSDF).
-
fetchNormals
-
fetchPointsNormals
-
fetchPointsNormalsColors
Extract the all data from volume.- Parameters:
points- the storage of all points.normals- the storage of all normals, corresponding to points.colors- the storage of all colors, corresponding to points (only for ColorTSDF).
-
reset
public void reset()clear all data in volume. -
getVisibleBlocks
public int getVisibleBlocks()return visible blocks in volume.- Returns:
- automatically generated
-
getTotalVolumeUnits
public long getTotalVolumeUnits()return number of volume units in volume.- Returns:
- automatically generated
-
getBoundingBox
Gets bounding box in volume coordinates with given precision: VOLUME_UNIT - up to volume unit VOXEL - up to voxel (currently not supported)- Parameters:
bb- 6-float 1d array containing (min_x, min_y, min_z, max_x, max_y, max_z) in volume coordinatesprecision- bounding box calculation precision
-
setEnableGrowth
public void setEnableGrowth(boolean v) Enables or disables new volume unit allocation during integration. Makes sense for HashTSDF only.- Parameters:
v- automatically generated
-
getEnableGrowth
public boolean getEnableGrowth()Returns if new volume units are allocated during integration or not. Makes sense for HashTSDF only.- Returns:
- automatically generated
-