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.
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 gradm(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 bygradb(x*,y*) denotes the gradient masked with luminance, b0 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 a1 and r1 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 bym0 is the average activity of the image, and parameters a2 and r2 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 (E1+E2) in width, as shown in Fig. 1(b). The direction of grad(x*,y*) is denoted by the arrowhead. Let (x1,y1) and (x2,y2) be the first pixels whose gradient values are smaller than λ⋅gradb(x*,y*) along the direction and against the direction of grad(x*,y*) respectively. If the distances from (x*,y*) to (x1,y1) and (x2,y2) are defined as di(i=1,2) respectively, then Ei is defined by R1 and R2 (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 R1 and R2 to obtain m1(x*,y*) and m2(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 gradm(x,y) using the threshold method.
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 Th is higher than the gradient values of 80 of all pixels and the low threshold Tl is set as 0.5Th, and the standard deviation of the Gaussian filter σ is 1. We mask the gradient images with luminance and activity to get gradm(x,y). Then we apply the nonmaximal suppression and edge labeling on gradm(x,y) to get the edge images. In our implementation, the parameters are set as follows: N=8, W=2, S=4, λ=0.618, r1=2, a1=1.5, r2=2, a2=0.5, T=0.8Tl, 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.
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.