【问题标题】:Matlab Edge Detection FunctionMatlab边缘检测功能
【发布时间】:2017-03-03 13:12:58
【问题描述】:

我的任务是使用 Matlab 创建自己的边缘检测函数。但不幸的是,我没有图像处理领域的经验,以至于我几乎不知道图像是如何表示的。这方面的知识很少。

我阅读了一些论文和 PDF,但它们侧重于许多主题,我觉得我的任务可能不需要它们。

我很高兴知道您的建议,或者是否有任何为此目的的特定论文、PDF、教程或快速指南。

谢谢

【问题讨论】:

    标签: matlab function edge-detection


    【解决方案1】:

    每个边缘检测算法都使用像 3x3 矩阵这样的内核。正如您在下面看到的,sobel_xsobel_y 被称为 Sobel operator。如果你找到图像和Sobel算子的卷积,你就会找到图像的边缘。

    A=imread('motor.png'); % load image
    A=rgb2gray(A); % convert to grayscale from rgb
    A=im2double(A); % convert to double
    
    sobel_x = [-1 0 1 ;... % define sobel operator of x axis 
               -2 0 2 ;...
               -1 0 1];...
    sobel_y = [1 2 1;... % define sobel operator of y axis
               0 0 0;... 
               -1 -2 -1];
    
    new_img_x=conv2(A,sobel_x); % convolution of image and sobel operator on x axis
    new_img_y=conv2(A,sobel_y); % convolution of image and sobel operator on y axis
    
    new_img=new_img_x+new_img_y; % sum two convolution
    
    imshow(new_img); % show newly processed image
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-17
      • 2012-04-16
      • 2014-10-24
      • 2014-08-02
      • 2015-11-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多