opencv第三個項目---均值濾波

// opencv3_blur.cpp : 此文件包含 "main" 函數。程序執行將在此處開始並結束。
//

#include <iostream>
#include <opencv2/opencv.hpp>

using namespace cv;
using namespace std;

//debug下在lib文件的名稱後加d,release下不加d。


int main()
{
	Mat img = imread("../res/test.jpg");

	if (img.data == NULL)
	{
		std::cout << "image read is null" << std::endl;
		return -10;
	}


	/*namedWindow("【原圖】", WINDOW_AUTOSIZE);*/
	imshow("【原圖】", img);

	//均值濾波,模糊圖像
	Mat dstimg;
	blur(img, dstimg, Size(10, 10));	

	imshow("【均值濾波效果圖】", dstimg);

	waitKey(0);
	return 0;
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章