use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.
the class TestDerivativeIntegralImage method kernelHaarX.
@Test
void kernelHaarX() {
GrayF32 orig = new GrayF32(width, height);
GrayF32 integral = new GrayF32(width, height);
ImageMiscOps.fillUniform(orig, rand, 0, 20);
GrayF32 expected = new GrayF32(width, height);
GrayF32 found = new GrayF32(width, height);
IntegralImageOps.transform(orig, integral);
ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorderAlgs.value(orig, 0);
for (int r = 1; r < 5; r++) {
IntegralKernel kernelI = DerivativeIntegralImage.kernelHaarX(r, null);
Kernel2D_F32 kernel = createHaarX(r);
ConvolveImage.convolve(kernel, orig, expected, border);
IntegralImageOps.convolve(integral, kernelI, found);
BoofTesting.assertEquals(expected, found, 1e-2);
}
}
use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.
the class TestDerivativeIntegralImage method kernelDerivYY.
@Test
void kernelDerivYY() {
GrayF32 orig = new GrayF32(width, height);
GrayF32 integral = new GrayF32(width, height);
ImageMiscOps.fillUniform(orig, rand, 0, 20);
GrayF32 expected = new GrayF32(width, height);
GrayF32 found = new GrayF32(width, height);
IntegralImageOps.transform(orig, integral);
ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorderAlgs.value(orig, 0);
for (int i = 1; i <= 5; i += 2) {
int size = i * 3;
IntegralKernel kernelI = DerivativeIntegralImage.kernelDerivYY(size, null);
Kernel2D_F32 kernel = createDerivXX(size);
kernel = KernelMath.transpose(kernel);
ConvolveImage.convolve(kernel, orig, expected, border);
IntegralImageOps.convolve(integral, kernelI, found);
BoofTesting.assertEquals(expected, found, 1e-2);
}
}
use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.
the class TestDerivativeIntegralImage method kernelDerivXY.
@Test
void kernelDerivXY() {
GrayF32 orig = new GrayF32(width, height);
GrayF32 integral = new GrayF32(width, height);
ImageMiscOps.fillUniform(orig, rand, 0, 20);
GrayF32 expected = new GrayF32(width, height);
GrayF32 found = new GrayF32(width, height);
IntegralImageOps.transform(orig, integral);
ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorderAlgs.value(orig, 0);
for (int i = 1; i <= 5; i += 2) {
int size = i * 3;
IntegralKernel kernelI = DerivativeIntegralImage.kernelDerivXY(size, null);
Kernel2D_F32 kernel = createDerivXY(size);
ConvolveImage.convolve(kernel, orig, expected, border);
IntegralImageOps.convolve(integral, kernelI, found);
BoofTesting.assertEquals(expected, found, 1e-2);
}
}
use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.
the class TestDerivativeIntegralImage method kernelDerivY.
@Test
void kernelDerivY() {
GrayF32 orig = new GrayF32(width, height);
GrayF32 integral = new GrayF32(width, height);
ImageMiscOps.fillUniform(orig, rand, 0, 20);
GrayF32 expected = new GrayF32(width, height);
GrayF32 found = new GrayF32(width, height);
IntegralImageOps.transform(orig, integral);
ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorderAlgs.value(orig, 0);
for (int r = 1; r < 5; r++) {
IntegralKernel kernelI = DerivativeIntegralImage.kernelDerivY(r, null);
Kernel2D_F32 kernel = createDerivX(r);
kernel = KernelMath.transpose(kernel);
ConvolveImage.convolve(kernel, orig, expected, border);
IntegralImageOps.convolve(integral, kernelI, found);
BoofTesting.assertEquals(expected, found, 1e-2);
}
}
use of boofcv.struct.border.ImageBorder_F32 in project BoofCV by lessthanoptimal.
the class TestDerivativeIntegralImage method kernelHaarY.
@Test
void kernelHaarY() {
GrayF32 orig = new GrayF32(width, height);
GrayF32 integral = new GrayF32(width, height);
ImageMiscOps.fillUniform(orig, rand, 0, 20);
GrayF32 expected = new GrayF32(width, height);
GrayF32 found = new GrayF32(width, height);
IntegralImageOps.transform(orig, integral);
ImageBorder_F32 border = (ImageBorder_F32) FactoryImageBorderAlgs.value(orig, 0);
for (int i = 1; i < 5; i++) {
int size = i * 2;
IntegralKernel kernelI = DerivativeIntegralImage.kernelHaarY(size, null);
Kernel2D_F32 kernel = createHaarX(size);
kernel = KernelMath.transpose(kernel);
ConvolveImage.convolve(kernel, orig, expected, border);
IntegralImageOps.convolve(integral, kernelI, found);
BoofTesting.assertEquals(expected, found, 1e-2);
}
}
Aggregations