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);
}
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);
}
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;
}
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);
}
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);
}
Aggregations