OpenCV C++基于模糊数学的图像滤波

这个程序使用OpenCV fuzzy模块进行图像滤波。

输入图片:

这是滤波器半径为3时生成的结果:

这是滤波器半径为100时生成的结果:

代码:

cpp 复制代码
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/fuzzy.hpp"

using namespace std;
using namespace cv;

int main(void)
{
    Mat I = imread("input.png");

    Mat kernel1, kernel2;

    ft::createKernel(ft::LINEAR, 3, kernel1, 3);
    ft::createKernel(ft::LINEAR, 100, kernel2, 3);

    Mat output1, output2;

    ft::filter(I, kernel1, output1);
    ft::filter(I, kernel2, output2);

    imwrite("output1_filter.png", output1);
    imwrite("output2_filter.png", output2);

    return 0;
}
相关推荐
Henry-SAP24 分钟前
SAP引领ERP智能化转型
人工智能·云原生·sap·erp
峥嵘life34 分钟前
Android16 311Y3 EAP-TLS 网络连接失败分析与修复总结
android·开发语言·人工智能·php
ShineWinsu36 分钟前
对于C++:IO流状态的详细解析
c++·面试·io·cin·io流状态·goodbit·failbit
特立独行的猫a1 小时前
一切皆插件:DeepSeek Harness 的架构哲学,以及与主流 Agent 的对比
人工智能·架构·agent·deepseek·harness
电商API_180079052471 小时前
京东商品详情API技术文章
大数据·运维·人工智能·网络爬虫
fīɡЙtīиɡ ℡1 小时前
AI Agent 记忆系统
人工智能
Lzg_na2 小时前
constexpr的优势
c++
企鹅的企2 小时前
2027北京AI数字健康与智慧医疗展官方:超两成展品亚洲首秀
人工智能·科技·机器人
lvts_cs2 小时前
淄博高新区绿天使数智创新港:高标准产研厂房全维度详解
大数据·人工智能