## Introduction

Edge detection plays an important role in various areas of image analysis and computer vision. Gradient-threshold-based edge detectors are widely used, such as Sobel, Prewitt, and Canny detectors.^{1}
^{2} Usually, a global threshold for edge labeling is used in gradient-threshold edge detection. Although improvement has been achieved by the local threshold technique,^{3} the characteristics of the human visual system (HVS) are not well considered in existing gradient-threshold edge detectors.

This paper proposes an improved method based on HVS that is suitable for gradient-threshold edge detectors. Taking HVS characteristics into account, we mask the gradient image with luminance and activity before edge labeling. The edges detected by this method are much more consistent with the perceptive edges than those by traditional methods.

## Improved Method

Like other gradient edge detectors, the proposed algorithm smoothes and differentiates the image to get the gradient image grad(x,y) first. Then the gradient image is masked with local luminance and local activity. The masked gradient image is used for labeling edges finally. Because HVS is extremely complex and has not been cognized clearly,^{4} most attention is focused on the basic HVS characteristics of luminance masking and activity masking in this paper. For example, let the gradient at (x^{*},y^{*}) be grad(x^{*},y^{*}). Then grad(x^{*},y^{*}) will be masked as follows.

First, if the absolute value of grad(x^{*},y^{*}) is smaller than a given threshold *T*, the final masked gradient grad_{m}(x^{*},y^{*}) is set to zero and (x^{*},y^{*}) is determined to be a nonedge pixel directly. Otherwise grad(x^{*},y^{*}) will be masked.

The response of HVS depends much less on the absolute luminance than on the relation of its local variations to the surrounding luminance.^{4} Contrast sensitivity of HVS remains nearly constant over an important range of intensities. Hence the luminance masking of the gradient is modeled by

## (1)

$$gra{d}_{b}({x}^{*},{y}^{*})=\frac{grad({x}^{*},{y}^{*})}{{a}_{1}+{\left(\frac{\left|b({x}^{*},{y}^{*})-{b}_{0}\right|}{{b}_{0}}\right)}^{{r}_{1}}},$$_{b}(x

^{*},y

^{*}) denotes the gradient masked with luminance, b

_{0}is the average luminance of the entire image, and b(x

^{*},y

^{*}) is the local average luminance of the N×N sized region centered on (x

^{*},y

^{*}), as shown in Fig. 1(a). Parameters a

_{1}and r

_{1}are estimated experimentally. Equation (1) explicates the contrast sensitivity characteristic and the luminance adaptation capability of HVS.

The visibility of a stimulus is affected due to the presence of other stimuli in a surrounding spatial region of limited extent.^{4} Therefore the perception to edges is also seriously influenced by the activity of the local background. The gradient masked with luminance is further masked with activity by

## (2)

$$gra{d}_{m}({x}^{*},{y}^{*})=\frac{gra{d}_{b}({x}^{*},{y}^{*})}{{a}_{2}+{\left(\frac{m({x}^{*},{y}^{*})}{{m}_{0}}\right)}^{{r}_{2}}},$$_{0}is the average activity of the image, and parameters a

_{2}and r

_{2}are selected to match the variation of human visual sensitivity with the background activity. To compute the local activity m(x

^{*},y

^{*}) we suppose that the pixel at (x

^{*},y

^{*}) lies in an edge, which is perpendicular to the direction of grad(x

^{*},y

^{*}) and is (E

_{1}+E

_{2}) in width, as shown in Fig. 1(b). The direction of grad(x

^{*},y

^{*}) is denoted by the arrowhead. Let (x

_{1},y

_{1}) and (x

_{2},y

_{2}) be the first pixels whose gradient values are smaller than λ⋅grad

_{b}(x

^{*},y

^{*}) along the direction and against the direction of grad(x

^{*},y

^{*}) respectively. If the distances from (x

^{*},y

^{*}) to (x

_{1},y

_{1}) and (x

_{2},y

_{2}) are defined as d

_{i}(i=1,2) respectively, then E

_{i}is defined by where δ is a variable correlative with the smoothing filter. The surrounding spatial regions R

_{1}and R

_{2}(W×S in size) adjacent to the edge are used for calculating the local activity as shown in Fig. 1(b). Then compute the mean gradient values of the regions R

_{1}and R

_{2}to obtain m

_{1}(x

^{*},y

^{*}) and m

_{2}(x

^{*},y

^{*}) respectively, of which the minimum one is used as the local activity m(x

^{*},y

^{*}).

Then the edges can be labeled on the masked gradient image grad_{m}(x,y) using the threshold method.

## Experimental Results

We give a simple implementation of the improved algorithm on the Canny edge detector.^{2}

Our improved Canny algorithm is based on the Matlab function edge(image, ‘canny’), in which the high threshold T_{h}
is higher than the gradient values of 80 of all pixels and the low threshold T_{l}
is set as 0.5T_{h}, and the standard deviation of the Gaussian filter σ is 1. We mask the gradient images with luminance and activity to get grad_{m}(x,y). Then we apply the nonmaximal suppression and edge labeling on grad_{m}(x,y) to get the edge images. In our implementation, the parameters are set as follows: N=8, W=2, S=4, λ=0.618, r_{1}=2, a_{1}=1.5, r_{2}=2, a_{2}=0.5, T=0.8T_{l}, and δ=2. They are determined by threshold experiments and are of general use.

Figure 2 shows the original image and the edge images of “Basket.” From Fig. 2(b), we can observe that the edges detected by the Canny detector are not consistent with our perception edges. For example, the obtained edge map preserves most of the lawn texture but loses some details of the grids on the basket. In Fig. 2(c), however, most of the potentially undesirable texture is eliminated and the details of interest are preserved well without a significant clutter on the lawn. The results of the image “Elephant” are shown in Fig. 3, where similar results are obtained.

## Conclusions

The edges detected by traditional edge detectors may be inconsistent with the perceptive edges. We propose an improved method based on HVS which is suitable for gradient-threshold edge detectors. The results show that the edge images obtained by our algorithm are more consistent with the perceptive edge images. The performance of the gradient-threshold edge detectors is much improved by this method, which is helpful to image partition, image analysis, and so on.