use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestImplEnhanceFilter method sharpenBorder8.
public void sharpenBorder8(ImageGray input, ImageGray output) {
ImageGray expected;
GImageMiscOps.fillUniform(input, rand, 0, 10);
if (input.getDataType().isInteger()) {
BoofTesting.callStaticMethod(ImplEnhanceFilter.class, "sharpenBorder8", input, output, 0, 255);
expected = new GrayS16(input.width, input.height);
ImageBorder_S32 border = GImageDerivativeOps.borderDerivative_I32();
border.setImage(input);
ConvolveJustBorder_General_SB.convolve(EnhanceImageOps.kernelEnhance8_I32, border, (GrayS16) expected);
GPixelMath.boundImage(expected, 0, 255);
} else {
BoofTesting.callStaticMethod(ImplEnhanceFilter.class, "sharpenBorder8", input, output, 0f, 255f);
expected = new GrayF32(input.width, input.height);
ImageBorder_F32 border = GImageDerivativeOps.borderDerivative_F32();
border.setImage((GrayF32) input);
ConvolveJustBorder_General_SB.convolve(EnhanceImageOps.kernelEnhance8_F32, border, (GrayF32) expected);
GPixelMath.boundImage(expected, 0, 255);
}
BoofTesting.assertEquals(expected, output, 1e-5);
}
use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestDerivativeLaplacian_Inner method process_U8_S16.
public void process_U8_S16(GrayU8 img, GrayS16 deriv) {
DerivativeLaplacian_Inner.process(img, deriv);
ImageBorder_S32<GrayU8> border = (ImageBorder_S32) FactoryImageBorder.single(BorderType.EXTENDED, GrayU8.class);
GrayS16 expected = deriv.createSameShape();
ConvolveImage.convolve(DerivativeLaplacian.kernel_I32, img, expected, border);
BoofTesting.assertEqualsInner(expected, deriv, 0, 1, 1, false);
}
use of boofcv.struct.border.ImageBorder_S32 in project BoofCV by lessthanoptimal.
the class TestGradientTwo0 method compareToConvolve_I8.
@Test
void compareToConvolve_I8() throws NoSuchMethodException {
CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
validator.setTarget(GradientTwo0.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
validator.setKernel(0, GradientTwo0.kernelDeriv_I32, true);
validator.setKernel(1, GradientTwo0.kernelDeriv_I32, false);
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 TestGradientTwo0 method compareToConvolve_I16.
@Test
void compareToConvolve_I16() throws NoSuchMethodException {
CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
validator.setTarget(GradientTwo0.class.getMethod("process", GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
validator.setKernel(0, GradientTwo0.kernelDeriv_I32, true);
validator.setKernel(1, GradientTwo0.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 TestHessianThree method compareToConvolve_I8.
// TODO update to handle image border parameter
// @Test
// public void checkInputShape() {
// BoofTesting.checkImageDimensionReshape(new HessianThree(), 3);
// }
@Test
void compareToConvolve_I8() throws NoSuchMethodException {
CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
validator.setTarget(HessianThree.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
validator.setKernel(0, HessianThree.kernelXXYY_I32, true);
validator.setKernel(1, HessianThree.kernelXXYY_I32, false);
validator.setKernel(2, HessianThree.kernelCross_I32);
GrayU8 input = new GrayU8(width, height);
ImageMiscOps.fillUniform(input, rand, 0, 10);
GrayS16 derivXX = new GrayS16(width, height);
GrayS16 derivYY = new GrayS16(width, height);
GrayS16 derivXY = new GrayS16(width, height);
validator.compare(input, derivXX, derivYY, derivXY);
}
Aggregations