版权声明:——转载请留言询问—— https://blog.csdn.net/weixin_44344462/article/details/88742738
高斯滤波结果
原图像
高斯滤波结果
Show me the code
#include <iostream>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <string>
#include <cmath>
using namespace std;
int main() {
// 图像路径
const string fileName = "xxx.jpg";
// 读入图片
cv::Mat origin = cv::imread(fileName);
// 创建结果存放位置
cv::Mat result;
// 设置滤波sigma
const float sigma = 5;
// 高斯滤波
cv::GaussianBlur(origin,
result,
cv::Size(0, 0),
sigma);
// 显示原图
cv::imshow("Origin Image", origin);
// 显示高斯滤波后的图像
cv::imshow("Result", result);
cv::waitKey(0);
}