public class MotionDetectorFilter extends AbstractBufferedImageOp
Constructor and Description |
---|
MotionDetectorFilter() |
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage source,
java.awt.image.BufferedImage destination)
Filter the source image, and if motion is detected, place a red circle at
the center of gravity of the motion.
|
double |
getAreaThreshold()
Get the percentage fraction of detected motion area threshold above which it is classified as
"moved".
|
java.awt.Point |
getCOG()
Return center of gravity of motion detected by the most recent invocation
of filter(), or null if no motion was detected.
|
boolean |
getModifyImage()
Return whether the filter will modify the provided image with a visual
indication of the amount and location of the motion.
|
double |
getMotionArea()
Return the motion strength (0 = no motion, 100 = full image covered by motion).
|
int |
getPixelThreshold()
Get the pixel intensity difference threshold above which pixel is classified as "moved".
|
boolean |
isMotion()
Return whether motion was detected in the last filter operation.
|
void |
setAreaThreshold(double threshold)
Set the percentage fraction of detected motion area threshold above which it is classified as
"moved".
|
void |
setModifyImage(boolean modify)
Specify whether to modify the image with a visual indication of the amount
and location of the motion.
|
void |
setPixelThreshold(int threshold)
Set the pixel intensity difference threshold above which pixel is classified as "moved".
|
java.lang.String |
toString()
Return a string description of the filter.
|
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage source, java.awt.image.BufferedImage destination)
source
- The source image, on which motion is detected.destination
- The destination image, on which the red circle is added,
or null to specify to add the circle to the source image.public double getAreaThreshold()
setAreaThreshold(double)
public java.awt.Point getCOG()
public boolean getModifyImage()
public double getMotionArea()
public int getPixelThreshold()
setPixelThreshold(int)
public boolean isMotion()
public void setAreaThreshold(double threshold)
threshold
- The percentage of image area.getAreaThreshold()
public void setModifyImage(boolean modify)
modify
- True to modify the image.getModifyImage()
public void setPixelThreshold(int threshold)
threshold
- The pixel intensity difference threshold.getPixelThreshold()
public java.lang.String toString()
toString
in class java.lang.Object