Main Content

Edge Detection

使用SOBEL,PREWITT,ROBERTS或CANNY方法在图像中查找对象的边缘

  • 图书馆:
  • 计算机视觉工具箱/ Analysis & Enhancement

  • 边缘检测块

Description

边缘检测块在输入图像中找到对象的边缘。该块支持四种方法:S万博1manbetxobel,PreWitt,Roberts和Canny。前三种方法通过近似图像的梯度幅度找到边缘。该块分别将输入矩阵与Sobel,PreWitt或Roberts内核进行卷积,并输出图像的产生梯度组件。此外,该块通过阈值梯度幅度输出边缘检测的二进制图像。

The Canny method computes the gradient of input image using the derivative of the Gaussian filter. It then finds edges by looking for the local maxima of the gradient. This method uses two thresholds to detect the strong and weak edges. The weak edges are part of the output only if they are connected to strong edges. The block outputs a binary image of the edge detections for this method.

Ports

一世nput

展开全部

一世nput image, specified as a matrix of intensity values.

数据类型:单身的||int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|fixed point

笔记

The Canny method does not support 8-bit, 16-bit, or 32-bit signed fixed-point integers or 8-bit, 16-bit, or 32-bit unsigned integers.

Specify a threshold as a scalar or a two-element vector to detect edges from the gradient. The data type of this value must match the input image data type. For the Canny edge detection method, the threshold must be a two-element vector in the range [0 1]. For the other methods, the threshold is a scalar.

依赖性

启用此端口:

  • 设置方法参数为Canny。Alternatively, set the方法参数为索贝尔,,,,Prewitt, 或者Roberts,还设置输出类型参数为二进制图像or二进制图像and gradient components

  • Select the用户定义的阈值

  • 设置阈值源参数为输入端口

数据类型:单身的||int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|fixed point

笔记

The Canny method does not support 8-bit, 16-bit, or 32-bit signed fixed-point integers or 8-bit, 16-bit, or 32-bit unsigned integers.

输出

展开全部

Edge detections, returned as a binary image. The pixels with the value of1表示边缘像素。

依赖性

当您设置该端口方法参数为Canny。To enable this port for the索贝尔,,,,Prewitt, 或者Roberts方法,设置输出类型参数为二进制图像or二进制图像and gradient components

数据类型:布尔

梯度响应对垂直边缘的矩阵。

依赖性

To enable this port, set these parameters:

  • 方法-索贝尔orPrewitt

  • 输出类型-梯度组件or二进制图像and gradient components

数据类型:单身的||int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|fixed point

Matrix of gradient responses to the horizontal edges.

依赖性

To enable this port, set these parameters:

  • 方法-索贝尔orPrewitt

  • 输出类型-梯度组件or二进制图像and gradient components

数据类型:单身的||int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|fixed point

梯度对边缘的梯度响应在45度下。

依赖性

To enable this port, set these parameters:

  • 方法-Roberts

  • 输出类型-梯度组件or二进制图像and gradient components

数据类型:单身的||int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|fixed point

Matrix of gradient responses to edges at 135 degrees.

依赖性

To enable this port, set these parameters:

  • 方法-Roberts

  • 输出类型-梯度组件or二进制图像and gradient components

数据类型:单身的||int8|int16|int32|INT64|UINT8|uint16|UINT32|Uint64|fixed point

参数

展开全部

Main

指定一种检测输入图像中边缘的方法。您可以选择索贝尔,,,,Prewitt,,,,RobertsorCanny

从以下一个选项中指定输出图像的类型:

  • 二进制图像- 块在Edge港口。标记的矩阵的元素1表示边缘像素。

  • 梯度组件- 块输出梯度组件。为了索贝尔andPrewitt方法,梯度组件对应于水平和垂直边缘响应GHandGV端口分别。为了Roberts方法梯度成分对应于45度和135度边缘响应G45andG135端口分别。

  • 二进制图像and gradient components-The block outputs both the binary image and the gradient components of the image

依赖性

To enable this parameter, set the方法参数为索贝尔,,,,Prewitt, 或者Roberts

通过对话框或Th港口。

依赖性

This parameter is always enabled when you set the方法参数为Canny。为了启用此参数索贝尔,,,,Prewitt, 或者Roberts方法,设置输出类型参数为二进制图像or二进制图像and gradient components

选择从以下选项之一输入阈值的源:

  • 输入端口- 使用Th港口。此值的数据类型必须匹配输入图像数据类型。

  • 通过对话框指定-Enter the desired threshold value in the dialog box.

依赖性

To enable this parameter:

  • 设置方法参数为Canny。或者设置方法参数为索贝尔,,,,Prewitt, 或者Roberts,还设置输出类型参数为二进制图像or二进制图像and gradient components

  • Select the用户定义的阈值

指定输入数据范围内的阈值值。该阈值适用于Sobel,PreWitt和Roberts Edge检测方法。

依赖性

要启用此参数,请设置以下块参数:

  • 方法-索贝尔,,,,Prewitt, 或者Roberts

  • 输出类型-二进制图像or二进制图像and gradient components

  • 用户定义的阈值-On

  • 阈值源-通过对话框指定

将Canny边缘检测的阈值指定为[0 1]中的两元素向量。向量的元素分别指定弱边缘和强边的低阈值和高阈值。

依赖性

要启用此参数,请设置以下块参数:

  • 方法-Canny

  • 用户定义的阈值-On

  • 阈值源-通过对话框指定

Specify the threshold scale factor to automatically calculate threshold value. The block computes the automatic threshold using the mean of the gradient magnitude squared image and multiplies the value of this parameter with the automatic threshold value to determine a new threshold value.

依赖性

要启用此参数,请设置以下块参数:

  • 方法-索贝尔,,,,Prewitt, 或者Roberts

  • 输出类型-二进制图像or二进制图像and gradient components

  • 用户定义的阈值-Off

Select this parameter to reduce the thickness of the edges in your output images. This option requires additional processing time and memory resources.

提示

This block is most efficient in terms of memory usage and processing time when you clear the边缘变薄复选框并使用临界点参数以指定阈值。

依赖性

要启用此参数,请设置以下块参数:

  • 方法-索贝尔,,,,Prewitt, 或者Roberts

  • 输出类型-二进制图像or二进制图像and gradient components

指定弱边缘和非边缘图像像素的大约百分比。该块使用此值计算自动阈值。

依赖性

要启用此参数,请设置以下块参数:

  • 方法-Canny

  • 用户定义的阈值-Off

指定用于精美边缘检测算法的高斯滤波器的标准偏差。

依赖性

To enable this parameter, set the方法参数为Canny

数据类型

有关固定点块参数的信息,请参阅指定块的定点属性

Block Characteristics

数据类型

|fixed point|integer|单身的

多维信号

no

可变大小信号

是的

References

[1] Gonzales, Rafael C. and Richard E. Woods.数字图像处理。第二版。新泽西州Englewood Cliffs:Prentice Hall,2002年。

[2] Pratt,William K.数字图像处理,第二版。NY: John Wiley & Sons, 1991.

扩展功能

C/C++ Code Generation
使用Simulink®Coder™生成C和C ++代码。万博1manbetx

版本历史记录

一世ntroduced before R2006a

也可以看看

|