opencv开发笔记(二):图像的模糊

来源:互联网 发布:linux python模块 编辑:程序博客网 时间:2024/06/06 05:20
#include "stdafx.h"
#include<opencv2/highgui/highgui.hpp>
#include<imgproc\imgproc.hpp>
using namespace cv;


int main()
{
Mat src = imread("f://12.jpg");
imshow("原图",src);
Mat dest;
blur(src,dest,Size(7,7));
imshow("效果图",dest);
waitKey(0);
    return 0;

}

均值滤波:其函数声明为:void blur(InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )。
功能:对输入的图像src进行均值滤波后用dst输出。
参数:src和dst当然分别是输入图像和输出图像。size为均值滤波器模板大小。Anchor为锚点(具体什么没看源码不懂),如果为Point(-1,-1),则锚点是滤波器的中心点。borderType为边缘点插值类型。