|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecticommand.vision.VisionEffect
icommand.vision.MotionDetectionEffect
public class MotionDetectionEffect
Motion detection effect. The engine has two steps. First the input image and the reference image (which is the image from the previous frame) is compared. Whenever a pixel has changed consideribly (determined by the threshold variable) a internal black-white-red image is marked (at the same exact location where the change occured). Therefore in the first step, the internal black-white-red image is has lit up clusters in the space where a change has occured.
The next step is to eliminate these clusters that are too small, but still
appeared in our black-white-red image. Only the big clusters are left (and
are colored red). During this process we keep a track of couunt of the big
clusters. If the count is greater than blob_threshold then the input
frame is determined to have consideribly motion as to the previous frame.
Many of the ideas have been taken from
Field Summary | |
---|---|
int |
blob_threshold
Our threshold for determinig if the input image has enough motion. |
boolean |
debug
Turn debugging on. |
int |
OPTIMIZATION
Optimization. |
int |
threshold
The threshold for determing if the pixel at a certain location has changed consideribly. |
int |
THRESHOLD_INC
By what value you should increment. |
int |
THRESHOLD_INIT
The initial threshold setting. |
int |
THRESHOLD_MAX
Maximum threshold setting. |
Fields inherited from interface javax.media.PlugIn |
---|
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED |
Constructor Summary | |
---|---|
MotionDetectionEffect()
Initialize the Motion effect plugin. |
Method Summary | |
---|---|
java.lang.Object[] |
getControls()
Getter for array on one control for adjusing motion threshold and setting debug. |
java.lang.String |
getName()
get the name of the effect |
int |
process(javax.media.Buffer inBuffer,
javax.media.Buffer outBuffer)
Process the image, detecting motion in the regions |
Methods inherited from class icommand.vision.VisionEffect |
---|
close, getControl, getSupportedInputFormats, getSupportedOutputFormats, open, reset, setInputFormat, setOutputFormat |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int OPTIMIZATION
public int THRESHOLD_MAX
public int THRESHOLD_INC
public int THRESHOLD_INIT
public int threshold
public int blob_threshold
public boolean debug
Constructor Detail |
---|
public MotionDetectionEffect()
Method Detail |
---|
public int process(javax.media.Buffer inBuffer, javax.media.Buffer outBuffer)
inBuffer
- the input BufferoutBuffer
- the output Buffer
public java.lang.String getName()
public java.lang.Object[] getControls()
getControls
in interface javax.media.Controls
getControls
in class VisionEffect
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |