Search in sources :

Example 1 with WlBorderCoefStandard

use of boofcv.struct.wavelet.WlBorderCoefStandard in project BoofCV by lessthanoptimal.

the class FactoryWaveletCoiflet method generate_F32.

/**
 * Creates a description of a Coiflet of order I wavelet.
 * @param I order of the wavelet.
 * @return Wavelet description.
 */
public static WaveletDescription<WlCoef_F32> generate_F32(int I) {
    if (I != 6) {
        throw new IllegalArgumentException("Only 6 is currently supported");
    }
    WlCoef_F32 coef = new WlCoef_F32();
    coef.offsetScaling = -2;
    coef.offsetWavelet = -2;
    coef.scaling = new float[6];
    coef.wavelet = new float[6];
    double sqrt7 = Math.sqrt(7);
    double div = 16.0 * Math.sqrt(2);
    coef.scaling[0] = (float) ((1.0 - sqrt7) / div);
    coef.scaling[1] = (float) ((5.0 + sqrt7) / div);
    coef.scaling[2] = (float) ((14.0 + 2.0 * sqrt7) / div);
    coef.scaling[3] = (float) ((14.0 - 2.0 * sqrt7) / div);
    coef.scaling[4] = (float) ((1.0 - sqrt7) / div);
    coef.scaling[5] = (float) ((-3.0 + sqrt7) / div);
    coef.wavelet[0] = coef.scaling[5];
    coef.wavelet[1] = -coef.scaling[4];
    coef.wavelet[2] = coef.scaling[3];
    coef.wavelet[3] = -coef.scaling[2];
    coef.wavelet[4] = coef.scaling[1];
    coef.wavelet[5] = -coef.scaling[0];
    WlBorderCoefStandard<WlCoef_F32> inverse = new WlBorderCoefStandard<>(coef);
    return new WaveletDescription<>(new BorderIndex1D_Wrap(), coef, inverse);
}
Also used : BorderIndex1D_Wrap(boofcv.core.image.border.BorderIndex1D_Wrap) WlCoef_F32(boofcv.struct.wavelet.WlCoef_F32) WaveletDescription(boofcv.struct.wavelet.WaveletDescription) WlBorderCoefStandard(boofcv.struct.wavelet.WlBorderCoefStandard)

Aggregations

BorderIndex1D_Wrap (boofcv.core.image.border.BorderIndex1D_Wrap)1 WaveletDescription (boofcv.struct.wavelet.WaveletDescription)1 WlBorderCoefStandard (boofcv.struct.wavelet.WlBorderCoefStandard)1 WlCoef_F32 (boofcv.struct.wavelet.WlCoef_F32)1