Search in sources :

Example 16 with Kernel1D

use of boofcv.struct.convolve.Kernel1D in project BoofCV by lessthanoptimal.

the class TestConvolveImageStandard_SB method vertical.

/**
 * Unit test for vertical convolution.
 */
public void vertical(ImageGray img, ImageGray dest) {
    Kernel1D ker = FactoryKernel.createKernelForImage(kernelWidth, kernelRadius, 1, img.getClass());
    // standard symmetric odd kernel shape
    ker = FactoryKernel.random(ker.getClass(), kernelWidth, kernelRadius, 0, maxKernelValue, rand);
    checkVertical(ker, img, dest);
    // odd non-symmetric kernel shape
    ker = FactoryKernel.random(ker.getClass(), kernelWidth, 0, 0, maxKernelValue, rand);
    checkVertical(ker, img, dest);
    // even non-symmetric kernel shape
    ker = FactoryKernel.random(ker.getClass(), 2, 1, 0, maxKernelValue, rand);
    checkVertical(ker, img, dest);
}
Also used : Kernel1D(boofcv.struct.convolve.Kernel1D)

Example 17 with Kernel1D

use of boofcv.struct.convolve.Kernel1D in project BoofCV by lessthanoptimal.

the class EdgeIntensitiesApp method derivByDerivOfBlur.

public void derivByDerivOfBlur() {
    System.out.println("(Dx*G)*I");
    T blur = GeneralizedImageOps.createSingleBand(imageType, width, height);
    for (int sigma = 1; sigma <= 3; sigma++) {
        Kernel1D g = FactoryKernelGaussian.gaussian1D(GrayF32.class, sigma, -1);
        Kernel1D d = GradientThree.getKernelX(false);
        Kernel1D god = GKernelMath.convolve1D(d, g);
        ConvolveInterface<T, T> f = FactoryConvolve.convolve(god, ImageType.single(imageType), ImageType.single(imageType), BorderType.EXTENDED, true);
        f.process(input, blur);
        printIntensity("Sigma " + sigma, blur);
    }
}
Also used : Kernel1D(boofcv.struct.convolve.Kernel1D)

Aggregations

Kernel1D (boofcv.struct.convolve.Kernel1D)17 Kernel2D (boofcv.struct.convolve.Kernel2D)3 FDistort (boofcv.abst.distort.FDistort)2 GrayF (boofcv.struct.image.GrayF)2 Test (org.junit.Test)2 SteerableKernel (boofcv.alg.filter.kernel.SteerableKernel)1 SteerableKernel_F32 (boofcv.alg.filter.kernel.impl.SteerableKernel_F32)1 SteerableKernel_I32 (boofcv.alg.filter.kernel.impl.SteerableKernel_I32)1 PyramidDiscreteSampleBlur (boofcv.alg.transform.pyramid.PyramidDiscreteSampleBlur)1 KernelBase (boofcv.struct.convolve.KernelBase)1 GrayF32 (boofcv.struct.image.GrayF32)1 ImageGray (boofcv.struct.image.ImageGray)1 BufferedImage (java.awt.image.BufferedImage)1