use of boofcv.struct.feature.BrightFeature in project BoofCV by lessthanoptimal.
the class TestDetectDescribeFusion method checkWithOrientation.
@Test
public void checkWithOrientation() {
final InterestPointDetector<GrayF32> detector = FactoryInterestPoint.fastHessian(null);
final OrientationImage ori = FactoryOrientationAlgs.nogradient(1.0 / 2.0, 5, GrayF32.class);
final DescribeRegionPoint<GrayF32, BrightFeature> desc = FactoryDescribeRegionPoint.surfStable(null, GrayF32.class);
new GenericTestsDetectDescribePoint(true, true, ImageType.single(GrayF32.class), BrightFeature.class) {
@Override
public DetectDescribePoint createDetDesc() {
return new DetectDescribeFusion(detector, ori, desc);
}
}.allTests();
}
use of boofcv.struct.feature.BrightFeature in project BoofCV by lessthanoptimal.
the class TestWrapAssociateSurfBasic method c.
@Override
protected BrightFeature c(double value) {
BrightFeature s = new BrightFeature(1);
s.value[0] = value;
return s;
}
use of boofcv.struct.feature.BrightFeature in project BoofCV by lessthanoptimal.
the class DescribePointSurf method describe.
/**
* Compute SURF descriptor, but without laplacian sign
*
* @param x Location of interest point.
* @param y Location of interest point.
* @param angle The angle the feature is pointing at in radians.
* @param scale Scale of the interest point. Null is returned if the feature goes outside the image border.
* @param ret storage for the feature. Must have 64 values.
*/
public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret) {
double c = Math.cos(angle), s = Math.sin(angle);
// By assuming that the entire feature is inside the image faster algorithms can be used
// the results are also of dubious value when interacting with the image border.
boolean isInBounds = SurfDescribeOps.isInside(ii, x, y, radiusDescriptor, widthSample, scale, c, s);
// declare the feature if needed
if (ret == null)
ret = new BrightFeature(featureDOF);
else if (ret.value.length != featureDOF)
throw new IllegalArgumentException("Provided feature must have " + featureDOF + " values");
gradient.setImage(ii);
gradient.setWidth(widthSample * scale);
// use a safe method if its along the image border
SparseImageGradient gradient = isInBounds ? this.gradient : this.gradientSafe;
// extract descriptor
features(x, y, c, s, scale, gradient, ret.value);
}
use of boofcv.struct.feature.BrightFeature in project BoofCV by lessthanoptimal.
the class AssociateSurfBasic method sort.
/**
* Splits the set of input features into positive and negative laplacian lists.
* Keep track of the feature's index in the original input list. This is
* the index that needs to be returned.
*/
private void sort(FastQueue<BrightFeature> input, FastQueue<Helper> pos, FastQueue<Helper> neg) {
pos.reset();
neg.reset();
for (int i = 0; i < input.size; i++) {
BrightFeature f = input.get(i);
if (f.white) {
pos.grow().wrap(f, i);
} else {
neg.grow().wrap(f, i);
}
}
}
use of boofcv.struct.feature.BrightFeature in project BoofCV by lessthanoptimal.
the class CompleteSift method handleDetection.
@Override
protected void handleDetection(ScalePoint p) {
// adjust the image for the down sampling in each octave
double localX = p.x / pixelScaleToInput;
double localY = p.y / pixelScaleToInput;
double localSigma = p.scale / pixelScaleToInput;
// find potential orientations first
orientation.process(localX, localY, localSigma);
// describe each feature
GrowQueue_F64 angles = orientation.getOrientations();
for (int i = 0; i < angles.size; i++) {
BrightFeature feature = features.grow();
feature.white = p.white;
describe.process(localX, localY, localSigma, angles.get(i), feature);
orientations.add(angles.get(i));
locations.add(p);
}
}
Aggregations