Class Camera

java.lang.Object
edu.tufts.hrilab.vision.capture.Camera

public class Camera extends Object
  • Field Details

    • log

      protected org.slf4j.Logger log
  • Constructor Details

    • Camera

      public Camera(boolean display, String captureConfig, String calibConfig)
  • Method Details

    • start

      public void start()
      Start capture thread. Does nothing if already running.
    • pause

      public void pause()
      Pause the currently running capture thread.
    • resume

      public void resume()
      Resume the paused capture thread.
    • stopAndWait

      public void stopAndWait()
      Stop camera thread, do cleanup, and wait until both have completed before returning.
    • isRunning

      public boolean isRunning()
      Is capture running.
      Returns:
    • writeFrame

      public void writeFrame(String filename)
      Write RGB frame to file.
      Parameters:
      filename -
    • writePointCloud

      public void writePointCloud(String filename)
      Write PCD (point cloud data) frame to file. Only works if capturing or generating point cloud data.
      Parameters:
      filename -
    • startAviWrite

      public void startAviWrite(String filename)
      Start recording an AVI.
      Parameters:
      filename -
    • stopAviWrite

      public void stopAviWrite()
      Finish recording the AVI and save it to file.
    • startOniWrite

      public void startOniWrite(String filename)
      Start recording an ONI (RGB-D).
      Parameters:
      filename -
    • stopOniWrite

      public void stopOniWrite()
      Finish recording the ONI (RGB-D) and save it to file.
    • displayCapturedImages

      public void displayCapturedImages(boolean display)
    • displayDepthData

      public void displayDepthData(boolean display)
    • passAdditionalDataToCamera

      public void passAdditionalDataToCamera(javax.vecmath.Matrix4d currTransform)
      Pass most up to date data to camera so that it can be passed to native camera code and synchronized (in time) with camera data.
      Parameters:
      currTransform - - current transform from vision to robot coordinate frame
    • getJNIFrame

      public BufferedImage getJNIFrame(int blurAmount)
      This gets the captred camera frame specified by frameNum.
      Parameters:
      blurAmount - - how much to blur image. (0 = none)
      Returns:
      BufferedImage of captured camera frame.
    • getJNIFrame

      public BufferedImage getJNIFrame()
      Get the most recent captured camera frame from native side.
      Returns:
      BufferedImage of captured camera frame.
    • getRawImageData

      public byte[] getRawImageData()
      Get raw image data from native side.
      Returns:
      byte[]
    • getRawDisparityData

      public byte[] getRawDisparityData()
      Get raw image disparity data from native side.
      Returns:
      byte[]
    • getRawDepthData

      public byte[] getRawDepthData()
      Get raw image disparity data from native side.
      Returns:
      byte[]
    • getCamMode

      public CAM_MODE getCamMode()
    • getImageWidth

      public int getImageWidth()
    • getImageHeight

      public int getImageHeight()
    • hasStereo

      public boolean hasStereo()
    • hasDepth

      public boolean hasDepth()
    • getUndistort

      public boolean getUndistort()
    • setUndistort

      public void setUndistort(boolean undistort)
      set whether or not captures frames should be undistorted
      Parameters:
      undistort -
    • main

      public static void main(String[] args)