Search in sources :

Example 1 with BlurStorageFilter

use of boofcv.abst.filter.blur.BlurStorageFilter in project BoofCV by lessthanoptimal.

the class PyramidFloatGaussianScale method process.

@Override
public void process(T input) {
    super.initialize(input.width, input.height);
    if (isSaveOriginalReference())
        throw new IllegalArgumentException("The original reference cannot be saved");
    if (tempImage == null) {
        tempImage = (T) input.createNew(input.width, input.height);
    }
    for (int i = 0; i < scale.length; i++) {
        T prev = i == 0 ? input : getLayer(i - 1);
        T layer = getLayer(i);
        // Apply the requested blur to the previous layer
        BlurStorageFilter<T> blur = (BlurStorageFilter<T>) FactoryBlurFilter.gaussian(layer.getImageType(), sigmaLayers[i], -1);
        tempImage.reshape(prev.width, prev.height);
        blur.process(prev, tempImage);
        // Resample the blurred image
        if (scale[i] == 1) {
            layer.setTo(tempImage);
        } else {
            PixelTransformAffine_F32 model = DistortSupport.transformScale(layer, tempImage, null);
            DistortImageOps.distortSingle(tempImage, layer, true, model, interpolate);
        }
    }
}
Also used : PixelTransformAffine_F32(boofcv.alg.distort.PixelTransformAffine_F32) BlurStorageFilter(boofcv.abst.filter.blur.BlurStorageFilter)

Aggregations

BlurStorageFilter (boofcv.abst.filter.blur.BlurStorageFilter)1 PixelTransformAffine_F32 (boofcv.alg.distort.PixelTransformAffine_F32)1