@Reference(type=Article,author="David Lowe",title="Distinctive image features from scale-invariant keypoints",year="2004",journal="IJCV",pages={"91","110"},month="January",number="2",volume="60") @Reference(type=Inproceedings,author="David Lowe",title="Object recognition from local scale-invariant features",year="1999",booktitle="Proc. of the International Conference on Computer Vision {ICCV}",pages={"1150","1157"}) public class SIFTFeatureProvider extends Object implements GradientFeatureProvider, GradientFeatureProviderFactory
| Modifier and Type | Field and Description |
|---|---|
protected float |
gaussianSigma |
protected int |
numOriBins
Number of orientation bins in the histograms
|
protected int |
numSpatialBins
Number of spatial bins for the x and y directions in the histograms
|
protected float |
patchOrientation |
protected float |
sigmaSq2
2 times the weighting Gaussian squared (normalised to the patch size in
terms of spatial bins)
|
protected float |
valueThreshold
Threshold for the maximum allowed value in the histogram
|
protected float[] |
vec |
| Constructor and Description |
|---|
SIFTFeatureProvider()
Construct a
SIFTFeatureProvider with the default parameters. |
SIFTFeatureProvider(int numOriBins,
int numSpatialBins)
Construct a
SIFTFeatureProvider with the provided options. |
SIFTFeatureProvider(int numOriBins,
int numSpatialBins,
float valueThreshold,
float gaussianSigma)
Construct a
SIFTFeatureProvider with the provided options. |
| Modifier and Type | Method and Description |
|---|---|
void |
addSample(float x,
float y,
float gradmag,
float gradori)
Add a sample to the feature.
|
OrientedFeatureVector |
getFeatureVector()
Get the FeatureVector associated with this object.
|
float |
getOversamplingAmount()
Get the amount of required over-sampling outside of the unit square
patch.
|
protected void |
interpolateSample(float x,
float y,
float magnitude,
float orientation)
Spread the sample around the closest bins in the histogram.
|
GradientFeatureProvider |
newProvider()
Construct a new GradientFeatureProvider implementation
with all its internal settings setup ready for use.
|
void |
setPatchOrientation(float patchOrientation)
Set the primary orientation of the sample patch in the image being
processed.
|
protected int numOriBins
protected int numSpatialBins
protected float valueThreshold
protected float sigmaSq2
protected float gaussianSigma
protected float[] vec
protected float patchOrientation
public SIFTFeatureProvider()
SIFTFeatureProvider with the default parameters.public SIFTFeatureProvider(int numOriBins, int numSpatialBins)
SIFTFeatureProvider with the provided options.numOriBins - the number of orientation bins (default 8)numSpatialBins - the number of spatial bins in each direction (default 4)public SIFTFeatureProvider(int numOriBins, int numSpatialBins, float valueThreshold, float gaussianSigma)
SIFTFeatureProvider with the provided options.numOriBins - the number of orientation bins (default 8)numSpatialBins - the number of spatial bins in each direction (default 4)valueThreshold - threshold for the maximum value allowed in the histogram
(default 0.2)gaussianSigma - the width of the Gaussian used for weighting samples, relative
to the half-width of the sampling window (default 1.0).public void addSample(float x, float y, float gradmag, float gradori)
GradientFeatureProvideraddSample in interface GradientFeatureProviderx - x-coordinate within the unit indexing squarey - y-coordinate within the unit indexing squaregradmag - the gradient magnitude at the given coordinategradori - the gradient direction at the given coordinateprotected void interpolateSample(float x, float y, float magnitude, float orientation)
x - the normalised x-coordinatey - the normalised y-coordinatemagnitude - the magnitude of the sampleorientation - the angle of the samplepublic OrientedFeatureVector getFeatureVector()
FeatureVectorProvidergetFeatureVector in interface FeatureVectorProvider<OrientedFeatureVector>getFeatureVector in interface GradientFeatureProviderpublic void setPatchOrientation(float patchOrientation)
GradientFeatureProviderGradientFeatureProvider.addSample(float, float, float, float) are made.setPatchOrientation in interface GradientFeatureProviderpatchOrientation - the actual orientation of the square in the imagepublic GradientFeatureProvider newProvider()
GradientFeatureProviderFactorynewProvider in interface GradientFeatureProviderFactorypublic float getOversamplingAmount()
LocalFeatureProvideraddSample(float, float, float, float) being
called with pixels in the range -0.5 to 1.5.getOversamplingAmount in interface LocalFeatureProvider<OrientedFeatureVector>