首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Matlab边缘检测函数

Matlab边缘检测函数
EN

Stack Overflow用户
提问于 2016-11-28 00:42:08
回答 1查看 1.1K关注 0票数 0

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

我读过一些论文和PDF,但它们集中在很多我觉得我可能不需要它们来完成任务的话题上。

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

谢谢

EN

回答 1

Stack Overflow用户

发布于 2016-11-28 07:22:07

每种边缘检测算法都使用像3x3矩阵这样的核。如下所示,sobel_xsobel_y称为Sobel算子。如果你找到图像的卷积和算子,你就会找到图像的边缘。

代码语言:javascript
复制
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
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40835624

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档