Chapter 3 Color Edge Detection and Entropic Thresholding
3.1 Vector Order Statistics based Color Edge Detection
3.1.2 Local Window Case
For each pixel location
(
m n,)
, by using a 3×3 window, we compute the local sum of distances to describe the relationship between the current pixel vector(
,)
dl and dl(9) correspond to the minimum and the maximum of the nine distance values, respectively.
By the concept of R-ordering, the ordering of dl(1) ≤ dl(2) ≤ ... ≤ dl(9) associates the same ordering to the pixel vectors, Xl(1) ≤ Xl(2) ≤ ...≤ Xl(9),which means that Xl(1) is the pixel vector having the smallest local sum of distances and
(9)
Xl is the pixel vector having the largest local sum of distances. If the current pixel location
(
m n,)
has an edge, the vector F m n(
,)
must have a larger response of d m n(
,)
. Therefore, the subsequent edge detection process executes when thevector F m n
(
,)
belongs to one of the vectors Xl(4) − Xl(9). Fig. 3.1 illustrates a simple edge example of the orderings of vectors based on the aggregate distances and the local sum of distances by the R-component only. Notice that the pixel in the center of the window has a smaller response of the aggregate distance in Fig. 3.1(c) denoted as X(5) in Fig. 3.1(d), and has a larger response of d m nl(
,)
in Fig. 3.1(e) denoted as Xl(5) in Fig. 3.1(f).255 255 255
Fig. 3.1. A simple edge example. (a) single edge image, (b) R-component values in edge area, (c) the aggregate distances, and (d) sorted pixels vectors corresponding to the same ordering of the aggregate distances, (e) the local sum of distances, and (f) Sorted pixels vectors corresponding to the same ordering of the local sum of distances.
Next, the edge detector Maximal Delta (MD) is defined as
( )
(
( ))
max , l j ,
MD = F m n − X 4 ≤ j ≤ (12) 9
Because that the ordered vectors Xl(4), , Xl(5) ..., Xl(9) denote the larger six sum of
distances d i jl
( )
, , the positions of these ordered vectors could also be edge candidates. Because that an edge is two pixels wide in nature, it suggests that we can find the maximum variation existent in the two pixels of edge bank by utilizing MD edge detector.3.2 PCA based Color Edge Detection
3.2.1 YCbCr Color Space
Before we introduce our PCA based color edge detection, we now briefly introduce YC C color space. b r
The color space of YC C can divided into luminance component (Y), and two b r chromatic blueness component (C ), redness component (b C ). r C and b C are the r difference of blue and the difference of red chromatic components. The following conversion matrix is used to convert RGB color space into YC C color space. b r
For a color edge detector, the goal is to detect edges that have changes in luminance or in chrominance. Our PCA based edge detection involves the reconstruction of the input image. We have to retain both chrominance and luminance information via the essential principal components of input image. Therefore, YC C b r color space is selected in our PCA based color edge detection theme.
3.2.2 Eigencolor Image Construction
vij to retain the low frequency and the high frequency contents of the color image .
F To obtain the compressed image for edge detection, we have to keep not only the low frequency principal components but also the high frequency components for detail and edge preservation, which is quite different from the conventional image
data compression approach. These eigenvectors are arranged in a matrix
1, 2, ..., , ( ), ( 1), ..., .
i i i
i i i ik i L k i L k iL
E = ⎣⎡V V V V − V − + V ⎤⎦
After obtaining the eigenvectors, we are now constructing an image called
“eigencolor” image. First, the matrix F of the color component i is obtained by i'
Fi' = Fi − Fi (16)
And the weighting coefficients matrix W of selected eigenvectors can be computed i by
Wi = E FiT i' (17)
The i-th color component is then constructed by
Eigeni = E Wi i + Fi (18)
The other two color components are also constructed in the same procedure.
Finally, the eigencolor image can be obtained by combining three constructed color components Eigen with the corresponding dimension order. i
3.2.3 Edge Response Calculation
To obtain the edge response of the compressed eigencolor image, we simply apply the Sobel operator, as shown in Fig. 2, to each color component of eigencolor image, Eigen , and calculate the magnitude of edge response for each pixel location i
(
m n,)
by( , )
(
,)
2(
,)
2, 1, 2, ..., , 1, 2, ...,g m n are respectively the horizontal and vertical responses
of the Sobel operator, shown in Fig. 3.2, in pixel location
(
m n,)
for the i-th Fig. 3.2. Sobel operator. (a) horizontal derivative approximation ,hi
The edge image is obtained by a majority vote fusion rule on the detected edge of three color components. Let count denote the number that E m ni
(
,)
classifiespixel
(
m n,)
as an edge for i =1, 2, and 3. Namely pixel(
m n,)
is classified as an edge if it is classified as an edge by at least two of its three color components, shown in (20). Otherwise, it is classified as a non-edge pixel and E m n(
,)
is set to 0.
( )
1 (edge pixel), if 2 , 0 (nonedge pixel), otherwisecount
E m n ⎧ ≥
= ⎨⎩ (21)
3.3 Entropic Thresholding
To automatically obtain an optimal threshold that is adaptive to the image contents, the entropic thresholding technique is adopted. In the following, we illustrate how to apply entropic thresholding technique to the vector-order statistics based and the PCA based edge detections.
3.3.1 Entropic Thresholding for Vector-Order Statistics based Edge Detection
We are now introducing the entropic thresholding technique. Given a threshold, e.g., ,T the probability distributions for the edge and non-edge pixel classes can be defined, respectively. As they are to be regarded as independent distributions, the probability for the non-edge pixels in a S ×S window having S pixels 2 P in
( )
can be defined as
n( ) ln2
P i = S (22)
where l indicates the number of pixels in the window that have the edge responses n smaller than or equal to threshold T . The probability for the edge pixels P ie
( )
can be defined ase( ) le2
P i = S (23)
where l indicates the number of pixels in the window that have the edge responses e greater than threshold T . The entropies for these two pixel classes are then given as
Hn
( )
T = −P in( ) logP in( ) (24)H Te
( )
= −P ie( ) logP ie( ) (25)The local optimal threshold Tl∗ selected for performing the non-edge and edge pixel classification has to satisfy the following criterion function:
( ) ( ( ) ( ) )
the mean vector of two sides (larger and smaller side) of the edge. In this way, the local optimal threshold Tl∗ reflects the relative magnitude variation with respect to the mean magnitude of current processing area. In our experiments, we select1, , 2 ..., L
T T T to be 0.2, 0.3, ..., 0.9.
3.3.2 Entropic Thresholding for PCA based Edge Detection
After obtaining the magnitude of edge response E Sec. 3.2.2, of each color i, component for pixels in the image, we introduce the entropic thresholding technique globally. We utilize all the Sobel edge response values of pixels in the input image as the possible choices of the global optimal threshold Tg∗ for each components .i For the i-th component of the color space, let the edge responses of the pixels have the range [0, ]h (the possible choices of the global optimal threshold), the probability n
for the non-edge pixels in a M × N image P in
( )
can be defined as n( ) ln ,P i = M N
× (27) where l indicates the number of pixels in the input image that have the edge n responses smaller than or equal to threshold T. The probability for the edge pixels
e
( )
P i can be defined as
e( ) le , P i = M N
× (28) where l indicates the number of pixels in the input image that have the edge e responses greater than threshold T.
The entropies Hn
( )
T and H Te( )
for these two pixel classes can be computed according to Eqs. (23) and (24). The global optimal threshold Tg∗ selected for performing the non-edge and edge pixel classification has to satisfy the following criterion function:However, the global optimal threshold Tg∗ will be too small and too sensitive for edge detection because that most pixels in the input image are non-edge pixels causing a bias leaning to the non-edge pixels’ edge strength. From Eq. (28), it is clear that maximum entropy occurs when the numbers of pixels in edge class and non-edge class are equal. Since most pixels are non-edge pixels, which have small magnitudes of edge response, Tg∗ naturally is tuned to a small value among the pixels’ edge response, which results in an erroneous edge/non-edge threshold selection. Therefore, we need to discard the pixels with small magnitudes of edge response in order to
alleviate the bias caused from the usual uneven distribution between edge pixels and non-edge ones. To solve this, we introduce a sensitivity parameter γ, which is automatically calculated from the input image content. The pixels which have the magnitudes of edge response smaller than the sensitivity parameter γ are the obvious non-edge pixels and are discarded when applying our global entropic thresholding technique. On testing various images, we have found that the Sobel edge responses of obvious non-edge pixels usually have strengths smaller than five. To this end, we calculate the histograms of the edge response in the following ten intervals:
(
0, 0.5 , 0.5, 1 , ..., 4.5, 5 .] ( ] ( ]
The value of γ is chosen to be the larger boundary of the interval that has the largest drop in histogram value, which could be the boundary for the obvious non-edge pixels and possible non-edge pixels. This is because that the majority of pixels in an image belong to non-edge regions and these pixels have small yet compact magnitudes of edge response. Therefore, we can assume that the intervals with maximal drop in histogram values represent the possible boundary between obvious non-edge pixels and possible non-edge pixels and we set γ to be the right boundary value of this interval. For example, if the maximal drop in histogram values of pixels’ edge strength occurs between(
2, 2.5]
and(
2.5, 3]
, the value of γ is chosen as 2.5.Chapter 4 Experimental Results
In chapter 4, we test our vector-order statistics based and PCA based edge detection techniques on synthetic images and real world images. The synthetic images include one image that contains nine different color blocks with the same intensity.
These synthetic images are generated for assessing the performance comparison. For all the real world images are smoothed by the Gaussian filter with σ =1 to alleviate the interference from noises. In the end of this chapter, we evaluate our edge detection techniques quantitatively by using Pratt’s Figure Of Merit (FOM) [24] and TPR, TNR and ACC of Receiver Operating Characteristic (ROC) [25].
4.1 Vector-Order Statistics based Edge Detection
We utilize our vector-order statistics based edge detectors to compute edge response and entropic thresholding technique to determine a local optimal threshold
l .
T∗ The first image we test on is a image consisting of 9 different color blocks with the same intensity as shown in Fig. 4.1(a). This image is applied to verify that our edge detection techniques works when objects in image has the same intensity but different hues. Figs. 4.1(b)−(d) show the edge detection results obtained by VMD, VDD and MD, and proves that our edge detection techniques can work under this circumstance. Fig. 4.2 gives the corresponding histograms of local optimal threshold
Tl∗ of VMD, VDD and MD to Fig. 4.1(a), where the X-axis is the proportional ratio constants described in Sec. 3.1.1.
(a)
(b) (c)
(d)
Fig. 4.1. Edge detection results of a color image with the same intensity. (a) original image, (b) edge detection by VMD, (c) edge detection by VDD, (d) edge detection by MD.
(a) (b)
(c)
Fig. 4.2. The corresponding histograms of local optimal threshold Tl∗ to Fig. 4.1(a).
(a) histogram of Tl∗ using VMD, (b) histogram of Tl∗ using VDD, (c) histogram of
Tl∗ using MD.
Next, we apply our edge detection techniques to images similar to Fig. 4.1(a) but with different intensities as shown in Fig. 4.3(a) and Fig. 4.5(a). Figs. 4.3(b)−(d) and Figs. 4.5(b)−(d) illustrate the edge detection result applying VMD, VDD and MD to Fig. 4.3(a). Fig. 4.4 and Fig. 4.5 give the corresponding histograms of local optimal threshold Tl∗ of VMD, VDD and MD to Fig. 4.3(a) and Fig. 4.5(a) respectively.
(a)
(b) (c)
(d)
Fig. 4.3. Edge detection results of a color image with different intensities. (a) original image, (b) edge detection by VMD, (c) edge detection by VDD, (d) edge detection by MD.
(a) (b)
(c)
Fig. 4.4. The corresponding histograms of local optimal threshold Tl∗ to Fig. 4.3(a).
(a) histogram of Tl∗ using VMD, (b) histogram of Tl∗ using VDD, (c) histogram of
Tl∗ using MD.
(a)
(b) (c)
(d)
Fig. 4.5. Edge detection results of a color image with different intensities. (a) original image, (b) edge detection by VMD, (c) edge detection by VDD, (d) edge detection by MD.
(a) (b)
(c)
Fig. 4.6. The corresponding histograms of local optimal threshold Tl∗ to Fig. 4.5(a).
(a) histogram of Tl∗ using VMD, (b) histogram of Tl∗ using VDD, (c) histogram of
Tl∗ using MD.
From the above results, our vector-order statistics based edge detection techniques are capable of detecting vertical and horizontal edges. Therefore, we are interested in their ability to detect diagonal edges. Fig. 4.7 shows the result of applying our edge detection techniques to an image with diagonal edges. Fig. 4.8 shows the corresponding histograms of local optimal threshold Tl∗ of VMD, VDD and MD to Fig. 4.7(a). At last, we apply our techniques to real world images, as shown in Fig. 4.9(a) and Fig. 4.10(a). The edge detection results are given in Figs.
4.9(b)−(d) and Figs. 4.10(b)−(d).
(a)
(b) (c)
(d)
Fig. 4.7. Edge detection results of a color image with diagonal edges. (a) original image, (b) edge detection by VMD, (c) edge detection by VDD, (d) edge detection by MD.
(a) (b)
(c)
Fig. 4.8. The corresponding histograms of local optimal threshold Tl∗ to Fig. 4.7(a).
(a) histogram of Tl∗ using VMD, (b) histogram of Tl∗ using VDD, (c) histogram of
Tl∗ using MD.
(a)
(b) (c)
(d)
Fig. 4.9. Edge detection results of a real world image. (a) original image, (b) edge detection by VMD, (c) edge detection by VDD, (d) edge detection by MD.
(a)
(b) (c)
(d)
Fig. 4.10. Edge detection results of a human face image. (a) original image, (b) edge detection by VMD, (c) edge detection by VDD, (d) edge detection by MD.
4.2 PCA based Edge Detection
Here, we test our PCA based edge detection technique. If an input image has size ,
M × N we select the minimum between M and N, as mentioned in Sec. 3.2.2., to be L. We select ki to be 16% of L for Y color component and 8% of L for
C and b C components. In Sec. 3.2.2., r ki represents how many eigenvectors we select to retain the low and high frequency contents of an input image. After we obtained the eigencolor image, Sobel operator is applied to obtain edge responses.
The global entropic thresholding technique is then applied to generate the global optimal threshold Tg∗. The sensitivity parameter γ is generated automatically to facilitate the global entropic thresholding technique.
We first apply the image in Fig. 4.1(a) to test our PCA based edge detection technique, as shown in Fig. 4.11(a). Fig. 4.11(b) shows the corresponding eigencolor image in RGB color space. Fig. 4.11(c) is the corresponding edge detection result.
From Fig. 4.11(b), we can observe that PCA can capture the low and high frequency image contents. Fig. 4.12 and Fig. 4.13 show the results of applying PCA based edge detection techniques to the color images in Fig. 4.5(a) and Fig. 4.7(a). Fig. 4.14 shows the probability density function (PDF) plots and cumulative distribution function (CDF) plots of Tg∗ taking the image with diagonal edges as an example. We can observe clearly that the maximum of entropy occurs when the numbers of pixels in edge class and in non-edge class are equal.
At last, we apply our techniques to real world images, as shown in Fig. 4.15(a) and Fig. 4.16(a). Fig. 4.15(b) and Fig. 4.16(b) show the corresponding eigencolor images in RGB color space. Fig. 4.15(c) and Fig. 4.16(c) are the corresponding edge detection results.
(a)
(b) (c) Fig. 4.11. Edge detection result of a color image with the same intensity. (a) original
image, (b) the eigencolor image in RGB color space, (c) the edge detection result.
(a)
(b) (c) Fig. 4.12. Edge detection result of a color image with the different intensities. (a)
original image, (b) the eigencolor image in RGB color space, (c) the edge detection result.
(a)
(b) (c)
Fig. 4.13. Edge detection result of a color image with diagonal edges. (a) original image, (b) the eigencolor image in RGB color space, (c) the edge detection result.
(a) (b)
(c) (d)
(e) (f) Fig. 4.14. The PDF and CDF of Tg∗ of the color image with diagonal edges. (a) PDF
of Y, (b) CDF of Y (CDF of Tg∗=0.499), (c) PDF of C , (d) CDF of b C (CDF of b
Tg∗=0.504), (e) PDF of C , (f) CDF of r C (CDF of r Tg∗=0.501).
(a)
(b) (c) Fig. 4.15. Edge detection result of a real world image. (a) original image, (b) the
eigencolor image in RGB color space, (c) the edge detection result.
(a)
(b) (c) Fig. 4.16. Edge detection result of a human face image. (a) original image, (b) the
eigencolor image in RGB color space, (c) the edge detection result.
4.3 Comparing the Experimental results
First, we would like to introduce Pratt’s Figure Of Merit (FOM) and TPR, TNR and ACC of Receiver Operating Characteristic (ROC) as performance measures.
FOM is defined as
detected and the ideal edges FOM =1 whereas the detected edges deviate more and more from the ideal ones FOM goes to zero. The scaling constant 1
α = 9 proposed in [14] has been adopted. Next, True Positive Rate (TPR) is defined as
(
TP)
100%TPR = TP FN ×
+ (31)
where TP (true positive) represents the number of pixels which are detected as an edge pixel and belong to an ideal edge pixel, and FN (false negative) represents the number of pixels which are detected as an non-edge pixel but belong to an ideal edge pixel.
On the other hand, true negative rate (TNR) is defined as
TN 100%
TNR = TN FP ×
+ (32) where TN (true negative) represents the number of pixels which are detected as an non-edge pixel and belong to an ideal non-edge pixel, and FP (false positive) represents the number of pixels which are detected as an edge pixel but belong to an
ideal non-edge pixel.
At last, accuracy (ACC) is defined as
TP TN 100%
ACC P N
= + ×
+ (33) where P (positive) represents the total number of ideal edge pixels, and N (negative) represents the total number of ideal non-edge pixels. We also calculate the normalized accuracy by
100%
2 TPR TNR
NACC = + × (34)
The performance of our automatic color edge detection techniques are compared to those by color Canny edge detector [1], MVD edge detector [14], directional operator [15], Dikbas et al. [18], and automatic isotropic color edge detector [9]. Figs.
4.17−4.19 show the edge detection results of synthetic images for comparison. Tables I−III show the corresponding FOM, TPR, TNR, ACC and NACC of various edge detection schemes, with the script representing the rank of the method, of Figs.
4.17−4.19. From Tables I−III, we can see that our edge detection techniques perform well compared to other edge detection techniques. Figs. 4.20 and 4.21 show the edge detection results of real world images for comparison.
From the above results, we can see that our techniques perform consistently well compared to other edge detection techniques. Comparing the results by our PCA based technique with the results by automatic isotropic color edge detector, we can see that our global entropic thresholding technique performs better because that the sensitivity parameter γ alleviates the bias leaning to the non-edge pixels’ edge strength, which is mentioned in Sec. 3.3.2. The results of automatic isotropic color edge detector are too sensitive because that the edge detector utilizes all the pixels’
edge responses to determine the optimal threshold without alleviating the bias caused
from dominant non-edge pixels in number. From the results of our vector-statistics based edge detectors, VDD edge detector is more capable of alleviating the influence from noises but is too insensitive to real edges because that VDD detector discards the outlier X(9) while calculating the edge response. In general, MD detector is sensitive to small texture variation since it detects the genuine local maximal variance within the processing area.
(a)
(b) (c)
(d) (e)
(f) (g)
(h) (i)
(j)
Fig. 4.17. Edge detection result of a color image with the same intensity. (a) original image, (b) VMD, (c) VDD, (d) MD, (e) eigencolor, (f) color Canny, (g) MVD, (h) directional operator, (i) Dikbas et al. [18], (j) automatic isotropic color edge detector.
(a)
(b) (c)
(d) (e)
(f) (g)
(h) (i)
(j)
Fig. 4.18. Edge detection result of a color image with the different intensities. (a) original image, (b) VMD, (c) VDD, (d) MD, (e) eigencolor, (f) color Canny, (g) MVD, (h) directional operator, (i) Dikbas et al. [18], (j) automatic isotropic color edge
detector.
(a)
(b) (c)
(d) (e)
(f) (g)
(h) (i)
(j)
Fig. 4.19. Edge detection result of a synthetic color image. (a) original image, (b) VMD, (c) VDD, (d) MD, (e) eigencolor, (f) color Canny, (g) MVD, (h) directional operator, (i) Dikbas et al. [18], (j) automatic isotropic color edge detector.
(a)
(b) (c)
(d) (e)
(f) (g)
(h) (i)
(j)
Fig. 4.20. Edge detection result of a real world image. (a) original image, (b) VMD, (c) VDD, (d) MD, (e) eigencolor, (f) color Canny, (g) MVD, (h) directional operator, (i) Dikbas et al. [18], (j) automatic isotropic color edge detector.
(a)
(b) (c)
(d) (e)
(f) (g)
(h) (i)
(j)
Fig. 4.21. Edge detection result of a real world image. (a) original image, (b) VMD, (c) VDD, (d) MD, (e) eigencolor, (f) color Canny, (g) MVD, (h) directional operator, (i) Dikbas et al. [18], (j) automatic isotropic color edge detector.
TABLE I
Automatic isotropic 100.00 1 100.00 100.00 100.00 1 100.00 1
TABLE III
EVALUATION RESULT OF FOM,TPR,TNR,ACC AND NACC OF FIG.4.19.
Method FOM (%) TPR (%) TNR (%) ACC (%) NACC (%)
VMD 90.26 3 88.52 97.85 96.74 3 93.19 2
VDD 89.12 5 70.20 99.10 97.35 1 84.65 6
MD 91.25 2 90.65 97.44 96.77 2 94.05 1
Eigencolor 91.68 1 97.26 88.68 89.75 6 92.97 3
Color Canny 91.05 4 83.33 95.68 95.15 5 89.50 5
MVD 85.43 6 94.32 87.64 88.78 7 90.98 4
Directional operator 77.78 8 42.44 92.15 88.62 8 67.30 9 Dikbas et al. [18] 84.37 7 70.57 95.25 95.74 4 82.91 7
Automatic isotropic 43.51 9 99.47 36.21 41.54 9 67.84 8
Chapter 5 Conclusion and Future Work
In this thesis, we have proposed automatic color edge detection schemes by entropic thresholding. By using our edge detection and automatic thresholding techniques, we can detect not only edges with different intensities but also edges with minor color difference and similar intensity. In this way, the performances of higher level image processing tasks such as segmentation and object recognition can be improved because of the improvement of edge detection result. Experimental results have shown that our automatic color edge detection techniques are good and reliable.
In the future study, we can further improve our automatic thresholding technique by applying texture analysis to the input image. By texture analysis, we can obtain the information concerning the amount of edges in the input image. Hence, we can have a more discreet method to obtain good γ parameter and then alleviate the bias resulting from dominant non-edge pixels.
References
[1] J. Canny, “A computational approach to edge detection,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 8, no. 6, pp. 679–698, 1986.
[2] M. A. Ruzon and C. Tomasi , “Color edge detection with the compass operator,”
in Proc. IEEE Conf. Computer Vision and Pattern Recognition, 1999, vol. 2, pp.
160–166.
[3] A. Cumani, “Efficient contour extraction in color images,” in ACCV ’98:
[3] A. Cumani, “Efficient contour extraction in color images,” in ACCV ’98: