Skip to content
MathWorks - Mobile View
  • 登录到您的 MathWorks 帐户登录到您的 MathWorks 帐户
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
MathWorks
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
  • 登录到您的 MathWorks 帐户登录到您的 MathWorks 帐户
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出

视频与网上研讨会

  • MathWorks
  • 视频
  • 视频首页
  • 搜索
  • 视频首页
  • 搜索
  • 联系销售人员
  • 试用软件
3:24 Video length is 3:24.
  • Description
  • Full Transcript
  • Related Resources

Edge Detection with MATLAB

Edge detection is a common image processing technique, and can be used for a variety of applications such as image segmentation, object detection, and Hough line detection. Use edge detection effectively by using the 'edge' function in MATLAB®, and also explore the different available parameters.

Edge detection is an image processing technique for finding the boundaries of objects within images. It works by detecting changes in brightness within an image. Besides creating an interesting-looking image, edge detection can be a great pre-processing step for image segmentation.

If you have the boundary of an object created with edges, you can fill it in to detect an object's location. If you have two objects that are touching each other, you can find the edges and use that information to separate the object. You can also use edges to find objects based on texture, in certain situations where segmenting based on color may not work very well.

So let's take a look at a detailed example of how to use edges as an image pre-processing technique in MATLAB. The goal is to detect all of the windows on the garage door using edges. Let's start by searching the documentation.

I quickly learned there is a function in the image processing tool box called Edge, which performs edge detection on my image. I can simply call Edge, or if I want more control, I can choose the method of edge detection. So let's try a few of these methods out on our image and see how they perform.

I'll start by trying the Prewitt method and then Roberts and then Sobel, and I want to visualize these differences side by side. If I zoom in and look at the differences in these results, I can see subtle variations between these methods, particularly in the corners, that may have an effect of filling in these squares and finding the windows.

Now, I want to fill all of the holes in these images and compare those results. Some of the windows are not filled because of the differences in the edge detection algorithms. But I see that the last algorithm does fill all of the holes, so this will be the method that I choose to solve this particular problem.

Just to finish the algorithm quickly, I want to take my image and remove everything except for the windows. This task is very easy with one of our image processing apps. I used an app called the Image Region Analyzer to filter out objects based on certain properties-- in this case, size and solidity.

And I highly recommend checking out all of our image processing apps within the image processing tool box. Finally, I can show the results of the edge detection. First, showing the original image, and then showing the windows grayed out, proving that we have successfully detected all of the windows in the image.

One final tip-- if you're experimenting with edge detection, and you're not getting the results you expect, there are other parameters that you can change, a popular one being the sensitivity. Using the default sensitivity, we are still missing a lot of the right side of the owl. But I can quickly increase and decrease the sensitivity and visualize those results.

A lower sensitivity gives me all of the edges that I need to move forward. To learn even more about edge detection, click on the links to bring you to more examples and documentation in MATLAB.

Related Products

  • Image Processing Toolbox

Edge
Edge Detection Documentation

Bridging Wireless Communications Design and Testing with MATLAB

Read white paper

Feedback

Featured Product

Image Processing Toolbox

  • Request Trial
  • Get Pricing

Up Next:

30:17
Designing a Digital Camera Pipeline with MATLAB

Related Videos:

39:01
Thermal Analysis with MATLAB and FLIR cameras
48:56
Medical Image Processing with MATLAB
56:56
Brainstorm: Imaging Neural Activity at the Speed of Brain...
46:05
Rapid Development of Image Processing Algorithms with MATLAB

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

  • Switzerland (English)
  • Switzerland (Deutsch)
  • Switzerland (Français)
  • 中国 (简体中文)
  • 中国 (English)

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • 联系销售人员
  • 试用软件

MathWorks

Accelerating the pace of engineering and science

MathWorks 公司是世界领先的为工程师和科学家提供数学计算软件的开发商。

发现…

了解产品

  • MATLAB
  • Simulink
  • 学生版软件
  • 硬件支持
  • File Exchange

试用或购买

  • 下载
  • 试用软件
  • 联系销售
  • 定价和许可
  • 如何购买

如何使用

  • 文档
  • 教程
  • 示例
  • 视频与网上研讨会
  • 培训

获取支持

  • 安装帮助
  • MATLAB Answers
  • 咨询
  • 许可中心
  • 联系支持

关于 MathWorks

  • 招聘
  • 新闻室
  • 社会愿景
  • 客户案例
  • 关于 MathWorks
  • Select a Web Site United States
  • 信任中心
  • 商标
  • 隐私权政策
  • 防盗版
  • 应用状态

京公网安备 11010502045942号京ICP备12052471号

© 1994-2022 The MathWorks, Inc.

  • Weibo
  • WeChat

    WeChat

  • Bilibili
  • Youku
  • LinkedIn
  • RSS

关注我们