//本程序驗證圖像模糊
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
using namespace std;
int main()
{
Mat rawImg = imread("D:/fodder/3.jpg");
Mat imgBlur;
if(!rawImg.data)
{
cout << "";
return -1;
}
namedWindow("原始圖像");
imshow("原始圖像", rawImg);
blur(rawImg, imgBlur, Size(9,9));
namedWindow("模糊圖像");
imshow("模糊圖像", imgBlur);
waitKey(0);
destroyAllWindows();
return 0;
}
原圖像:
模糊後的結果: