opencv基础-均值滤波blur
函数原型
void blur( InputArray src, OutputArray dst,
Size ksize, Point anchor=Point(-1,-1),
int borderType=BORDER_DEFAULT );
原理:
平滑也叫做模糊,是一项简单且使用频率比较高的图像处理方法。
平滑有很多用途,比如去噪
平滑处理需要用到一个滤波器。
均值滤波的基本原理是用均值代替原图像中的各个像素值,选择一个模板size,求该size中所有像素的均值,再把该均值赋予当前像素点。
cv::Ptr<cv::FilterEngine> cv::createBoxFilter( int srcType, int dstType, Size ksize,
Point anchor, bool normalize, int borderType )
{
int sdepth = CV_MAT_DEPTH(srcType);
int cn = CV_MAT_CN(srcType), sumType = CV_64F;
if( sdepth == CV_8U && CV_MAT_DEPTH(dstType) == CV_8U &&
ksize.width*ksize.height <= 256 )
sumType = CV_16U;
else if( sdepth <= CV_32S &am