use of boofcv.struct.convolve.Kernel1D_S32 in project BoofCV by lessthanoptimal.
the class ConvolveImageBox method vertical.
/**
* Performs a vertical 1D convolution of a box kernel across the image
*
* @param input The original image. Not modified.
* @param output Where the resulting image is written to. Modified.
* @param radius Kernel size.
*/
public static void vertical(GrayU8 input, GrayI16 output, int radius, @Nullable GrowArray<DogArray_I32> work) {
InputSanityCheck.checkSameShape(input, output);
Kernel1D_S32 kernel = FactoryKernel.table1D_S32(radius);
ConvolveJustBorder_General_SB.vertical(kernel, ImageBorderValue.wrap(input, 0), output);
if (BoofConcurrency.USE_CONCURRENT) {
ImplConvolveBox_MT.vertical(input, output, radius, work);
} else {
ImplConvolveBox.vertical(input, output, radius, work);
}
}
use of boofcv.struct.convolve.Kernel1D_S32 in project BoofCV by lessthanoptimal.
the class ConvolveImageBox method vertical.
/**
* Performs a vertical 1D convolution of a box kernel across the image
*
* @param input The original image. Not modified.
* @param output Where the resulting image is written to. Modified.
* @param radius Kernel size.
*/
public static void vertical(GrayU8 input, GrayS32 output, int radius, @Nullable GrowArray<DogArray_I32> work) {
InputSanityCheck.checkSameShape(input, output);
Kernel1D_S32 kernel = FactoryKernel.table1D_S32(radius);
ConvolveJustBorder_General_SB.vertical(kernel, ImageBorderValue.wrap(input, 0), output);
if (BoofConcurrency.USE_CONCURRENT) {
ImplConvolveBox_MT.vertical(input, output, radius, work);
} else {
ImplConvolveBox.vertical(input, output, radius, work);
}
}
use of boofcv.struct.convolve.Kernel1D_S32 in project BoofCV by lessthanoptimal.
the class ConvolveImageBox method horizontal.
/**
* Performs a horizontal 1D convolution of a box kernel across the image
*
* @param input The original image. Not modified.
* @param output Where the resulting image is written to. Modified.
* @param radius Kernel size.
*/
public static void horizontal(GrayU8 input, GrayI16 output, int radius) {
InputSanityCheck.checkSameShape(input, output);
Kernel1D_S32 kernel = FactoryKernel.table1D_S32(radius);
ConvolveJustBorder_General_SB.horizontal(kernel, ImageBorderValue.wrap(input, 0), output);
if (BoofConcurrency.USE_CONCURRENT) {
ImplConvolveBox_MT.horizontal(input, output, radius);
} else {
ImplConvolveBox.horizontal(input, output, radius);
}
}
use of boofcv.struct.convolve.Kernel1D_S32 in project BoofCV by lessthanoptimal.
the class TestConvolveNormalizedNaive_IL method horizontal.
/**
* Check it against one specific type to see if the core algorithm is correct
*/
@Test
void horizontal() {
Kernel1D_S32 kernel = new Kernel1D_S32(new int[] { 1, 2, 3, 4, 5, 6 }, 6, 4);
InterleavedU8 input = new InterleavedU8(width, height, numBands);
ImageMiscOps.fillUniform(input, rand, 0, 50);
InterleavedU8 output = new InterleavedU8(width, height, numBands);
ConvolveNormalizedNaive_IL.horizontal(kernel, input, output);
for (int y = 0; y < output.height; y++) {
for (int x = 0; x < output.width; x++) {
for (int band = 0; band < numBands; band++) {
int expected = horizontal(x, y, band, kernel, input);
int found = output.getBand(x, y, band);
assertEquals(expected, found);
}
}
}
}
use of boofcv.struct.convolve.Kernel1D_S32 in project BoofCV by lessthanoptimal.
the class ConvolveImageMean method horizontal.
/**
* Performs a horizontal 1D convolution which computes the mean value of elements
* inside the kernel.
*
* @param input The original image. Not modified.
* @param output Where the resulting image is written to. Modified.
* @param radius Kernel size.
*/
public static void horizontal(GrayU8 input, GrayU8 output, int radius) {
boolean processed = BOverrideConvolveImageMean.invokeNativeHorizontal(input, output, radius);
if (!processed) {
Kernel1D_S32 kernel = FactoryKernel.table1D_I32(radius);
if (kernel.width > input.width) {
ConvolveImageNormalized.horizontal(kernel, input, output);
} else {
InputSanityCheck.checkSameShape(input, output);
ConvolveNormalized_JustBorder_SB.horizontal(kernel, input, output);
ImplConvolveMean.horizontal(input, output, radius);
}
}
}
Aggregations