# SNR Analysis for Quantitative Comparison of Line Detection Methods
## 3 Method--SNR of ED and SD for Line Detection
### Derivation of SNRs
Thus, the SNR of edge detection with the penalty for blurring and smoothing, i.e., \(\text{SNR}_{\text{PS}}(\text{edge})\), is calculated as follows:  
\[\text{SNR}_{\text{PS}}(\text{edge})=p(\sigma_{b},\sigma_{s},w)\cdot\text{SNR }_{\text{C}}(\text{edge}). \tag{42}\]  
Moreover, the SNR of the SD-based line detection with the penalty for blurring and smoothing, i.e., \(\text{SNR}_{\text{PS}}(\text{line}_{\text{SD}})\), is calculated as follows:  
\[\text{SNR}_{\text{PS}}(\text{line}_{\text{SD}})=p(\sigma_{b},\sigma_{s},w) \cdot\text{SNR}_{\text{C}}(\text{line}_{\text{SD}}). \tag{43}\]  
Because the detection of edge pixels is required at either sides of the line to find the line pixel, the \(\text{SNR}_{\text{PS}}\) of edge detection for the purpose of line detection is measured by halving \(\text{SNR}_{\text{PS}}(\text{edge})\) in Equation (42) as follows:  
\[\text{SNR}_{\text{PS}}(\text{line}_{\text{ED}})=\frac{\text{SNR}_{\text{PS}} (\text{edge})}{2}. \tag{44}\]  
To compare the performance of the ED-based and SD-based line detections, a set of graphical investigations was used. The tests were performed with various values of the smoothing factor \(\sigma_{s}\) and the line width \(w\) for investigation. The smoothing factor was set to vary from 0.4 to 10.0 pixels with an interval of 0.1 pixels, and the line width was set to vary from 0.5 to 20.0 pixels with an interval of 0.1 pixels. The blurring factor \(\sigma_{b}\) was set to 1.0, which is a reasonable value to represent the amount of blurs observed in many camera-captured images [39]. The standard deviation of noise and contrast were set to \(\sigma_{n}=0.05\) and \(k=1.0\), respectively, in the following graphical investigations. Figure 2(a) shows the \(\text{SNR}_{\text{C}}\) of edge detection. In Figure 2(a), the SNR becomes very high, when the smoothing factor is set to be large and distinct, particularly when the line width is large. However, it is not realistic because the signals become interspersed with other signals with increase in the smoothing factor. Thus, according to Equation (42), a realistic measure of SNR is obtained by applying the penalty function to \(\text{SNR}_{\text{C}}\)(edge). The resulting \(\text{SNR}_{\text{PS}}\) is shown in Figure 2(b). Figure 3(a) shows the \(\text{SNR}_{\text{C}}\)(linesD). Similarly, in Figure 3(a), the SNR becomes extremely high when the smoothing factor is set to be large, and a realistic measure of SNR is obtained by applying the penalty function to \(\text{SNR}_{\text{C}}\)(linesD) according to Equation (43). The resulting \(\text{SNR}_{\text{PS}}\)(linesD) is shown in Figure 3(b). The \(\text{SNR}_{\text{PS}}\)(lineED) is shown in Figure 4(a), which is calculated using Equation (44). Then, Figure 4(b) shows the difference in \(\text{SNR}_{\text{PS}}\)(linesD)\(-\)SNR\({}_{\text{PS}}\)(lineED). According to Figure 4(b), when the line width is relatively small, the SD-based line detection in terms of SNR is shown to be more effective than ED-based line detection. For example, the SD-based line detection is more effective than ED-based line detection when the line width \(w\) is less than 5 pixels with a smoothing factor of 1.0, and less than 11 pixels when a smoothing factor of 3.0 is applied to an image. Moreover, the highest values in \(\text{SNR}_{\text{PS}}(\text{lines}_{\text{SD}})-\text{SNR}_{\text{PS}}(\text{ line}_{\text{ED}})\) against the varying line widths are observed when a smoothing factor within the range from 1.0 to 2.0 is applied to an image with the line width within the range of 4 pixels.