|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectohmm.CvBase
ohmm.CvDemo
public class CvDemo
Demo of CvBase
.
The main action is in process(com.googlecode.javacv.cpp.opencv_core.IplImage)
. Also shows how to handle custom
command line parameters and mouse and key events.
Field Summary | |
---|---|
protected boolean |
allDone
Time to quit? |
static java.lang.String |
APPNAME
Application name. |
static int |
DEF_MAX_FPS
Default max FPS. |
protected int[] |
dumpXY
Clicked pixel coords pending RGB dump, or -1 if none. |
protected com.googlecode.javacv.cpp.opencv_core.IplImage |
procImg
Processed image buffer, allocated on first call to process(com.googlecode.javacv.cpp.opencv_core.IplImage) . |
Constructor Summary | |
---|---|
CvDemo()
Sets APPNAME and DEF_MAX_FPS . |
Method Summary | |
---|---|
protected void |
cmdHelpExt()
Help for the extra command line parameter. |
protected java.lang.String |
cmdHelpExtParams()
Shows the extra command line parameter. |
protected boolean |
doneProcessing()
Are we allDone ? |
protected void |
guiHelpExt()
Help for the extra GUI keyboard commands. |
protected boolean |
handleKeyExt(int code)
Handle our custom keypresses. |
protected void |
handleMouse(int event,
int x,
int y,
int flags)
Show pixel color at mouse click. |
int |
initExt(int argc,
java.lang.String[] argv,
int ate)
Handle extra command line parameters. |
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)
Shows how to do image processing. |
void |
release()
Releases allocated memory. |
Methods inherited from class ohmm.CvBase |
---|
camIndexOptional, cmdHelp, dumpCaptureProperties, finalize, fmt, getCaptureProperty, getDefAppname, getDefInput, 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 int DEF_MAX_FPS
public static final java.lang.String APPNAME
protected boolean allDone
protected int[] dumpXY
protected com.googlecode.javacv.cpp.opencv_core.IplImage procImg
process(com.googlecode.javacv.cpp.opencv_core.IplImage)
.
Constructor Detail |
---|
public CvDemo()
APPNAME
and DEF_MAX_FPS
.
Method Detail |
---|
protected void cmdHelpExt()
cmdHelpExt
in class CvBase
protected java.lang.String cmdHelpExtParams()
cmdHelpExtParams
in class CvBase
protected void guiHelpExt()
guiHelpExt
in class CvBase
protected com.googlecode.javacv.cpp.opencv_core.IplImage process(com.googlecode.javacv.cpp.opencv_core.IplImage frame)
process
in class CvBase
protected boolean doneProcessing()
allDone
?
doneProcessing
in class CvBase
Default impl returns false.
protected boolean handleKeyExt(int code)
handleKeyExt
in class CvBase
protected void handleMouse(int event, int x, int y, int flags)
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.
public void release()
release
in class CvBase
public int initExt(int argc, java.lang.String[] argv, int ate)
initExt
in class CvBase
ate
- the number of command line arguments already eaten by CvBase.init(int, String[])
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |