Ask Your Question

Revision history [back]

Hi,

you could use something as simple as:

public Mat blur(Mat input, int numberOfTimes){
        Mat sourceImage = new Mat();
        Mat destImage = input.clone();
        for(int i=0;i<numberOfTimes;i++){
            sourceImage = destImage.clone();
            Imgproc.blur(sourceImage, destImage, new Size(3.0, 3.0));
        }
        return destImage;
    }

which blurs an image using the normalized box filter, using a 3x3 grid around each pixel on the image. This method also let's you define the number of times you want to smooth it.

Kind regards, Daniel