public class DescribePointSift<Deriv extends boofcv.struct.image.ImageGray> extends DescribeSiftCommon
A faithful implementation of the SIFT descriptor.
The descriptor is computed inside of a square grid which is scaled and rotated. Each grid cell is composed of a square sub-region. If the sub-region is 4x4 and the outer grid is 5x5 then a total area of size 20x20 is sampled. For each sub-region a histogram with N bins of orientations is computed. Orientation from each sample point comes from the image's spacial derivative. If the outer grid is 4x4 and the histogram N=8, then the total descriptor will be 128 elements.
When a point is sample, its orientation (-pi to pi) and magnitude sqrt(dx**2 + dy**2) are both computed. A contribution from this sample point is added to the entire descriptor and weighted using trilinear interpolation (outer grid x-y coordinate, and orientation bin), Gaussian distribution centered at key point location, and the magnitude.
There are no intentional differences from the paper. However the paper is ambiguous in some places.
[1] Lowe, D. "Distinctive image features from scale-invariant keypoints". International Journal of Computer Vision, 60, 2 (2004), pp.91--110.
gaussianWeight, histogramBinWidth, maxDescriptorElementValue, numHistogramBins, widthGrid, widthSubregion| Constructor and Description |
|---|
DescribePointSift(int widthSubregion,
int widthGrid,
int numHistogramBins,
double sigmaToPixels,
double weightingSigmaFraction,
double maxDescriptorElementValue,
java.lang.Class<Deriv> derivType)
Configures the descriptor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
process(double c_x,
double c_y,
double sigma,
double orientation,
TupleDesc_F64 descriptor)
Computes the SIFT descriptor for the specified key point
|
void |
setImageGradient(Deriv derivX,
Deriv derivY)
Sets the image spacial derivatives.
|
createGaussianWeightKernel, getCanonicalRadius, getDescriptorLength, normalizeDescriptor, trilinearInterpolationpublic DescribePointSift(int widthSubregion,
int widthGrid,
int numHistogramBins,
double sigmaToPixels,
double weightingSigmaFraction,
double maxDescriptorElementValue,
java.lang.Class<Deriv> derivType)
widthSubregion - Width of sub-region in samples. Try 4widthGrid - Width of grid in subregions. Try 4.numHistogramBins - Number of bins in histogram. Try 8sigmaToPixels - Conversion of sigma to pixels. Used to scale the descriptor region. Try 1.5 ??????weightingSigmaFraction - Sigma for Gaussian weighting function is set to this value * region width. Try 0.5maxDescriptorElementValue - Helps with non-affine changes in lighting. See paper. Try 0.2public void setImageGradient(Deriv derivX, Deriv derivY)
derivX - x-derivative of input imagederivY - y-derivative of input imagepublic void process(double c_x,
double c_y,
double sigma,
double orientation,
TupleDesc_F64 descriptor)
c_x - center of key point. x-axisc_y - center of key point. y-axissigma - Computed sigma in scale-space for this pointorientation - Orientation of keypoint in radiansdescriptor - (output) Storage for computed descriptor. Make sure it's the appropriate length first