在我的情况下,我想要去除图像中的所有黑点。我的图像如下所示。当我使用程序时,图像变得平滑了,但是程序没有删除黑点。请帮助我删除黑点。请尽快回复。
原始图像
以下是代码。
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
}