use of georegression.struct.point.Point2D_F32 in project BoofCV by lessthanoptimal.
the class TestFlipVerticalNorm_F32 method theSuperDuperTest.
@Test
public void theSuperDuperTest() {
FlipVerticalNorm2_F32 alg = new FlipVerticalNorm2_F32(new Dummy(), 1);
Point2D_F32 out = new Point2D_F32();
alg.compute(2, 3, out);
assertEquals(2, out.x, 1e-8);
assertEquals(3, -out.y, 1e-8);
}
use of georegression.struct.point.Point2D_F32 in project BoofCV by lessthanoptimal.
the class ImageDistortCache_SB method renderAll.
public void renderAll() {
// then do the slower border thingy
for (int y = y0; y < y1; y++) {
int indexDst = dstImg.startIndex + dstImg.stride * y + x0;
for (int x = x0; x < x1; x++, indexDst++) {
Point2D_F32 s = map[indexDst];
assign(indexDst, interp.get(s.x, s.y));
}
}
}
use of georegression.struct.point.Point2D_F32 in project BoofCV by lessthanoptimal.
the class PixelTransformCached_F32 method compute.
@Override
public void compute(int x, int y) {
// if( x < 0 || y < 0 || x >= width || y >= height )
// throw new IllegalArgumentException("Out of bounds");
Point2D_F32 p = map[y * width + x];
distX = p.x;
distY = p.y;
}
use of georegression.struct.point.Point2D_F32 in project BoofCV by lessthanoptimal.
the class TestPixelDistortAffine_F32 method constructor_32.
@Test
public void constructor_32() {
Affine2D_F32 a = new Affine2D_F32(1, 2, 3, 4, 5, 6);
PixelTransformAffine_F32 alg = new PixelTransformAffine_F32();
alg.set(a);
alg.compute(2, 3);
Point2D_F32 p = new Point2D_F32(2, 3);
Point2D_F32 expected = new Point2D_F32();
AffinePointOps_F32.transform(a, p, expected);
assertEquals(expected.x, alg.distX, 1e-4);
assertEquals(expected.y, alg.distY, 1e-4);
}
use of georegression.struct.point.Point2D_F32 in project BoofCV by lessthanoptimal.
the class TestPixelTransformHomography_F32 method constructor_32.
@Test
public void constructor_32() {
Homography2D_F32 a = new Homography2D_F32(1, 2, 3, 4, 5, 6, 7, 8, 9);
PixelTransformHomography_F32 alg = new PixelTransformHomography_F32();
alg.set(a);
alg.compute(2, 3);
Point2D_F32 p = new Point2D_F32(2, 3);
Point2D_F32 expected = new Point2D_F32();
HomographyPointOps_F32.transform(a, p, expected);
assertEquals(expected.x, alg.distX, 1e-4);
assertEquals(expected.y, alg.distY, 1e-4);
}
Aggregations