Class DepthSparse3D<T extends boofcv.struct.image.ImageGray<T>>

  • Direct Known Subclasses:
    DepthSparse3D.F32, DepthSparse3D.I

    public abstract class DepthSparse3D<T extends boofcv.struct.image.ImageGray<T>>
    extends java.lang.Object
    Computes the 3D coordinate a point in a visual camera given a depth image. The visual camera is a standard camera while the depth camera contains the depth (value along z-axis) of objects inside its field of view. The Kinect (structured light) and flash ladar (time of flight) are examples of sensors which could use this class. The z-axis is defined to be pointing straight out of the visual camera and both depth and visual cameras are assumed to be parallel with identical pointing vectors for the z-axis. A mapping is provided for converting between pixels in the visual camera and the depth camera. This mapping is assumed to be fixed with time.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DepthSparse3D.F32
      Implementation for GrayF32.
      static class  DepthSparse3D.I<T extends boofcv.struct.image.GrayI<T>>
      Implementation for GrayI.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T depthImage  
    • Constructor Summary

      Constructors 
      Constructor Description
      DepthSparse3D​(double depthScale)
      Configures parameters
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(boofcv.alg.distort.LensDistortionNarrowFOV model, boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32> visualToDepth)
      Configures intrinsic camera parameters
      georegression.struct.point.Point3D_F64 getWorldPt()
      The found 3D coordinate of the point in the visual camera coordinate system.
      protected abstract double lookupDepth​(int depthX, int depthY)
      Internal function which looks up the pixel's depth.
      boolean process​(int x, int y)
      Given a pixel coordinate in the visual camera, compute the 3D coordinate of that point.
      void setDepthImage​(T depthImage)
      Sets the depth image.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • depthImage

        protected T extends boofcv.struct.image.ImageGray<T> depthImage
    • Constructor Detail

      • DepthSparse3D

        public DepthSparse3D​(double depthScale)
        Configures parameters
        Parameters:
        depthScale - Used to change units found in the depth image.
    • Method Detail

      • configure

        public void configure​(boofcv.alg.distort.LensDistortionNarrowFOV model,
                              boofcv.struct.distort.PixelTransform<georegression.struct.point.Point2D_F32> visualToDepth)
        Configures intrinsic camera parameters
        Parameters:
        model - Model for narrow FOV cameras
        visualToDepth - Transform from visual to depth camera pixel coordinate systems.
      • setDepthImage

        public void setDepthImage​(T depthImage)
        Sets the depth image. A reference is saved internally.
        Parameters:
        depthImage - Image containing depth information.
      • process

        public boolean process​(int x,
                               int y)
        Given a pixel coordinate in the visual camera, compute the 3D coordinate of that point.
        Parameters:
        x - x-coordinate of point in visual camera
        y - y-coordinate of point in visual camera
        Returns:
        true if a 3D point could be computed and false if not
      • getWorldPt

        public georegression.struct.point.Point3D_F64 getWorldPt()
        The found 3D coordinate of the point in the visual camera coordinate system. Is only valid when process(int, int) returns true.
        Returns:
        3D coordinate of point in visual camera coordinate system
      • lookupDepth

        protected abstract double lookupDepth​(int depthX,
                                              int depthY)
        Internal function which looks up the pixel's depth. Depth is defined as the value of the z-coordinate which is pointing out of the camera. If there is no depth measurement at this location return 0.
        Parameters:
        depthX - x-coordinate of pixel in depth camera
        depthY - y-coordinate of pixel in depth camera
        Returns:
        depth at the specified coordinate