fastNlMeansDenoising () filtert kein Rauschen heraus

Ich versuche, Rauschen mit der opencv-Funktion fastNlMeansDenoising () zu entfernen. Mein Ausgabebild ist jedoch dasselbe wie das Originalbild mit Rauschen.

Eingabebild:

Code

#include <iostream>

#include <opencv2/opencv.hpp>

#include <opencv2/highgui/highgui.hpp>

#include <opencv2/imgproc/imgproc.hpp>

using namespace std;

using namespace cv;


int main() {

    Mat img = imread("noisy.jpg");

    if (!img.data) {
        cout << "File not found" << endl;
        return -1;
    }

    // first copy the image
    Mat img_gray = img.clone();
    cvtColor(img, img_gray, CV_RGB2GRAY);

    Mat img1;
    //fastNlMeansDenoising(img_gray, img1, 3.0, 7, 21);
    cv::fastNlMeansDenoising(img_gray, img1, 3.0, 7, 21);

    imshow("img1", img1);

    waitKey();

    return 0;
}

Ausgabe Bild:

Ich kann keinen Effekt der Glättung sehen. Ich verstehe den Grund dafür nicht. Bitte helfen Sie mir, diese Funktion zum Entfernen von Rauschen zu verwenden. Vielen Dan

Antworten auf die Frage(2)

Ihre Antwort auf die Frage