public class CvKinectDemo extends CvKinect
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPNAME
Application name.
|
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
depthBGR
False color depth image.
|
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
depthMask
Depth mask image.
|
protected int[] |
dumpXY
State for
handleMouse(int, int, int, int) . |
protected boolean |
falseColor
Whether to show depth in false color if possible.
|
protected java.lang.String |
fmtCycle
State for
handleKeyExt(int) . |
protected int |
ledCycle
State for
handleKeyExt(int) . |
protected boolean |
maskColor
Whether to mask color by valid depth if possible.
|
protected boolean |
regCycle
State for
handleKeyExt(int) . |
protected int |
tiltCycle
State for
handleKeyExt(int) . |
DEF_APPNAME, DEF_INPUT, MAX_DEPTH_11BIT, MAX_DEPTH_MM, MIN_DEPTH_11BIT, MIN_DEPTH_MM, okGrabber
appname, brightness, canvasFrame, canvasFrameKeyEvent, cap, CAP_PROP_NAMES, CAP_PROPS, capImage, dbg, DEF_CAM_H, DEF_CAM_W, DEF_MAX_FPS, DEF_MIN_DELAY_MS, DEF_SERVER_FPS, DEF_SERVER_PORT, DEF_USE_CANVAS_FRAME, DEF_USE_CONSOLE, DEF_USE_SERVER, DEF_USE_WINDOW, enableExit, exposure, FMT, frameEndMS, frameN, gain, grabber, height, hue, maxFPS, minDelayMS, mouseCallback, msgStream, msPerTick, paused, procImage, saturation, saveImage, server, serverFPS, serverImage, serverKey, serverPort, streamIndex, useCanvasFrame, useConsole, useServer, useWindow, V4L2_AUTO_PROP_NAMES, V4L2_AUTO_PROP_OFF_VALS, V4L2_AUTO_PROP_ON_VALS, V4L2_AUTO_PROPS, V4L2_CID_AUDIO_BALANCE, V4L2_CID_AUDIO_BASS, V4L2_CID_AUDIO_LOUDNESS, V4L2_CID_AUDIO_MUTE, V4L2_CID_AUDIO_TREBLE, V4L2_CID_AUDIO_VOLUME, V4L2_CID_AUTO_WHITE_BALANCE, V4L2_CID_AUTOGAIN, V4L2_CID_BACKLIGHT_COMPENSATION, V4L2_CID_BASE, V4L2_CID_BLACK_LEVEL, V4L2_CID_BLUE_BALANCE, V4L2_CID_BRIGHTNESS, V4L2_CID_CAMERA_CLASS, V4L2_CID_CAMERA_CLASS_BASE, V4L2_CID_CONTRAST, V4L2_CID_DO_WHITE_BALANCE, V4L2_CID_EXPOSURE, V4L2_CID_EXPOSURE_ABSOLUTE, V4L2_CID_EXPOSURE_AUTO, V4L2_CID_EXPOSURE_AUTO_PRIORITY, V4L2_CID_FOCUS_ABSOLUTE, V4L2_CID_FOCUS_AUTO, V4L2_CID_FOCUS_RELATIVE, V4L2_CID_GAIN, V4L2_CID_GAMMA, V4L2_CID_HCENTER_DEPRECATED, V4L2_CID_HFLIP, V4L2_CID_HUE, V4L2_CID_HUE_AUTO, V4L2_CID_LASTP1, V4L2_CID_PAN_ABSOLUTE, V4L2_CID_PAN_RELATIVE, V4L2_CID_PAN_RESET, V4L2_CID_POWER_LINE_FREQUENCY, V4L2_CID_POWER_LINE_FREQUENCY_50HZ, V4L2_CID_POWER_LINE_FREQUENCY_60HZ, V4L2_CID_POWER_LINE_FREQUENCY_DISABLED, V4L2_CID_PRIVATE_BASE, V4L2_CID_RED_BALANCE, V4L2_CID_SATURATION, V4L2_CID_SHARPNESS, V4L2_CID_TILT_ABSOLUTE, V4L2_CID_TILT_RELATIVE, V4L2_CID_TILT_RESET, V4L2_CID_USER_BASE, V4L2_CID_USER_CLASS, V4L2_CID_VCENTER_DEPRECATED, V4L2_CID_VFLIP, V4L2_CID_WHITE_BALANCE_TEMPERATURE, V4L2_CID_WHITENESS, V4L2_CTRL_CLASS_CAMERA, V4L2_CTRL_CLASS_MPEG, V4L2_CTRL_CLASS_USER, V4L2_EXPOSURE_APERTURE_PRIORITY, V4L2_EXPOSURE_AUTO, V4L2_EXPOSURE_MANUAL, V4L2_EXPOSURE_SHUTTER_PRIORITY, v4l2Auto, warnStream, width
Constructor and Description |
---|
CvKinectDemo()
Sets
APPNAME . |
Modifier and Type | Method and Description |
---|---|
protected void |
guiHelpExt()
Display extra GUI help, for subclasses.
|
protected boolean |
handleKeyExt(int code)
Keypresses not handled by the default implementation of handleKey() are
passed here.
|
protected void |
handleMouse(int event,
int x,
int y,
int flags)
Handle mouse events.
|
static void |
main(java.lang.String[] argv)
Program entry point.
|
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
process(com.googlecode.javacv.cpp.opencv_core.IplImage frame)
Process the given frame.
|
void |
release()
Frees memory, closes windows, and releases resources.
|
cmdHelpExt, depthToBGR, getDefAppname, getDefInput, getTiltDegs, getTiltState, initExt, setDepthRegistration, setFormat, setLED, setTiltDegs
camIndexOptional, cmdHelp, cmdHelpExtParams, doneProcessing, dumpCaptureProperties, finalize, fmt, getCaptureProperty, guiHelp, handleKey, handleMouse, init, init, init, init, mainLoop, makeGrabber, makeServer, mouseEventToString, msg, nowMS, save, setCaptureProperty, updateServerImage, v4l2DisableAuto, v4l2EnableAuto, v4l2GetExposure, v4l2SetExposure, waitForKeypresss, warn
public static final java.lang.String APPNAME
protected int tiltCycle
handleKeyExt(int)
.protected int ledCycle
handleKeyExt(int)
.protected boolean regCycle
handleKeyExt(int)
.protected java.lang.String fmtCycle
handleKeyExt(int)
.protected int[] dumpXY
handleMouse(int, int, int, int)
.protected com.googlecode.javacv.cpp.opencv_core.IplImage depthBGR
protected com.googlecode.javacv.cpp.opencv_core.IplImage depthMask
protected boolean falseColor
protected boolean maskColor
public CvKinectDemo()
APPNAME
.protected boolean handleKeyExt(int code)
Keypresses not handled by the default implementation of handleKey() are passed here.
Default impl just prints the keycode.
Overriding this is one way that subclasses can handle extra keypresses.
This impl handles keycodes for Kinect demo functions.
handleKeyExt
in class CvBase
protected void guiHelpExt()
This impl handles keycodes for Kinect demo functions.
guiHelpExt
in class CvBase
protected void handleMouse(int event, int x, int y, int flags)
Handle mouse events.
This impl triggers RGB/XYZ dump on click.
handleMouse
in class CvBase
event
- one of the CV_EVENT_* constants (see opencv_highgui.java in
the JavaCV sources for a list)x
- the x pixel coordinate of the mouse eventy
- the y pixel coordinate of the mouse eventflags
- bitmask of the CV_EVENT_FLAG_* constants (see
opencv_highgui.java in the JavaCV sources for a list)
Default impl prints a message using CvBase.mouseEventToString(int, int, int, int)
except
for CV_EVENT_MOUSEMOVE.
Overriding this is one way that subclasses can handle mouse events.
protected com.googlecode.javacv.cpp.opencv_core.IplImage process(com.googlecode.javacv.cpp.opencv_core.IplImage frame)
Process the given frame.
Default impl is identity.
Note that the passed image may not be mutated. So to do any significant processing, you will need to allocate your own return image. It is typically best to do this once for the first frame, store the results in subclass instance variables, and then deallocate any allocated space in the subclass destructor.
All frames are guaranteed to have the same dimensions and pixel format.
This will be called for every iteration of CvBase.mainLoop()
, even while
paused. You may use the various instance fields (CvBase.frameN
, CvBase.capImage
, CvBase.paused
, CvBase.dbg
, etc) to determine what
operations to perform. Of course, when writing a subclass, you may also
add your own fields.
This impl handles Kinect demo functions.
public void release()
This impl also releases depthBGR
.
public static void main(java.lang.String[] argv)