Search in sources :

Example 1 with BorderIndex1D_Extend

use of boofcv.core.image.border.BorderIndex1D_Extend in project BoofCV by lessthanoptimal.

the class FactoryWaveletHaar method generate.

public static <C extends WlCoef> WaveletDescription<C> generate(boolean isInteger, int imageBits) {
    if (isInteger) {
        if (imageBits <= 32) {
            WlCoef_I32 forward = new WlCoef_I32();
            forward.scaling = new int[] { 1, 1 };
            forward.wavelet = new int[] { forward.scaling[0], -forward.scaling[0] };
            forward.denominatorScaling = 1;
            forward.denominatorWavelet = 1;
            WlBorderCoef<WlCoef_I32> inverse = new WlBorderCoefStandard<>(generateInv_I32());
            return new WaveletDescription(new BorderIndex1D_Extend(), forward, inverse);
        }
    } else {
        if (imageBits == 32) {
            WlCoef_F32 forward = new WlCoef_F32();
            forward.scaling = new float[] { (float) (1.0 / Math.sqrt(2)), (float) (1.0 / Math.sqrt(2)) };
            forward.wavelet = new float[] { forward.scaling[0], -forward.scaling[0] };
            WlBorderCoef<WlCoef_F32> inverse = new WlBorderCoefStandard<>(forward);
            return new WaveletDescription(new BorderIndex1D_Extend(), forward, inverse);
        }
    }
    return null;
}
Also used : BorderIndex1D_Extend(boofcv.core.image.border.BorderIndex1D_Extend)

Aggregations

BorderIndex1D_Extend (boofcv.core.image.border.BorderIndex1D_Extend)1