public class AprilTagFilter extends AbstractBufferedImageOp
Modifier and Type | Class and Description |
---|---|
(package private) static class |
AprilTagFilter.GrayModel
Fits a grayscale model over an area of the form:
Ax + By + Cxy + D = value
We use this model to compute spatially-varying thresholds for
reading bits.
|
(package private) class |
AprilTagFilter.Quad
Represents four segments that form a loop, and might be a tag.
|
(package private) class |
AprilTagFilter.Segment
Represents a line fit to a set of pixels whose gradients are
similar.
|
Modifier and Type | Field and Description |
---|---|
boolean |
debug
Produce debugging output.
|
java.awt.image.BufferedImage |
debugInput |
java.awt.image.BufferedImage |
debugMag |
java.awt.image.BufferedImage |
debugSegInput |
java.awt.image.BufferedImage |
debugSegmentation |
java.awt.image.BufferedImage |
debugTheta |
double |
maxQuadAspectRatio
Early pruning of quads which have insane aspect ratios.
|
double |
minimumLineLength
Minimum line length in pixels.
|
double |
minimumSegmentSize
Minimum number of pixels in a segment before we'll fit a line to it.
|
double |
minimumTagSize
Minimum size of tag (in pixels) as measured along edges and diagonals.
|
double |
quadSearchRangeFraction |
double |
quadSearchRangePix |
int |
WEIGHT_SCALE
During segmentation, the weight of an edge is related to the
change in theta between the two pixels.
|
Constructor and Description |
---|
AprilTagFilter() |
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 |
getMagThresh()
When growing components, the intra component variation is
allowed to grow when the component is small in size.
|
double |
getMaxEdgeCost()
Return the maximum angle range allowed for the gradient directions
when connecting edges, in radians.
|
double |
getMinMag()
Return the gradient magnitude threshold for ignoring pixels.
|
double |
getSegSigma()
Return the Gaussian smoothing kernel applied to image (0 == no filter)
used when detecting the outline of the box.
|
double |
getSigma()
Return the Gaussian smoothing kernel applied to image (0 == no filter, the default)
used when sampling bits.
|
java.lang.String |
getTagFamily()
Get the name of the tag family being detected.
|
double |
getThetaThresh()
When growing components, the intra component variation is
allowed to grow when the component is small in size.
|
boolean |
isSegDecimate()
Return whether decimating before segmenting is enabled.
|
void |
setMagThresh(double magThresh)
When growing components, the intra component variation is
allowed to grow when the component is small in size.
|
void |
setMaxEdgeCost(double maxEdgeCost)
Set the maximum angle range allowed for the gradient directions
when connecting edges, in radians.
|
void |
setMinMag(double minMag)
Set the gradient magnitude threshold for ignoring pixels.
|
void |
setSegDecimate(boolean segDecimate)
Set whether decimating before segmenting is enabled.
|
void |
setSegSigma(double segSigma)
Set the Gaussian smoothing kernel applied to image (0 == no filter)
used when detecting the outline of the box.
|
void |
setSigma(double sigma)
Set the Gaussian smoothing kernel applied to image (0 == no filter, the default)
used when sampling bits.
|
void |
setTagFamily(java.lang.String name)
Set the name of the tag family being detected.
|
void |
setThetaThresh(double thetaThresh)
When growing components, the intra component variation is
allowed to grow when the component is small in size.
|
ArrayToken |
tags()
Return an array of records representing the most recently detected tags
from an invocation of
filter(BufferedImage, BufferedImage) , or
null if there has been no such invocation or if no tags were detected. |
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
public double maxQuadAspectRatio
public double minimumLineLength
public double minimumSegmentSize
public double minimumTagSize
public double quadSearchRangePix
public double quadSearchRangeFraction
public boolean debug
public java.awt.image.BufferedImage debugInput
public java.awt.image.BufferedImage debugSegInput
public java.awt.image.BufferedImage debugSegmentation
public java.awt.image.BufferedImage debugTheta
public java.awt.image.BufferedImage debugMag
public int WEIGHT_SCALE
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage source, java.awt.image.BufferedImage destination)
tags()
method.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 getMagThresh()
setMagThresh(double)
public double getMaxEdgeCost()
setMaxEdgeCost(double)
public double getMinMag()
setMinMag(double)
public double getSegSigma()
setSegSigma(double)
public double getSigma()
setSigma(double)
public java.lang.String getTagFamily()
setTagFamily(String)
public double getThetaThresh()
setThetaThresh(double)
public boolean isSegDecimate()
setSegDecimate(boolean)
public void setMagThresh(double magThresh)
getMagThresh()
public void setMaxEdgeCost(double maxEdgeCost)
getMaxEdgeCost()
public void setMinMag(double minMag)
getMinMag()
public void setSegDecimate(boolean segDecimate)
public void setSegSigma(double segSigma)
getSegSigma()
public void setSigma(double sigma)
getSigma()
public void setTagFamily(java.lang.String name)
name
- The name of the tag family.getTagFamily()
public void setThetaThresh(double thetaThresh)
getThetaThresh()
public ArrayToken tags() throws IllegalActionException
filter(BufferedImage, BufferedImage)
, or
null if there has been no such invocation or if no tags were detected.
Each record includes the following fields:
IllegalActionException
- If the array cannot be constructed.