Class Volume


  • public class Volume
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long nativeObj  
      static int VOLUME_UNIT  
      static int VOXEL  
    • 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.
      protected Volume​(long addr)  
    • 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 image
        width - the width of result image
        K - camera raycast intrinsics
        points - 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 image
        width - the width of result image
        K - camera raycast intrinsics
        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).
      • 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 coordinates
        precision - 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:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable