滤波效果

原图像
Opencv C++成长之路(九):均值滤波
均值滤波结果
Opencv C++成长之路(九):均值滤波

Show me the code

#include <iostream>
#include <string>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui.hpp>

using namespace std;

int main() {
    // 图像路径
    const string fileName = "xxx.jpg";
    
    // 读取图像
    cv::Mat origin = cv::imread(fileName);
    
    // 创建结果图像变量
    cv::Mat result;
    
    // 均值滤波
    cv::blur(origin, result, cv::Size(20, 20));

    // 对比效果
    cv::imshow("Origin Image", origin);
    cv::imshow("Result", result);
    
    cv::waitKey(0);
}

相关文章:

  • 2021-12-02
  • 2022-02-10
  • 2021-12-02
  • 2021-11-26
  • 2022-02-07
  • 2022-02-07
  • 2021-08-27
猜你喜欢
  • 2021-09-27
  • 2022-02-07
  • 2021-04-16
  • 2021-12-26
  • 2021-10-26
  • 2022-02-10
  • 2021-12-12
相关资源
相似解决方案