Search in sources :

Example 1 with GrayF

use of boofcv.struct.image.GrayF in project BoofCV by lessthanoptimal.

the class TestImageLocalNormalization method zeroMeanStdOne_kernel.

@Test
public void zeroMeanStdOne_kernel() {
    for (Class type : types) {
        int bits = type == GrayF32.class ? 32 : 64;
        Kernel1D kernel = FactoryKernelGaussian.gaussian(1, true, bits, -1, radius);
        GrayF input = (GrayF) GeneralizedImageOps.createSingleBand(type, width, height);
        GrayF found = (GrayF) GeneralizedImageOps.createSingleBand(type, width, height);
        GImageMiscOps.fillUniform(input, rand, 0, maxPixelValue);
        ImageLocalNormalization alg = new ImageLocalNormalization(type, BorderType.NORMALIZED);
        alg.zeroMeanStdOne(kernel, input, maxPixelValue, delta, found);
        compareToExpected(input, kernel, found);
    }
}
Also used : GrayF32(boofcv.struct.image.GrayF32) Kernel1D(boofcv.struct.convolve.Kernel1D) GrayF(boofcv.struct.image.GrayF) Test(org.junit.Test)

Example 2 with GrayF

use of boofcv.struct.image.GrayF in project BoofCV by lessthanoptimal.

the class TestImageLocalNormalization method zeroMeanStdOne.

@Test
public void zeroMeanStdOne() {
    Kernel1D kernel = FactoryKernel.table1D_F64(radius, false);
    for (Class type : types) {
        GrayF input = (GrayF) GeneralizedImageOps.createSingleBand(type, width, height);
        GrayF found = (GrayF) GeneralizedImageOps.createSingleBand(type, width, height);
        GImageMiscOps.fillUniform(input, rand, 0, maxPixelValue);
        ImageLocalNormalization alg = new ImageLocalNormalization(type, BorderType.NORMALIZED);
        alg.zeroMeanStdOne(radius, input, maxPixelValue, delta, found);
        compareToExpected(input, kernel, found);
    }
}
Also used : Kernel1D(boofcv.struct.convolve.Kernel1D) GrayF(boofcv.struct.image.GrayF) Test(org.junit.Test)

Aggregations

Kernel1D (boofcv.struct.convolve.Kernel1D)2 GrayF (boofcv.struct.image.GrayF)2 Test (org.junit.Test)2 GrayF32 (boofcv.struct.image.GrayF32)1