• 沒有找到結果。

In this chapter, our proposed novel line detection algorithm, which uses the edge map obtained in Chapter 2 to be the input image, is presented. Our proposed line detection algorithm consists of the following four steps, namely the initialization, the candidate line determination, the voting process, and the true line determination.

Stage 1: (Initialization)

We have set of edge pixels E = {em = (im, jm)|m ∈ {1, 2, . . . , N}} where en = (in, jn) denotes the n-th edge pixel in the set E and the edge pixel en locates at the position (in, jn); N denotes the number of the edge pixels in the set E. Then, the failure counter is denoted by Cf and it is initially set to zero. Three thresholds, Tcl, Tf, and Ttl are used where Tcl denote the repeating times of the alternative binary search test which will be presented in Step 2; Tf denotes the number of successive failures that we can tolerate; Ttl denotes the least edge pixels which a true line should

include. Moreover, the voting set V←−→exey is used to collect the edge pixels which are on the candidate line ←→exey, and it is set to V←−→exey =∅, initially.

Stage 2: (The candidate line determination)

First, two edge pixels ex = (ix, jx) and ey = (iy, jy) are randomly picked out form the set E and then ←→exey is set to be an initial line. Then, the alternative binary search test is used to determine whether the initial line

←→exey is a candidate line or not. Fig. 3.1 illustrates the depiction of the alternative binary search test. After picking ex = (ix, jx) and ey = (iy, jy) out, the pixel t1(1)= (i1(1), j1(1)), which is the midpoint of the line segment exey, i.e. (i1(1), j1(1)) = (ix+i2 y,jx+j2 y), is examined whether it is an edge pixel or not. If t1(1) is an edge pixel, the two points t2(1) and t2(2), which are the midpoints of the line segments ext1(1) and t1(1)ey, respectively, are examined whether they are all edge pixels. If the above condition holds, the four points t3(1)–t3(4) are picked to examine. The alternative binary search test is repeated until the repeating times are over the threshold Tcl. Then, the line ←→exey is determined to be a candidate line and go to Step 3.

Otherwise, the line ←→exey is not a candidate line and perform Cf = Cf + 1.

If Cf > Tf, then stop; otherwise, go to Step 2.

Stage 3: (The voting process)

Bresenham’s line algorithm [4] is utilized to plot the path ←→exey and to determine which edge pixels in the edge map is on ←→exey. If the edge pixel ev = (iv, jv) is on the plotted path ←→exey, we add ev = (iv, jv) into the voting set V←−→exey, i.e. V←−→exey ={ev = (iv, jv)| ev ∈ E, ev on the line ←→exey}.

Stage 4: (The true line determination)

If the number of edge pixels in the voting set V←−→exey is greater than or equal to the threshold Ttl, i.e. |V←−→exey| ≥ Ttl, the candidate line ←→exey is a true line.

We take the edge pixels in the voting set V←−→exey out of E, i.e. E = E−V←−→exey.

∅ and C

e

x

t

2(1)

t

1(1)

t

2(2)

e

y

t

3(1)

t

3(2)

t

3(3)

t

3(4)

Fig. 3.1: The depiction of the alternative binary search test.

as a false line and perform Cf = Cf+ 1. If Cf > Tf, then stop; otherwise, set V←−→exey =∅ and go to Step 2.

4

EXPERIMENTAL RESULTS

In this chapter, based on some test images, experimental results demonstrate that our proposed edge detector to detect edges on mosaic images directly has the similar edge detection effect but has better time performance when compared with the indirect approach. Besides, some experiments are carried out to demonstrate the computation-saving benefit of our proposed line detection algorithm when running it on the edge map obtained by our proposed edge detector for mosaic images.

For convenience, the indirect approach which uses color Prewitt edge detector is called the indirect Prewitt-based approach, so as that of the indirect Sobel-based approach and the indirect Marr-Hildreth-based approach. The concerned algorithms are implemented on the IBM compatible computer with Intel Core 2 Duo CPU @ 1.6GHz and 1GB RAM. The operating system used is MS-Windows XP and the program developing environment is Borland C++ Builder 6.0. Our program has been uploaded in [43].

Figs. 4.1(a)–(d) illustrate the four color test images, namely Lady image, Sail-boats image, Window image, and House image, respectively, for the mosaic edge detection. In our experiments, the four color test images are first down-sampled to obtain the mosaic images as shown in Figs. 4.2(a)–(d), respectively.

Figs. 4.3(a)–(d) and Figs. 4.3(e)–(h) illustrate the resultant edge maps ob-tained by running the indirect Prewitt-based approach and our proposed PL-based

(a) (b) (c) (d) Fig. 4.1: The four color test images for the mosaic edge detection. (a) Lady image.

(b) Sailboats image. (c) Window image. (d) House image

(a) (b) (c) (d)

Fig. 4.2: The down-sampled mosaic images. (a) mosaic Lady image. (b) mosaic Sailboats image. (c) mosaic Window image. (d) mosaic House image

edge detector, respectively, on four test mosaic images as shown in Fig. 4.2. As a postprocessing, the nonmaxima suppression rule [5] is adopted in the implemen-tation. The resultant edge maps obtained by the indirect Sobel-based approach and our proposed SL-based edge detector are illustrated in Figs. 4.4(a)–(d) and Figs. 4.4(e)–(h), respectively. Figs. 4.5(a)–(d) and Figs. 4.5(e)–(h) illustrate the resultant edge maps obtained by the indirect Marr-Hildreth-based approach and ourproposed MHL-based edge detector, respectively. Table 4.1 demonstrates the average execution-time required in the indirect edge detection approach and our proposed direct approach for four test mosaic images where the time unit is second.

表 4.1: The average execution-time required in the indirect approach and our pro-posed approach for four test mosaic images.

Indirect approach Our proposed approach Improvement ratio

Prewitt 0.226(s) 0.118(s) 47.79%

Sobel 0.240(s) 0.118(s) 50.83%

Marr-Hildreth 1.289(s) 0.586(s) 54.54%

According to Figs. 4.3–4.5 and Table 4.1, experimental results demonstrate that our proposed edge detector to detect edges on mosaic image directly has the similar edge detection results when compared with the indirect approach; however, the av-erage execution-time improvement-ratios of our proposed PL-based, SL-based, and MHL-based edge detectors over the corresponding indirect approaches are 47.79%, 50.83%, and 54.54%, respectively.

Further, some line detection results are given to demonstrate that our proposed line detection algorithm has better computational performance when compared with Standard Hough transform (SHT) [13, 28], Randomized Hough transform (RHT) [40, 41], and Randomized line detection algorithm (RLD) [8]. Figs. 4.6(a)–(c) illustrate the three color test images, namely Subsailboats image, Grating windows image, and Road image, respectively, for the line detection. Among the three test images, Fig. 4.6(a) is the subimage cut from Fig. 4.1(b) because it has more line patterns. In our experiments, the three color test images are first down-sampled to obtain the mosaic images, and then running our proposed SL-based edge detector on the mosaic images. Figs. 4.7(a)–(c) illustrate the obtained edge maps.

For the three edge maps in Figs. 4.7(a)–(c), after running SHT, RHT, RLD and our proposed line detection algorithm, the resulting detected lines are shown in Figs. 4.8–4.10, respectively. For three test mosaic images, Table 4.2 illustrates

表 4.2: The execution-time comparison among the four concerned line detection algorithms for three test mosaic images.

Algorithm SHT RHT RLD Proposed

Subsailboats image 0.143(s) 0.126(s) 0.072(s) 0.064(s) Grating windows image 0.137(s) 0.114(s) 0.088(s) 0.060(s) Road image 0.136(s) 0.106(s) 0.046(s) 0.027(s) Average 0.139(s) 0.115(s) 0.069(s) 0.050(s)

the execution-time comparison among the four concerned line detection algorithms.

From Table 4.2, the average execution-time of SHT, RHT, RLD, and our pro-posed algorithm are 0.139s, 0.115s, 0.069s, and 0.050s, respectively. In average, the execution-time improvement ratio of our proposed algorithm over SHT, RHT, and RLD are 64.03% (0.1390.139−0.050×100%), 56.52% (= 0.1150.115−0.050×100%), and 27.54%

(= 0.069−0.050

0.069 × 100%), respectively.

Finally, according to the above experimentations and discussions, it is observed that our proposed edge detector for mosaic images has better computational per-formance than the indirect approach and our proposed line detection algorithm has the best computational performance among the four concerned line detection algo-rithms. Thus, combining the proposed edge detector and the proposed line detection algorithm is the most efficient approach to detect the lines from mosaic images.

(a) (b) (c) (d)

(e) (f) (g) (h)

Fig. 4.3: The resultant edge maps. The resultant edge maps obtained by running the indirect Prewitt-based approach on the mosaic images. (a) For Lady image. (b) For Sailboats image. (c) For Window image. (d) For House image. The resultant edge maps obtained by running the proposed PL-based edge detector on the mosaic images. (e) For Lady image. (f) For Sailboats image. (g) For Window image. (h) For House image.

(a) (b) (c) (d)

(e) (f) (g) (h)

Fig. 4.4: The resultant edge maps. The resultant edge maps obtained by running the indirect Sobel-based approach on the mosaic images. (a) For Lady image. (b) For Sailboats image. (c) For Window image. (d) For House image. The resultant edge maps obtained by running the proposed SL-based edge detector on the mosaic images. (e) For Lady image. (f) For Sailboats image. (g) For Window image. (h) For House image.

(a) (b) (c) (d)

(e) (f) (g) (h)

Fig. 4.5: The resultant edge maps. The resultant edge maps obtained by running the indirect Marr-Hildreth-based approach on the mosaic images. (a) For Lady image. (b) For Sailboats image. (c) For Window image. (d) For House image. The resultant edge maps obtained by running the proposed MHL-based edge detector on the mosaic images. (e) For Lady image. (f) For Sailboats image. (g) For Window image. (h) For House image.

(a) (b) (c)

Fig. 4.6: The three test images for line detection. (a) Subsailboats image. (b) Grating windows image. (c) Road image.

(a) (b) (c)

Fig. 4.7: The obtained edge maps obtained by running the proposed SL-based edge detector on the mosaic images. (a) For Subsailboats image. (b) For Grating windows image. (c) For Road image.

(a) (b)

(c) (d)

Fig. 4.8: For Subsailboats image, the resulting detected lines obtained by using (a) SHT, (b) RHT, (c) RLD, and (d) our proposed line detection algorithm.

(a) (b)

(c) (d)

Fig. 4.9: For Grating windows image, the resulting detected lines obtained by using (a) SHT, (b) RHT, (c) RLD, and (d) our proposed line detection algorithm.

(a) (b)

(c) (d)

Fig. 4.10: For Road image, the resulting detected lines obtained by using (a) SHT, (b) RHT, (c) RLD, and (d) our proposed line detection algorithm.

5

CONCLUSIONS

Without demosaicing process, a new and efficient edge detector has been presented for color mosaic images directly. Combining the Prewitt mask-pair and the lumi-nance estimation technique for mosaic images, the mask-pair for edge detection on the input mosaic image is derived first. Then, a novel edge detection algorithm for mosaic images is proposed. Experimental results demonstrate that the proposed edge detector to detect edges on mosaic images directly has the similar edge de-tection results when compared with the indirect approach which first applies the demosaicing process to the input mosaic image, and then runs the Prewitt edge detector on the demosaiced full color image; however, the average execution-time improvement-ratio of our proposed edge detector over the indirect approach is about 48%. Our proposed results can be applied to the other masks, e.g. the Sobel mask-pair and the Marr-Hildreth mask, for edge detection. Finally, the application to design a new line detection algorithm on mosaic images is investigated. Based on some test images, our proposed line detection algorithm has better computational performance when compared with SHT [13, 28], RHT [40, 41], and RLD [8]. Thus, according to the experimentations and discussions, combining the proposed edge detector and the proposed line detection algorithm is the most efficient approach to detect the lines from mosaic images.

相關文件