use of boofcv.struct.border.BorderType 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);
}
}
}
use of boofcv.struct.border.BorderType in project BoofCV by lessthanoptimal.
the class TestFactoryWaveletDaub method transform_biorthogonal_I32.
@Test
void transform_biorthogonal_I32() {
for (BorderType type : borderTypes) {
for (int i = 5; i <= 5; i += 2) {
WaveletDescription<WlCoef_I32> desc = FactoryWaveletDaub.biorthogonal_I32(i, type);
checkEncodeDecode_I32(desc);
}
}
}
use of boofcv.struct.border.BorderType in project BoofCV by lessthanoptimal.
the class TestFactoryWaveletDaub method biorthogonal_F32_inverse.
@Test
void biorthogonal_F32_inverse() {
for (BorderType type : borderTypes) {
for (int i = 5; i <= 5; i += 2) {
WaveletDescription<WlCoef_F32> desc = FactoryWaveletDaub.biorthogonal_F32(i, type);
checkBiorthogonal_F32(desc);
}
}
}
use of boofcv.struct.border.BorderType in project BoofCV by lessthanoptimal.
the class PermuteWaveletCompare method runTest.
private void runTest(int widthIn, int heightIn, int widthOut, int heightOut, boolean swapSize) {
if (swapSize) {
int t = widthIn;
widthIn = widthOut;
widthOut = t;
t = heightIn;
heightIn = heightOut;
heightOut = t;
}
ImageGray input = GeneralizedImageOps.createSingleBand(inputType, widthIn, heightIn);
ImageGray found = GeneralizedImageOps.createSingleBand(outputType, widthOut, heightOut);
ImageGray expected = GeneralizedImageOps.createSingleBand(outputType, widthOut, heightOut);
GImageMiscOps.fillUniform(input, rand, 0, 50);
// test different descriptions lengths and offsets, and borders
for (BorderType type : BorderType.values()) {
for (int o = 0; o <= 2; o++) {
for (int l = 2 + o; l <= 5; l++) {
// System.out.println("type "+type+" o = "+o+" l = "+l);
GImageMiscOps.fill(found, 0);
GImageMiscOps.fill(expected, 0);
// create a random wavelet. does not have to be a real once
// since it just is checking that two functions produce the same output
WaveletDescription<?> desc = createDesc(-o, l, type);
applyValidation(desc, input, expected);
// make sure it works on sub-images
BoofTesting.checkSubImage(this, "innerTest", false, input, found, expected, desc);
}
}
}
}
use of boofcv.struct.border.BorderType in project BoofCV by lessthanoptimal.
the class TestFactoryWaveletDaub method transform_biorthogonal_F32.
@Test
void transform_biorthogonal_F32() {
for (BorderType type : borderTypes) {
for (int i = 5; i <= 5; i += 2) {
WaveletDescription<WlCoef_F32> desc = FactoryWaveletDaub.biorthogonal_F32(i, type);
checkEncodeDecode_F32(desc);
}
}
}
Aggregations