use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestGradientScharr method compareToConvolve_I8.
@Test
void compareToConvolve_I8() throws NoSuchMethodException {
CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
validator.setTarget(GradientScharr.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
validator.setKernel(0, GradientScharr.kernelDerivX_I32);
validator.setKernel(1, GradientScharr.kernelDerivY_I32);
GrayU8 input = new GrayU8(width, height);
ImageMiscOps.fillUniform(input, rand, 0, 10);
GrayS16 derivX = new GrayS16(width, height);
GrayS16 derivY = new GrayS16(width, height);
validator.compare(input, derivX, derivY);
}
use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestGradientThree method compareToConvolve_I16.
@Test
void compareToConvolve_I16() throws NoSuchMethodException {
CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
validator.setTarget(GradientThree.class.getMethod("process", GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
validator.setKernel(0, GradientThree.kernelDeriv_I32, true);
validator.setKernel(1, GradientThree.kernelDeriv_I32, false);
GrayS16 input = new GrayS16(width, height);
ImageMiscOps.fillUniform(input, rand, 0, 10);
GrayS16 derivX = new GrayS16(width, height);
GrayS16 derivY = new GrayS16(width, height);
validator.compare(input, derivX, derivY);
}
use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestHessianFromGradient method hessianSobel_I8.
@Test
void hessianSobel_I8() throws NoSuchMethodException {
CompareHessianToConvolution validator = new CompareHessianToConvolution();
validator.setTarget(HessianFromGradient.class.getMethod("hessianSobel", GrayS16.class, GrayS16.class, GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
validator.setKernel(0, GradientSobel.kernelDerivX_I32);
validator.setKernel(1, GradientSobel.kernelDerivY_I32);
GrayS16 derivX = new GrayS16(width, height);
GrayS16 derivY = new GrayS16(width, height);
ImageMiscOps.fillUniform(derivX, rand, -10, 10);
ImageMiscOps.fillUniform(derivY, rand, -10, 10);
GrayS16 derivXX = new GrayS16(width, height);
GrayS16 derivYY = new GrayS16(width, height);
GrayS16 derivXY = new GrayS16(width, height);
validator.compare(derivX, derivY, derivXX, derivYY, derivXY);
}
use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestHessianThreeDeterminant_Border method process_U8_F32.
public void process_U8_F32(GrayU8 img, GrayF32 deriv) {
ImageBorder_S32<GrayU8> border = (ImageBorder_S32) FactoryImageBorder.single(BorderType.EXTENDED, GrayU8.class);
HessianThreeDeterminant_Border.process(img, deriv, border);
GrayS16 expected = hessianDetFromConv_U8_S16(img);
BoofTesting.assertEqualsBorder(expected, deriv, 1e-4, 2, 2);
}
use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestHessianThreeDeterminant_Border method hessianDetFromConv_U8_S16.
public static GrayS16 hessianDetFromConv_U8_S16(GrayU8 img) {
ImageBorder_S32<GrayU8> border = (ImageBorder_S32) FactoryImageBorder.single(BorderType.EXTENDED, GrayU8.class);
GrayS16 Lxx = new GrayS16(img.width, img.height);
GrayS16 Lyy = new GrayS16(img.width, img.height);
GrayS16 Lxy = new GrayS16(img.width, img.height);
ConvolveImage.horizontal(HessianThree.kernelXXYY_I32, img, Lxx, border);
ConvolveImage.vertical(HessianThree.kernelXXYY_I32, img, Lyy, border);
ConvolveImage.convolve(HessianThree.kernelCross_I32, img, Lxy, border);
GrayS16 expected = new GrayS16(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)] = (short) (Lxx.get(x, y) * Lyy.get(x, y) - Lxy.get(x, y) * Lxy.get(x, y));
}
}
return expected;
}
Aggregations