#include"cv.h"#include"highgui.h"#include<iostream>using namespacestd;using namespaceCV;intMainintargcChar*argv[]) {Mat src= Imread ("misaka.jpg"); Mat DST; //the parameters are written sequentially//Gaussian filter//src: Input image//DST: Output image//size (5,5) template sizes, odd//x-Directional Variance//y-Directional VarianceGaussianblur (Src,dst,size (5,5),0,0); Imwrite ("gauss.jpg", DST); //Median filter//src: Input image//DST:: Output image//template width, oddMedianblur (SRC,DST,3); Imwrite ("med.jpg", DST); //mean value filter//src: Input image//DST: Output image//Template Size//Point ( -1,-1): The location of the smoothed points, the center of the core for negative valuesBlur (Src,dst,size (3,3), point (-1,-1)); Imwrite ("mean.jpg", DST); //Bilateral filtering//src: Input image//DST: Entering images//Filter Template Radius//color space Standard deviation//standard deviation of coordinate spaceBilateralfilter (SRC,DST,5,10.0,2.0);//There is no effect of filtering here, do not understandImwrite ("bil.jpg", DST); Waitkey (); return 0;}
OpenCV Gauss, median, mean, bilateral filter