|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectohmm.CvBase
ohmm.CvKinect
ohmm.CvKinectDemo
public class CvKinectDemo
Demo of CvKinect
.
Also see CvDemo
.
Field Summary | |
---|---|
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) . |
Fields inherited from class ohmm.CvKinect |
---|
DEF_APPNAME, DEF_INPUT, MAX_DEPTH_11BIT, MAX_DEPTH_MM, MIN_DEPTH_11BIT, MIN_DEPTH_MM, okGrabber |
Constructor Summary | |
---|---|
CvKinectDemo()
Sets APPNAME . |
Method Summary | |
---|---|
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. |
Methods inherited from class ohmm.CvKinect |
---|
cmdHelpExt, depthToBGR, getDefAppname, getDefInput, getTiltDegs, getTiltState, initExt, setDepthRegistration, setFormat, setLED, setTiltDegs |
Methods inherited from class ohmm.CvBase |
---|
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 |
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 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
Constructor Detail |
---|
public CvKinectDemo()
APPNAME
.
Method Detail |
---|
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.
process
in class CvBase
public void release()
This impl also releases depthBGR
.
release
in class CvBase
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |