Ask Your Question
0

java code for smoothing image using openCV library functions

asked Feb 12 '13

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

i found many C++ codes in net but couldnt get java code...we are trying to implement all the basic operations on an image using openCV library using java language.

Preview: (hide)

2 answers

Sort by » oldest newest most voted
0

answered Feb 12 '13

Java API for OpenCV is here. Personally, I found the C/C++/Python doc more readable, but maybe just because I'm not familiar with javadoc style... Nevertheless, you can look at C/C++/Python explanations of the functions, and found in javadoc how to use it.

Preview: (hide)
0

answered Jan 22 '14

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

Preview: (hide)

Question Tools

Stats

Asked: Feb 12 '13

Seen: 5,335 times

Last updated: Jan 21 '14