卷积概念
常见算子
自定义卷积模糊

卷积概念
  1、卷积是图像处理中一个操作,是kernel在图像的每个像素上的操作。
  2、Kernel本质上一个固定大小的矩阵数组,其中心点称为锚点(anchor point)。

  3、把kernel放到像素数组之上,求锚点周围覆盖的像素乘积之和(包括锚点),用来替换锚点覆盖下像素点值称为卷积处理。

  

常见算子

自定义卷积模糊

filter2D(
  Mat src, // 输入图像
  Mat dst, // 模糊图像
  int depth, // 图像深度32/8
  Mat kernel, // 卷积核/模板
  Point anchor, // 锚点位置
  double delta // 计算出来的像素+delta
)
int main(int argc, char** argv) {
Mat src, dst;
int ksize = ; src = imread(STRPAHT2);
if (!src.data) {
printf("could not load image...\n");
return -;
}
// Sobel X 方向
// Mat kernel_x = (Mat_<int>(3, 3) << -1, 0, 1, -2,0,2, -1, 0, 1);
// filter2D(src, dst, -1, kernel_x, Point(-1, -1), 0.0);
//imshow("Sobel X", dst); // Sobel Y 方向
//Mat kernel_y = (Mat_<int>(3, 3) << -1, -2, -1, 0,0,0, 1,2,1);
//filter2D(src, dst, -1, kernel_y, Point(-1, -1), 0.0);
//imshow("Sobel X", dst); // 拉普拉斯算子
// Mat kernel_y = (Mat_<int>(3, 3) << 0, -1, 0, -1, 4, -1, 0, -1, 0);
// filter2D(src, dst, -1, kernel_y, Point(-1, -1), 0.0);
//imshow("Sobel K_Y", dst); int c = ;
int index = ;
while (true) {
c = waitKey();
if ((char)c == ) {// ESC
break;
}
ksize = + (index % ) * ;
Mat kernel = Mat::ones(Size(ksize, ksize), CV_32F) / (float)(ksize * ksize);
filter2D(src, dst, -, kernel, Point(-, -));
index++;
imshow("OUTPUT_WIN", dst);
} waitKey();
return ;
}

最新文章

  1. CUBRID学习笔记 16 元数据支持
  2. typings的理解
  3. sudo su 提示没有配置JDK environment
  4. tomcat+JNDI+spring 的配置问题
  5. 当前位置: 银光首页 &gt; WPF &gt; WPF学习教程 &gt; WPF: ShowDialog() 切换到其他应用窗口后,再切换回来无法让子窗口总在最上方
  6. Android NDK开发Crash错误定位[转]
  7. Led控件
  8. ArrayList和List主要区别 就是ArrayList类型不安全。
  9. android 模拟器对应键盘快捷键
  10. 微信小程序在开发中遇到的问题与解决方法
  11. Java 学习笔记 IO流与File操作
  12. C# 发送电子邮件源码片段
  13. CSS gradient渐变之webkit核心浏览器下的使用以及实例
  14. C#复杂类型序列化
  15. iOS-构建自己的代码块【提高编码效率-Xcode代码块】
  16. 蓝牙开发&lt;coreBluetooth/CoreBluetooth.h&gt;
  17. iOS 代码片段的添加!
  18. python网络编程-线程队列queue
  19. java 多线程阻塞队列 与 阻塞方法与和非阻塞方法
  20. UNIX网络编程读书笔记:select函数

热门文章

  1. caffe学习三:使用Faster RCNN训练自己的数据
  2. 2019 DevOps 必备面试题——配置管理篇
  3. netty源码解解析(4.0)-22 ByteBuf的I/O
  4. Docker学习之Dockerfile
  5. 关闭vue的eslint代码检测和WebStorm的代码检测
  6. 生产环境轻量级dns服务器dnsmasq搭建文档
  7. java ThreadLocal使用
  8. Creating a Store Locator with PHP, MySQL &amp; Google Maps(保存地图坐标 经纬度方法 google mysql)
  9. CPU的物理数、核心数、线程数
  10. ThinkPHP5 清除runtime缓存文件