title: How to denoise an image using java opencv
body: <p>In my case I want to remove the all black dots of my image. here my image can be presented as follows. when i was doing using my program the image was smoothing how ever the program doesn't remove the black dots. please help me to remove black dots.please reply me soon
  <a href="http://i.stack.imgur.com/ybD8q.jpg" rel="nofollow">Original Image</a>
   the codes are as follows.</p>
  
  <pre><code>public class Denoise {
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          try{
              System.loadLibrary( Core.NATIVE_LIBRARY_NAME );
           Mat source =Imgcodecs.imread("C:\\Users\\My Kindom\\Downloads\\printscreen.JPG",Imgcodecs.CV_LOAD_IMAGE_COLOR);
  
           Mat destination = new Mat(source.rows(),source.cols(),source.type());
           destination = source;
           Photo.fastNlMeansDenoisingColored(source,destination, 10, 10, 7, 21);
           Imgcodecs.imwrite("C:\\Users\\My Kindom\\Downloads\\Denoise.jpg", destination);
  
          }catch(Exception e){}
          // TODO code application logic here
      }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/T7pny.jpg" rel="nofollow">Destination Image</a></p>