use of boofcv.alg.interpolate.impl.ImplBilinearPixel_U8 in project BoofCV by lessthanoptimal.
the class TestLensDistortionOps method changeCameraModel.
/**
* This is a bit hard to test accurately. That would require computing distorted image and seeing everything lines
* up properly. For now we just check tos ee if things blow up.
*/
@Test
void changeCameraModel() {
CameraPinholeBrown original = new CameraPinholeBrown(200, 200, 0, 200, 200, 400, 400);
CameraPinhole desired = new CameraPinholeBrown(300, 300, 0, 200, 200, 400, 400);
CameraPinhole modified = new CameraPinhole();
BorderType[] borders = new BorderType[] { BorderType.EXTENDED, BorderType.SKIP, BorderType.ZERO, BorderType.REFLECT, BorderType.WRAP };
for (AdjustmentType adj : AdjustmentType.values()) {
for (BorderType border : borders) {
ImageDistort<GrayU8, GrayU8> alg = LensDistortionOps.changeCameraModel(adj, border, original, desired, modified, ImageType.single(GrayU8.class));
// do a few more tests to see of dubious value. if the underlying implementation changes
// this test will need to be updated
assertTrue(alg instanceof ImageDistortCache_SB);
ImageDistortCache_SB _alg = (ImageDistortCache_SB) alg;
assertTrue(_alg.interp instanceof ImplBilinearPixel_U8);
}
}
}
Aggregations