中文说明:使用 MATLAB 构造函数 Filter_1,实现对一张灰度图像的边缘检测操作。要求 Filter_1 的输入包括三个变量:I、Operator、Option。其中 I 为待处理的灰度图像,Operator 包含两个选项:Kirsch 算子和 Sobel 算子,他们的定义如图 1 所示。Option 包含两个选项:取最大和取和,这一操作仅对 sobel 算子有效,代表着算子不同方向分量滤波后的结果是取最大值还是直接求和,即max( , ) f f 。而根据 Kirsch 算子的定义,在八个方向的分量分别滤波后应该是取最大值,即Filter_1 的输出为一幅经过边缘检测后的边缘强度图像(注意输出结果应该是一张灰度图像,不应该直接输出边界的二值图)。
English Description:
Using MATLAB constructor filter_ 1. Realize the edge detection of a gray image. Filter required_ The input of 1 includes three variables: I, operator and option. Where I is the gray image to be processed, and the operator includes two options: Kirsch operator and Sobel operator. Their definitions are shown in Figure 1. Option contains two options: take the maximum sum and take the sum. This operation is only valid for Sobel operator, which means whether the filtering results of different direction components of the operator take the maximum or directly sum, that is, max (,) f . According to the definition of Kirsch operator, after filtering the components in eight directions, it should take the maximum value, namely filter_ 1 is an edge intensity image after edge detection (note that the output result should be a gray image, not a binary image of the boundary).