public class DenseSIFT extends AbstractDenseSIFT<FImage>
FImage
s.
Extracts upright SIFT features at a single scale on a grid.
Implementation inspired by the VLFeat extractor.
Implementation Notes. The analyser is not thread-safe, however, it is safe to reuse the analyser. In multi-threaded environments, a separate instance must be made for each thread. Internally, this implementation allocates memory for the gradient images, and if possible re-uses these between calls. Re-use requires that the input image is the same size between calls to the analyser.
Modifier and Type | Field and Description |
---|---|
protected int |
binHeight
Height of a single bin of the sampling window (in pixels).
|
protected int |
binWidth
Width of a single bin of the sampling window (in pixels).
|
protected org.openimaj.image.feature.dense.gradient.dsift.DenseSIFT.WorkingData |
data |
protected float[][] |
descriptors
Extracted descriptors
|
protected float[] |
energies
Descriptor energies
|
protected float |
gaussianWindowSize
Size of the Gaussian window (in relative to of the size of a bin)
|
protected int |
numBinsX
Number of spatial bins in the X direction
|
protected int |
numBinsY
Number of spatial bins in the Y direction
|
protected int |
numOriBins
The number of orientation bins
|
protected int |
stepX
Step size of sampling window in x-direction (in pixels)
|
protected int |
stepY
Step size of sampling window in y-direction (in pixels)
|
protected float |
valueThreshold
Threshold for clipping the SIFT features
|
Constructor and Description |
---|
DenseSIFT()
Construct with the default configuration: standard SIFT geometry (4x4x8),
5px x 5px spatial bins, 5px step size, gaussian window size of 2 and
value threshold of 0.2.
|
DenseSIFT(int step,
int binSize)
Construct with the given step size (for both x and y) and binSize.
|
DenseSIFT(int stepX,
int stepY,
int binWidth,
int binHeight,
int numBinsX,
int numBinsY,
int numOriBins)
Construct with the given configuration.
|
DenseSIFT(int stepX,
int stepY,
int binWidth,
int binHeight,
int numBinsX,
int numBinsY,
int numOriBins,
float gaussianWindowSize)
Construct with the given configuration.
|
DenseSIFT(int stepX,
int stepY,
int binWidth,
int binHeight,
int numBinsX,
int numBinsY,
int numOriBins,
float gaussianWindowSize,
float valueThreshold)
Construct with the given configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
analyseImage(FImage image,
Rectangle bounds)
Compute the dense sift descriptors inside the bounds rectangle of the
given image.
|
DenseSIFT |
clone() |
protected void |
extractFeatures()
Extract the DSIFT features
|
int |
getBinHeight()
(Optional operation) Get the height of a single bin of the sampling
window (in pixels).
|
int |
getBinWidth()
(Optional operation) Get the width of a single bin of the sampling window
(in pixels).
|
LocalFeatureList<ByteDSIFTKeypoint> |
getByteKeypoints()
Get the SIFT descriptors from the previous call to
AbstractDenseSIFT.analyseImage(Image) or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with byte vectors. |
LocalFeatureList<ByteDSIFTKeypoint> |
getByteKeypoints(float energyThreshold)
Get the SIFT descriptors from the previous call to
AbstractDenseSIFT.analyseImage(Image) or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with byte vectors. |
float[][] |
getDescriptors()
Get the computed raw dense SIFT descriptors from the previous call to
#analyseImage(FImage) or analyseImage(FImage, Rectangle)
. |
LocalFeatureList<FloatDSIFTKeypoint> |
getFloatKeypoints()
Get the SIFT descriptors from the previous call to
AbstractDenseSIFT.analyseImage(Image) or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with float vectors. |
LocalFeatureList<FloatDSIFTKeypoint> |
getFloatKeypoints(float energyThreshold)
Get the SIFT descriptors from the previous call to
AbstractDenseSIFT.analyseImage(Image) or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with float vectors. |
int |
getNumBinsX()
Get the number of spatial bins in the X direction
|
int |
getNumBinsY()
Get the number of spatial bins in the Y direction
|
int |
getNumOriBins()
Get the number of orientation bins
|
void |
setBinHeight(int size)
(Optional operation) Set the height of a single bin of the sampling
window (in pixels).
|
void |
setBinWidth(int size)
(Optional operation) Set the width of a single bin of the sampling window
(in pixels).
|
analyseImage
protected int stepX
protected int stepY
protected int binWidth
protected int binHeight
protected int numBinsX
protected int numBinsY
protected int numOriBins
protected float gaussianWindowSize
protected float valueThreshold
protected volatile org.openimaj.image.feature.dense.gradient.dsift.DenseSIFT.WorkingData data
protected volatile float[][] descriptors
protected volatile float[] energies
public DenseSIFT()
public DenseSIFT(int step, int binSize)
step
- the step sizebinSize
- the spatial bin sizepublic DenseSIFT(int stepX, int stepY, int binWidth, int binHeight, int numBinsX, int numBinsY, int numOriBins)
stepX
- step size in x directionstepY
- step size in y directionbinWidth
- width of spatial binsbinHeight
- height of spatial binsnumBinsX
- number of bins in x direction for each descriptornumBinsY
- number of bins in y direction for each descriptornumOriBins
- number of orientation bins for each descriptorpublic DenseSIFT(int stepX, int stepY, int binWidth, int binHeight, int numBinsX, int numBinsY, int numOriBins, float gaussianWindowSize)
stepX
- step size in x directionstepY
- step size in y directionbinWidth
- width of spatial binsbinHeight
- height of spatial binsnumBinsX
- number of bins in x direction for each descriptornumBinsY
- number of bins in y direction for each descriptornumOriBins
- number of orientation bins for each descriptorgaussianWindowSize
- the size of the gaussian weighting windowpublic DenseSIFT(int stepX, int stepY, int binWidth, int binHeight, int numBinsX, int numBinsY, int numOriBins, float gaussianWindowSize, float valueThreshold)
stepX
- step size in x directionstepY
- step size in y directionbinWidth
- width of spatial binsbinHeight
- height of spatial binsnumBinsX
- number of bins in x direction for each descriptornumBinsY
- number of bins in y direction for each descriptornumOriBins
- number of orientation bins for each descriptorgaussianWindowSize
- the size of the gaussian weighting windowvalueThreshold
- the threshold for clipping featuresprotected void extractFeatures()
public void analyseImage(FImage image, Rectangle bounds)
AbstractDenseSIFT
analyseImage
in class AbstractDenseSIFT<FImage>
image
- the imagebounds
- the bounds rectanglepublic LocalFeatureList<FloatDSIFTKeypoint> getFloatKeypoints()
AbstractDenseSIFT
AbstractDenseSIFT.analyseImage(Image)
or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with float vectors.getFloatKeypoints
in class AbstractDenseSIFT<FImage>
FloatDSIFTKeypoint
s.public LocalFeatureList<ByteDSIFTKeypoint> getByteKeypoints()
AbstractDenseSIFT
AbstractDenseSIFT.analyseImage(Image)
or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with byte vectors.getByteKeypoints
in class AbstractDenseSIFT<FImage>
ByteDSIFTKeypoint
s.public LocalFeatureList<FloatDSIFTKeypoint> getFloatKeypoints(float energyThreshold)
AbstractDenseSIFT
AbstractDenseSIFT.analyseImage(Image)
or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with float vectors. Only the
features with an energy above the given threshold will be returned.getFloatKeypoints
in class AbstractDenseSIFT<FImage>
energyThreshold
- the threshold on the feature energyFloatDSIFTKeypoint
s.public LocalFeatureList<ByteDSIFTKeypoint> getByteKeypoints(float energyThreshold)
AbstractDenseSIFT
AbstractDenseSIFT.analyseImage(Image)
or AbstractDenseSIFT.analyseImage(Image, Rectangle)
in the form of a list of local features with byte vectors. Only the
features with an energy above the given threshold will be returned.getByteKeypoints
in class AbstractDenseSIFT<FImage>
energyThreshold
- the threshold on the feature energyByteDSIFTKeypoint
s.public float[][] getDescriptors()
#analyseImage(FImage)
or analyseImage(FImage, Rectangle)
.getDescriptors
in class AbstractDenseSIFT<FImage>
public DenseSIFT clone()
clone
in class AbstractDenseSIFT<FImage>
public void setBinWidth(int size)
AbstractDenseSIFT
AbstractDenseSIFT.getNumBinsX()
.setBinWidth
in class AbstractDenseSIFT<FImage>
size
- size to setpublic void setBinHeight(int size)
AbstractDenseSIFT
AbstractDenseSIFT.getNumBinsY()
.setBinHeight
in class AbstractDenseSIFT<FImage>
size
- size to setpublic int getBinWidth()
AbstractDenseSIFT
AbstractDenseSIFT.getNumBinsX()
.getBinWidth
in class AbstractDenseSIFT<FImage>
public int getBinHeight()
AbstractDenseSIFT
AbstractDenseSIFT.getNumBinsY()
.getBinHeight
in class AbstractDenseSIFT<FImage>
public int getNumBinsX()
AbstractDenseSIFT
getNumBinsX
in class AbstractDenseSIFT<FImage>
public int getNumBinsY()
AbstractDenseSIFT
getNumBinsY
in class AbstractDenseSIFT<FImage>
public int getNumOriBins()
AbstractDenseSIFT
getNumOriBins
in class AbstractDenseSIFT<FImage>