Package org.opencv.cv3d
Class Volume
- java.lang.Object
-
- org.opencv.cv3d.Volume
-
public class Volume extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected longnativeObjstatic intVOLUME_UNITstatic intVOXEL
-
Constructor Summary
Constructors Modifier Constructor Description Volume()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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.protected voidfinalize()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)booleangetEnableGrowth()Returns if new volume units are allocated during integration or not.longgetNativeObjAddr()longgetTotalVolumeUnits()return number of volume units in volume.intgetVisibleBlocks()return visible blocks in volume.voidintegrate(Mat depth, Mat pose)Integrates 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.voidraycast(Mat cameraPose, Mat points, Mat normals)Renders the volume contents into an image.voidraycastColor(Mat cameraPose, Mat points, Mat normals, Mat colors)Renders the volume contents into an image.voidraycastEx(Mat cameraPose, int height, int width, Mat K, Mat points, Mat normals)Renders the volume contents into an image.voidraycastExColor(Mat cameraPose, int height, int width, Mat K, Mat points, Mat normals, Mat colors)Renders 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 Detail
-
nativeObj
protected final long nativeObj
-
VOLUME_UNIT
public static final int VOLUME_UNIT
- See Also:
- Constant Field Values
-
VOXEL
public static final int VOXEL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Volume
protected Volume(long addr)
-
Volume
public Volume(int vtype, VolumeSettings settings)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 Detail
-
getNativeObjAddr
public long getNativeObjAddr()
-
__fromPtr__
public static Volume __fromPtr__(long addr)
-
integrateFrame
public void integrateFrame(OdometryFrame frame, Mat pose)
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
public void integrate(Mat depth, Mat pose)
Integrates the input data to the volume. Camera intrinsics are taken from volume settings structure.- Parameters:
depth- the depth image.pose- the pose of camera in global coordinates.
-
integrateColor
public void integrateColor(Mat depth, Mat image, Mat pose)
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
public void raycast(Mat cameraPose, Mat points, Mat normals)
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
public void raycastColor(Mat cameraPose, 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.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
public void raycastEx(Mat cameraPose, int height, int width, Mat K, Mat points, Mat normals)
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
public void fetchNormals(Mat points, Mat normals)
Extract the all data from volume.- Parameters:
points- the input exist point.normals- the storage of normals (corresponding to input points) in the image.
-
fetchPointsNormals
public void fetchPointsNormals(Mat points, Mat normals)
Extract the all data from volume.- Parameters:
points- the storage of all points.normals- the storage of all normals, corresponding to points.
-
fetchPointsNormalsColors
public void fetchPointsNormalsColors(Mat points, Mat normals, Mat colors)
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
public void getBoundingBox(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)- 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
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-