
image.png
#include <opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv) {
Mat src = imread("D:/HUANGHAI_WORK/tools/opencv4/opencv/sources/samples/data/home.jpg");
namedWindow("input", WINDOW_AUTOSIZE);
imshow("input", src);
Mat dst;
//Size值必须是奇数 size是0的时候,最后一个参数生效
GaussianBlur(src, dst, Size(55, 55), 0);
imshow("gaussian", dst);
//盒子模糊(均值模糊)
Mat box_dst;
boxFilter(src, box_dst, -1, Size(5, 5), Point(-1, -1), true, BORDER_DEFAULT);
imshow("box_dst", box_dst);
waitKey(0);
destroyAllWindows();
return 0;
}

image.png

image.png

image.png

image.png
网友评论