Ask Your Question
0

java code for smoothing image using openCV library functions

asked 2013-02-12 10:22:58 -0500

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.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-02-12 10:46:56 -0500

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.

edit flag offensive delete link more
0

answered 2014-01-21 23:18:58 -0500

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

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-02-12 10:22:58 -0500

Seen: 4,650 times

Last updated: Jan 21 '14