Search in sources :

Example 21 with ImageBorder_F32

use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.

the class TestHessianSobel method compareToConvolve_F32.

@Test
void compareToConvolve_F32() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(HessianSobel.class.getMethod("process", GrayF32.class, GrayF32.class, GrayF32.class, GrayF32.class, ImageBorder_F32.class));
    validator.setKernel(0, HessianSobel.kernelXX_F32);
    validator.setKernel(1, HessianSobel.kernelYY_F32);
    validator.setKernel(2, HessianSobel.kernelXY_F32);
    GrayF32 input = new GrayF32(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayF32 derivXX = new GrayF32(width, height);
    GrayF32 derivYY = new GrayF32(width, height);
    GrayF32 derivXY = new GrayF32(width, height);
    validator.compare(input, derivXX, derivYY, derivXY);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) ImageBorder_F32(boofcv.struct.border.ImageBorder_F32) Test(org.junit.jupiter.api.Test)

Example 22 with ImageBorder_F32

use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.

the class TestDerivativeLaplacian_Inner method process_F32.

public void process_F32(GrayF32 img, GrayF32 deriv) {
    DerivativeLaplacian_Inner.process(img, deriv);
    ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorder.single(BorderType.EXTENDED, GrayF32.class);
    GrayF32 expected = deriv.createSameShape();
    ConvolveImage.convolve(DerivativeLaplacian.kernel_F32, img, expected, border);
    BoofTesting.assertEqualsInner(expected, deriv, UtilEjml.TEST_F32, 1, 1, false);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) ImageBorder_F32(boofcv.struct.border.ImageBorder_F32)

Example 23 with ImageBorder_F32

use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.

the class TestHessianThreeDeterminant_Inner method hessianDetFromConv_F32_F32.

public static GrayF32 hessianDetFromConv_F32_F32(GrayF32 img) {
    ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorder.single(BorderType.EXTENDED, GrayF32.class);
    GrayF32 Lxx = new GrayF32(img.width, img.height);
    GrayF32 Lyy = new GrayF32(img.width, img.height);
    GrayF32 Lxy = new GrayF32(img.width, img.height);
    ConvolveImage.horizontal(HessianThree.kernelXXYY_F32, img, Lxx, border);
    ConvolveImage.vertical(HessianThree.kernelXXYY_F32, img, Lyy, border);
    ConvolveImage.convolve(HessianThree.kernelCross_F32, img, Lxy, border);
    GrayF32 expected = new GrayF32(img.width, img.height);
    for (int y = 0; y < img.height; y++) {
        for (int x = 0; x < img.width; x++) {
            expected.data[expected.getIndex(x, y)] = 4 * (Lxx.get(x, y) * Lyy.get(x, y) - Lxy.get(x, y) * Lxy.get(x, y));
        }
    }
    return expected;
}
Also used : GrayF32(boofcv.struct.image.GrayF32) ImageBorder_F32(boofcv.struct.border.ImageBorder_F32)

Example 24 with ImageBorder_F32

use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.

the class TestDerivativeLaplacian method process_F32.

public void process_F32(GrayF32 img, GrayF32 deriv) {
    ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorder.single(BorderType.EXTENDED, GrayF32.class);
    DerivativeLaplacian.process(img, deriv, border);
    GrayF32 expected = deriv.createSameShape();
    ConvolveImage.convolve(DerivativeLaplacian.kernel_F32, img, expected, border);
    BoofTesting.assertEquals(expected, deriv, UtilEjml.TEST_F32);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) ImageBorder_F32(boofcv.struct.border.ImageBorder_F32)

Example 25 with ImageBorder_F32

use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.

the class TestGradientPrewitt method compareToConvolve_F32.

@Test
public void compareToConvolve_F32() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(GradientPrewitt.class.getMethod("process", GrayF32.class, GrayF32.class, GrayF32.class, ImageBorder_F32.class));
    validator.setKernel(0, GradientPrewitt.kernelDerivX_F32);
    validator.setKernel(1, GradientPrewitt.kernelDerivY_F32);
    GrayF32 input = new GrayF32(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayF32 derivX = new GrayF32(width, height);
    GrayF32 derivY = new GrayF32(width, height);
    validator.compare(input, derivX, derivY);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) ImageBorder_F32(boofcv.struct.border.ImageBorder_F32) Test(org.junit.jupiter.api.Test)

Aggregations

ImageBorder_F32 (boofcv.struct.border.ImageBorder_F32)34 GrayF32 (boofcv.struct.image.GrayF32)25 Test (org.junit.jupiter.api.Test)17 Kernel2D_F32 (boofcv.struct.convolve.Kernel2D_F32)7 ImageBorder_S32 (boofcv.struct.border.ImageBorder_S32)2 GrayS16 (boofcv.struct.image.GrayS16)2 ImageGray (boofcv.struct.image.ImageGray)2 ScalePoint (boofcv.struct.feature.ScalePoint)1 Point2D_I16 (georegression.struct.point.Point2D_I16)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Random (java.util.Random)1