|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectohmm.CvBase
ohmm.CvKinect
public class CvKinect
CvBase
extensions for Kinect.
Uses either OpenNI via OpenCV or OpenKinect (libfreenect) via JavaCV
OpenKinectFrameGrabber (the default). Depth-to-RGB registration is an
option for both (see setDepthRegistration(boolean)
). Grabbing both depth
and color images simultaneously, tilt sensing/actuation, and LED control are
only available with OpenKinect.
Field Summary | |
---|---|
static java.lang.String |
DEF_APPNAME
Default application name. |
static java.lang.String |
DEF_INPUT
Default input device index (OpenKinectFrameGrabber). |
static int |
MAX_DEPTH_11BIT
Valid range of 11-bit depth values. |
static int |
MAX_DEPTH_MM
Valid range of depth values in mm. |
static int |
MIN_DEPTH_11BIT
Valid range of 11-bit depth values. |
static int |
MIN_DEPTH_MM
Valid range of depth values in mm. |
protected com.googlecode.javacv.OpenKinectFrameGrabber |
okGrabber
OpenKinectFrameGrabber instance, if any. |
Constructor Summary | |
---|---|
CvKinect()
Sets options for Kinect. |
|
CvKinect(java.lang.String appname)
Sets options for Kinect. |
Method Summary | |
---|---|
protected void |
cmdHelpExt()
Shows Kinect-specific options. |
com.googlecode.javacv.cpp.opencv_core.IplImage |
depthToBGR(com.googlecode.javacv.cpp.opencv_core.IplImage depth,
com.googlecode.javacv.cpp.opencv_core.IplImage bgr,
int max,
float scale)
Convert a depth image to BGR false color. |
protected java.lang.String |
getDefAppname()
Gets the default appname, may be overridden. |
protected java.lang.String |
getDefInput()
Gets the default input, may be overridden. |
int |
getTiltDegs()
Get the tilt motor angle. |
int |
getTiltState(com.googlecode.javacv.cpp.freenect.freenect_raw_tilt_state state)
Get the raw tilt state. |
int |
initExt(int argc,
java.lang.String[] argv,
int ate)
Extra initialization, for subclasses. |
static void |
main(java.lang.String[] argv)
Test program entry point. |
void |
setDepthRegistration(boolean enable)
Enable or disable depth registration. |
void |
setFormat(java.lang.String format)
Set the frame format. |
int |
setLED(int led)
Set the LED. |
int |
setTiltDegs(int angle)
Set the tilt motor angle. |
Methods inherited from class ohmm.CvBase |
---|
camIndexOptional, cmdHelp, cmdHelpExtParams, doneProcessing, dumpCaptureProperties, finalize, fmt, getCaptureProperty, guiHelp, guiHelpExt, handleKey, handleKeyExt, handleMouse, handleMouse, init, init, init, init, mainLoop, makeGrabber, makeServer, mouseEventToString, msg, nowMS, process, release, save, setCaptureProperty, updateServerImage, v4l2DisableAuto, v4l2EnableAuto, v4l2GetExposure, v4l2SetExposure, waitForKeypresss, warn |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEF_APPNAME
public static final java.lang.String DEF_INPUT
public static final int MIN_DEPTH_MM
public static final int MAX_DEPTH_MM
public static final int MIN_DEPTH_11BIT
public static final int MAX_DEPTH_11BIT
protected com.googlecode.javacv.OpenKinectFrameGrabber okGrabber
Constructor Detail |
---|
public CvKinect(java.lang.String appname)
public CvKinect()
Method Detail |
---|
protected java.lang.String getDefAppname()
getDefAppname
in class CvBase
protected java.lang.String getDefInput()
getDefInput
in class CvBase
public int initExt(int argc, java.lang.String[] argv, int ate)
Extra initialization, for subclasses.
This impl sets okGrabber
.
initExt
in class CvBase
ate
- the number of command line arguments already eaten by CvBase.init(int, String[])
protected void cmdHelpExt()
cmdHelpExt
in class CvBase
public int setTiltDegs(int angle)
Set the tilt motor angle.
Only available when using the OpenKinect backend.
angle
- the angle in degrees
public int getTiltDegs()
Get the tilt motor angle.
Only available when using the OpenKinect backend.
public int getTiltState(com.googlecode.javacv.cpp.freenect.freenect_raw_tilt_state state)
Get the raw tilt state.
Only available when using the OpenKinect backend.
state
- the state structure to be filled in, not null
public int setLED(int led)
Set the LED.
Only available when using the OpenKinect backend.
led
- one of the OpenKinect LED_* constants
public void setFormat(java.lang.String format)
Set the frame format.
Only available when using the OpenKinect backend.
format
- either "depth" or "video"public void setDepthRegistration(boolean enable)
Enable or disable depth registration.
public com.googlecode.javacv.cpp.opencv_core.IplImage depthToBGR(com.googlecode.javacv.cpp.opencv_core.IplImage depth, com.googlecode.javacv.cpp.opencv_core.IplImage bgr, int max, float scale)
Convert a depth image to BGR false color.
depth
- the depth image, must be 1 channel IPL_DEPTH_16Ubgr
- the BGR image, must be null or 3 channel IPL_DEPTH_8Umax
- the max depth valuescale
- scale factor applied after gamma
Uses the same algorithm as OpenKinect/libfreenect glview.
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |