# SNR Analysis for Quantitative Comparison of Line Detection Methods
## 5 Experimental Results and Discussion  
To validate the derived SNRs in natural images, the relationships of the SNRs with the completeness and correctness were also used in this section. For the experiments with natural images, the Lena image with the size of \(512\times 512\) pixels in gray color [0, 255] was first selected to describe the procedure of the experiments for natural images. Figure 9 shows the Lena image with three annotated regions for further investigation. Figure 10 shows the images resulting from each process for the annotated regions in Figure 9. To measure the SNRs, the completeness and correctness, ridge, and valley pixels were detected in the smoothed version of the original image with \(\sigma_{s}=1.0\) by the SGAD-based line detection and considered as the ground truth pixels of ridge and valley pixels. Then, the line width and contrast of each ground truth pixel were calculated as follows. At each ground truth pixel, line width was searched for two directions: the normal and its opposite directions. Regarding ridge pixels, for each direction, line width in one direction increased by one pixel at every extension of the line width before the intensity of the current pixel is greater than that of its previous pixel + a spec  
Figure 9: Lena image. study, the tolerance was set to 0.05. Then, the direction among the two search directions, whose last intensity has less contrast with the ground truth line pixel, was selected and the line width in that direction was recorded as the line width of the ground truth line pixels. The contrast in the selected direction was recorded as the contrast of the ground truth line pixels. The method to find the line width and contrast of valley pixels was the same to that of the ridge pixels. SNRs of the SD-based and SGAD-based line detections were calculated using the given line width, contrast, and noise strength. As shown in Figure 10, SNRs of the SGAD-based line detection were much greater than those of the SD-based line detection. Accordingly, as shown in the last two columns in Figure 10, the results by SGAD show less noisy and more accurate line detection results than those by SD when they are compared with the ground truths shown in the third column in Figure 10.  
The completeness and correctness of line detection results were measured as follows. First, ground truth images were generated using the line detection results by applying the SGAD-based line detection to the smoothed version of the original image with \(\sigma_{s}=1.0\), as shown in the third column in Figure 10. Then, a set of noisy images were generated by adding varying strengths of Gaussian random noises ranging from \(\sigma_{n}=4.0\) to 20.0 with the interval of 4.0, respectively, to the original images. Next, all the noisy images were denoised by applying a smoothing convolution with \(\sigma_{s}=1.0\), and the SD-based and SGAD-based line detections were applied to the noisy images. When the ground truth image as reference is denoted by \(\mathbf{R}\) and a line pixel image resulting from the application of a line detection method to a noisy image are denoted by \(\mathbf{T}\), then the image \(\mathbf{C}\) which contains line pixels correctly detected by a line detector can be written as  
\[\mathbf{C}=\mathbf{R}\wedge\mathbf{T}, \tag{77}\]  
where \(\wedge\) denotes the logical _AND_ operator. Figure 10: Line detection results for the Lena subset images. First to last columns show the original images, smoothed images, ground truth line pixels, line width \(w\), contrast \(k\), \(\log_{10}(\text{SNR})\) of the SD- and SGAD-based line detections when \(\sigma_{n}=8.0\), and line pixels detected by the SD- and SGAD-based line detections under \(\sigma_{n}=8.0\). First, third, and fifth rows show the results for ridges and second, fourth, and sixth row show the results for valleys.