Package edu.tufts.hrilab.vision.capture
Class Camera
java.lang.Object
edu.tufts.hrilab.vision.capture.Camera
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
displayCapturedImages
(boolean display) void
displayDepthData
(boolean display) int
int
Get the most recent captured camera frame from native side.getJNIFrame
(int blurAmount) This gets the captred camera frame specified by frameNum.byte[]
Get raw image disparity data from native side.byte[]
Get raw image disparity data from native side.byte[]
Get raw image data from native side.boolean
boolean
hasDepth()
boolean
boolean
Is capture running.static void
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.void
pause()
Pause the currently running capture thread.void
resume()
Resume the paused capture thread.void
setUndistort
(boolean undistort) set whether or not captures frames should be undistortedvoid
start()
Start capture thread.void
startAviWrite
(String filename) Start recording an AVI.void
startOniWrite
(String filename) Start recording an ONI (RGB-D).void
Stop camera thread, do cleanup, and wait until both have completed before returning.void
Finish recording the AVI and save it to file.void
Finish recording the ONI (RGB-D) and save it to file.void
writeFrame
(String filename) Write RGB frame to file.void
writePointCloud
(String filename) Write PCD (point cloud data) frame to file.
-
Field Details
-
log
protected org.slf4j.Logger log
-
-
Constructor Details
-
Camera
-
-
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
Write RGB frame to file.- Parameters:
filename
-
-
writePointCloud
Write PCD (point cloud data) frame to file. Only works if capturing or generating point cloud data.- Parameters:
filename
-
-
startAviWrite
Start recording an AVI.- Parameters:
filename
-
-
stopAviWrite
public void stopAviWrite()Finish recording the AVI and save it to file. -
startOniWrite
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
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
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
-
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
-