当前位置: 首页 > article >正文

我谈Sobel算子与高斯一阶微分的关系

现在算力提升了,最常用的一阶差分边缘检测算子已经不是Sobel算子了,而是高斯一阶微分。

高斯一阶微分

顾名思义,高斯函数的一阶导数。
在这里插入图片描述

Derivative of Gaussian 1D

一维直接扩展到二维。

在这里插入图片描述
禹晶、肖创柏、廖庆敏《数字图像处理(面向新工科的电工电子信息基础课程系列教材)》P238
在这里插入图片描述
MATLAB中的实现。

    t = (-width:width);
    gau = exp(-(t.*t)/(2*ssq))/(2*pi*ssq);     % the gaussian 1D filter

    % Find the directional derivative of 2D Gaussian (along X-axis)
    % Since the result is symmetric along X, we can get the derivative along
    % Y-axis simply by transposing the result for X direction.
    [x,y]=meshgrid(-width:width,-width:width);
    dgau2D=-x.*exp(-(x.*x+y.*y)/(2*ssq))/(pi*ssq);

    % Convolve the filters with the image in each direction
    % The canny edge detector first requires convolution with
    % 2D Gaussian, and then with the derivative of a Gaussian.
    % Since Gaussian filter is separable, for smoothing, we can use
    % two 1D convolutions in order to achieve the effect of convolving
    % with 2D Gaussian.  We convolve along rows and then columns.

    %smooth the image out
    aSmooth=imfilter(a,gau,'conv','replicate');   % run the filter across rows
    aSmooth=imfilter(aSmooth,gau','conv','replicate'); % and then across columns

    %apply directional derivatives
    ax = imfilter(aSmooth, dgau2D, 'conv','replicate');
    ay = imfilter(aSmooth, dgau2D', 'conv','replicate');

    mag = sqrt((ax.*ax) + (ay.*ay));
    magmax = max(mag(:));
    if magmax>0
        mag = mag / magmax;   % normalize
    end

Sobel

在这里插入图片描述
Sobel算子可以分解为一步高斯平滑和一步中心差分。所以,它可以看做高斯一阶微分的整数近似形式。

Sobel算子的数学推导是四个方向的相加,模板推导出来后,我们可以从上面的角度解释。


http://www.kler.cn/news/353848.html

相关文章:

  • 深入解析TensorFlow——从基础到进阶
  • 【C语言】结构体应用:统计成绩最低分
  • Linux MISC 驱动实验
  • Vue检测获取最新资源 解决浏览器缓存问题
  • CloseableHttpResponse 类(代表一个可关闭的 HTTP 响应)
  • 现在做一个产品级别的物联网智能应用,能链接wifi可以和chatgpt交互,做到实时语音交互的能力
  • Docker 的使用-01
  • 9.存储过程安全性博客大纲(9/10)
  • 双指针 — 复写零
  • tensorflow入门案例手写数字识别人工智能界的helloworld项目落地1
  • Spring 依赖注入(Dependency Injection)
  • Chrome(谷歌)浏览器 数据JSON格式美化 2024显示插件安装和使用
  • 3.3 Thymeleaf语法
  • 深入理解Qt中的QTableView、Model与Delegate机制
  • C++——vector的了解与使用
  • 易我数据恢复软件怎么样?2024四大数据恢复工具推荐!
  • 知识图谱融入向量数据库,带来RAG效果飞升
  • Java重修笔记 InetAddress 类和 Socket 类
  • 数据结构——排序(归并排序)
  • 给定任意非空有向图 G,输出 G 中所有 K 顶点的算法,并返回 K 顶点的个数。