use of boofcv.struct.feature.ScalePoint in project BoofCV by lessthanoptimal.
the class TestSiftDetector method processFeatureCandidate_NoChange.
/**
* Interpolation shouldn't change the location since its equal on all sides
*/
@Test
public void processFeatureCandidate_NoChange() {
GrayF32 upper = new GrayF32(30, 40);
GrayF32 current = new GrayF32(30, 40);
GrayF32 lower = new GrayF32(30, 40);
SiftDetector alg = createDetector();
alg.pixelScaleToInput = 2.0;
alg.sigmaLower = 4;
alg.sigmaTarget = 5;
alg.sigmaUpper = 6;
alg.dogLower = lower;
alg.dogTarget = current;
alg.dogUpper = upper;
alg.derivXX.setImage(current);
alg.derivXY.setImage(current);
alg.derivYY.setImage(current);
for (float sign : new float[] { -1, 1 }) {
alg.detections.reset();
current.set(15, 16, sign * 100);
alg.processFeatureCandidate(15, 16, 100, sign > 0);
ScalePoint p = alg.getDetections().get(0);
assertEquals(15 * 2, p.x, 1e-8);
assertEquals(16 * 2, p.y, 1e-8);
assertEquals(5, p.scale, 1e-8);
}
}
Aggregations