# SNR Analysis for Quantitative Comparison of Line Detection Methods
## 4 Method--SNR of SGAD for Line Detection
### Derivation of SNRs
 \tag{67}\]  
Because of the symmetry between the pair of gradients at 1 and 8, and the pair of gradients at 3 and 6 in Figure 6, \(\text{SNR}_{\text{PS}}(\text{line}_{\theta_{3}-\theta_{6}})\) can be written as follows:  
\[\text{SNR}_{\text{PS}}(\text{line}_{\theta_{3}-\theta_{6}})=\text{SNR}_{ \text{PS}}(\text{line}_{\theta_{1}-\theta_{5}}). \tag{68}\]  
Because the gradients at 2 and 7 in Figure 6 are zero for the assumed line model, \(\text{SNR}_{\text{PS}}(\text{line}_{\theta_{2}-\theta_{7}})\) can be written as follows:  
\[\text{SNR}_{\text{PS}}(\text{line}_{\theta_{2}-\theta_{7}})=0. \tag{69}\]  
Furthermore, considering the \(\text{SNR}_{\text{PS}}\) of the four directions, the \(\text{SNR}_{\text{PS}}\) of SGAD for detecting the assumed line model can be derived as follows:  
\[\text{SNR}_{\text{PS}}(\text{line}_{\text{SGAD}})=\text{SNR}_{\text{PS}}( \text{line}_{\theta_{4}-\theta_{5}})+2\cdot\text{SNR}_{\text{PS}}(\text{line }_{\theta_{1}-\theta_{5}}). \tag{70}\]  
The ratio of \(\text{SNR}_{\text{PS}}(\text{line}_{\text{SGAD}})\) to \(\text{SNR}_{\text{PS}}(\text{line}_{\text{SD}})\) can be derived from Equations (43) and (70) as follows:  
\[\text{ratio}(\text{SGAD},\text{SD})=\frac{\text{SNR}_{\text{PS}}(\text{line}_ {\theta_{4}-\theta_{5}})+2\cdot\text{SNR}_{\text{PS}}(\text{line}_{\theta_{1 }-\theta_{5}})}{\text{SNR}_{\text{PS}}(\text{line}_{\text{SD}})}. \tag{71}\]  
Furthermore, Equation (71) can be reduced from Equations (43), (65) and (66) as follows:  
\[\text{ratio}(\text{SGAD},\text{SD})=\frac{\sqrt{\text{SNR}_{\theta_{4}- \theta_{5}}}+2\sqrt{\text{SNR}_{\theta_{1}-\theta_{5}}}}{\sqrt{\text{SNR}( \text{line}_{\text{D}_{\text{ce}}})}}. \tag{72}\]  
Let  
\[f=-\mathbf{F}_{\mathbf{b}\ast s}^{\prime\prime}|_{x=L} \tag{73}\]  
and  
\[R=9-16\rho_{\sqrt{2}}+6\rho_{2}+\rho_{2\sqrt{2}}. \tag{74}\]  
Then, \(\text{ratio}(\text{SGAD},\text{SD})\) can be derived from Equations (14), (39), (61), (62), (72), (73) and (74) as follows:  
\[\text{ratio}(\text{SGAD},\text{SD})=\big{[}2\sqrt{2}\pi\frac{g}{f}\big{]}^{ \frac{1}{2}}R^{\frac{1}{4}}\big{[}(P_{1}+P_{3})^{\frac{-1}{4}}+2(Q_{1}+Q_{2})^{ \frac{-1}{4}}\big{]}. \tag{75}\]  
In Equation (75), \(\frac{g}{f}\) is derived from Equations (13) and (14) as follows:  
\[\frac{g}{f}=\frac{\sigma_{b}^{2}+\sigma_{s}^{2}}{w}\big{[}e^{\frac{w-1}{2( \sigma_{b}^{2}+\sigma_{s}^{2})}}-e^{-\frac{w-1}{2(\sigma_{b}^{2}+\sigma_{s}^{2} )}}\big{]}. \tag{76}\]As shown in Equation (76), ratio(SGAD,SD) changes with the variations of \(\sigma_{b}\), \(\sigma_{s}\), and \(w\), but does not change with the variation of \(\sigma_{n}\). To investigate the performance of the SGAD-based line detection, the graphical plots of SNR are used as shown below. The values of SNR used are generated under the same conditions as applied in Section 3.4. Figure 8 shows the difference, \(\text{SNR}_{\text{PS}}(\text{line}_{\text{SGAD}})-\text{SNR}_{\text{PS}}( \text{line}_{\text{SD}})\). According to Figure 8, the SGAD-based line detection has higher SNR than the SD-based line detection under varying conditions of the line width and the smoothing factor. When the smoothing factor of 1.0 is applied, the advantage of the SGAD-based line detection becomes distinct for a line width less than 8 pixels.