public class SiftDetector
extends java.lang.Object
Implementation of SIFT [1] feature detector. Feature detection is first done by creating the first octave in
a scale space. Then the Difference-of-Gaussian (DoG) is computed from sequential
scales inside the scale-space. From the DoG images, pixels which are maximums and minimums spatially and with
in scale are found. Edges of objects can cause false positives so those are suppressed. The remaining
features are interpolated spatially and across scale.
This class is designed so that it can operate as a stand alone feature detector or so that it can be extended to compute feature descriptors too. The advantage of the former is that the scale-space only needs to be constructed once.
SiftScaleSpaceNonMaxLimiter to detect features spatially.isScaleSpaceExtremum(int, int, float, float)
processFeatureCandidate(int, int, float, boolean)Where N is the number of scale parameters. There are N+3 scale images and N+2 DoG images in an octave.
Edges can also cause local extremes (false positives) in the DoG image. To remove those false positives an
edge detector is proposed by Lowe. The edge detector is turned with the parameter 'r' and a point is considered
an edge if the following is true:
Tr2/Det < (r+1)2/r
where Tr and Det are the trace an determinant of a 2x2 hessian matrix computed from the DoG hessian at that point,
[dXX,dXY;dYX,dYY]
[1] Lowe, D. "Distinctive image features from scale-invariant keypoints". International Journal of Computer Vision, 60, 2 (2004), pp.91--110.
| Modifier and Type | Field and Description |
|---|---|
protected org.ddogleg.struct.FastQueue<ScalePoint> |
detections |
protected double |
pixelScaleToInput |
protected SiftScaleSpace |
scaleSpace |
| Constructor and Description |
|---|
SiftDetector(SiftScaleSpace scaleSpace,
double edgeR,
NonMaxLimiter extractor)
Configures SIFT detector
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
detectFeatures(int scaleIndex)
Detect features inside the Difference-of-Gaussian image at the current scale
|
org.ddogleg.struct.FastQueue<ScalePoint> |
getDetections() |
protected void |
handleDetection(ScalePoint p)
Function for handling a detected point.
|
void |
process(boofcv.struct.image.GrayF32 input)
Detects SIFT features inside the input image
|
protected void |
processFeatureCandidate(int x,
int y,
float value,
boolean maximum)
Examines a local spatial extremum and interpolates its coordinates using a quadratic function.
|
protected SiftScaleSpace scaleSpace
protected double pixelScaleToInput
protected org.ddogleg.struct.FastQueue<ScalePoint> detections
public SiftDetector(SiftScaleSpace scaleSpace, double edgeR, NonMaxLimiter extractor)
scaleSpace - Provides the scale spaceedgeR - Threshold used to remove edge responses. Larger values means its less strict. Try 10extractor - Spatial feature detector that can be configured to limit the number of detected features in each scale.public void process(boofcv.struct.image.GrayF32 input)
input - Input image. Not modified.protected void detectFeatures(int scaleIndex)
scaleIndex - Which scale in the octave is it detecting features inside up.
Primarily provided here for use in child classes.protected void processFeatureCandidate(int x,
int y,
float value,
boolean maximum)
x - x-coordinate of extremumy - y-coordinate of extremumvalue - value of the extremummaximum - true if it was a maximumprotected void handleDetection(ScalePoint p)
p - Detected point in scale-space.public org.ddogleg.struct.FastQueue<ScalePoint> getDetections()