@Test public void checkOverflow() { ImplShiTomasiCornerWeighted_S16 detector = new ImplShiTomasiCornerWeighted_S16(1); detector.totalXX = (1 << 18) + 10; detector.totalYY = (1 << 20) + 50; detector.totalXY = (1 << 16) + 5; assertTrue(detector.computeResponse() > 0); }
public void compareToNaive(GrayS16 derivX, GrayS16 derivY) { GrayF32 expected = new GrayF32(derivX.width, derivX.height); GrayF32 found = new GrayF32(derivX.width, derivX.height); ImplSsdCornerNaive naive = new ImplSsdCornerNaive(width, height, 3, true); naive.process(derivX, derivY, expected); ImplShiTomasiCornerWeighted_S16 fast = new ImplShiTomasiCornerWeighted_S16(3); fast.process(derivX, derivY, found); // how the weighted is applied is different between these two verisons, which is why the error // tolerance is so high BoofTesting.assertEqualsInner(expected, found, 0.5, 3, 3, true); }