#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
int main(int argc, char** argv) {
Mat src, dst;
src = imread("C:/daima practice/opencv/mat2/mat2/111.jpg");
if (!src.data) {
printf("could not load image...\n");
return -1;
}
namedWindow("input image", CV_WINDOW_AUTOSIZE);
imshow("input image", src);
//medianBlur(src, dst, 3);//中值滤波
bilateralFilter(src, dst, 15, 100, 5);//双边滤波
namedWindow("BiBlur Filter Result", CV_WINDOW_AUTOSIZE);
imshow("BiBlur Filter Result", dst);
Mat resultImg;
Mat kernel = (Mat_<int>(3, 3) << 0, -1, 0, -1, 5, -1, 0, -1, 0);
filter2D(dst, resultImg, -1, kernel, Point(-1, -1), 0);
imshow("Final Result", resultImg);
waitKey(0);
return 0;
}
【图像处理】10模糊图像1(中值滤波,双边滤波)
猜你喜欢
转载自blog.csdn.net/fanjiule/article/details/81230801
今日推荐
周排行