# Line Segment Matching Fusing Local Gradient Order and Non-Local Structure Information
## 3 Methodologies
### Non-Local Structural Information Encoding  
[PERSON] et al. [30], [PERSON] et al. [31], and [PERSON] et al. [32] pointed out that non-uniformity is useful for describing some texture structures and [PERSON] et al. [29] used non-local structural information for encoding and obtained some resistance to noise. Most of the common methods focus only on the local information. For better robustness, the non-local structural information is encoded in this work. The non-local structure information encodes the  
Figure 4: \(H_{m}(x_{i})\) Histogram construction demonstration.  
inter-relationship between sampled pixels and pixels outside the line support region. For better adaptivity, several anchor points based on global intensity information are computed.  
By encoding the intensity relationship between locally sampled points and non-local anchor points, the structural variation of line segments concerning the whole image is obtained. In this case, the structural information obtained based on the global image has better robustness compared to local information [27; 29; 33]. The local gradient order descriptor ignores the center of sample points, nevertheless, this central point information can be supplemented by encoding non-local information.  
[PERSON] [29] used the method of sorting intensity to calculate anchor points. However, sorting intensity is computationally expensive. Therefore, the image intensity histogram proposed above is taken to calculate the anchor points.  
Suppose that there are \(W\) pixels in the image, and the histogram is defined as \(H_{I}=\{H_{0},H_{1},H_{2},\cdots,H_{255}\}\). According to Equation (2), the intensity histogram of the image is divided into \(V\) intervals, and there are \(V-1\) intensity thresholds defined as \(T_{k},k\in[1,V-1]\). Thereafter, calculate an anchor for each interval as follows:  
\[\Delta_{Av}=\frac{1}{\left[W/V\right]}\sum_{I=T_{k}-1}^{I=T_{k}}H_{I}\times I \tag{12}\]  
Figure 5: Demonstration of local gradient order descriptor construction process.  
where \(I\) is intensity, \(\Delta_{Av}(ve[1,V])\) denotes the intensity of the \(v\)th anchor. In order for \(v=1\), \(T_{0}=0\) is set. Figure 6 illustrates this process by taking \(v=4\), \(P=9\). The anchor points calculated by the intensity histogram are rotation-invariant. When the intensity of the image changes monotonically, the anchor points will also change.  
Then, according to the relationship between the sampling point and the anchor point, the uniformity measurement \(U\) is obtained:  
\[\begin{split} U(x_{i})&=\Big{|}s\Big{(}I_{x_{i_{ p}}}-\Delta_{Av}\Big{)}-s\Big{(}I_{x_{i_{1}}}-\Delta_{Av}\Big{)}\Big{|}\\ &+\sum_{p=1}^{P-1}\Big{|}s\Big{(}I_{x_{i_{p}}}-\Delta_{Av}\Big{)} -s\Big{(}I_{x_{i_{p-1}}}-\Delta_{Av}\Big{)}\Big{|}\end{split} \tag{13}\]  
where \(U(x_{i})\) is defined as the uniformity of a pixel \(x_{i}\) in the LSR. \(I_{x_{i_{p}}}\) is the intensity value of the sampling point centered on \(x_{i}\). \(s(\cdot)\) is defined as  
\[\text{s}(a)=\left\{\begin{array}{l}1,a\geq 0\\ 0,a<0\end{array}\right. \tag{14}\]  
In combination with uniformity measurement, encode the pixels in the line support region:  
\[\text{Index}_{i,v}=\left\{\begin{array}{ll}\sum_{p=0}^{P-1}s\Big{(}I_{x_{i_{ p}}}-\Delta_{Av}\Big{)},&U(x_{i})\leq 2\\ P+1,&U(x_{i})=4\\ P+2,&U(x_{i})=6\end{array}\right. \tag{15}\]  
where \(Index_{i,v}\) represents the index of the non-local structural information histogram of the pixel \(x_{i}\). Then, the histogram corresponding to the \(v\)th anchor point is obtainable:  
\[\text{H}_{v}=\sum_{x_{i}\in\Omega}\left(\begin{array}{ll}0,\cdots,0,&1&,0, \cdots,0\\ &Index_{i,v}\end{array}\right) \tag{16}\]  
The dimension of \(H_{v}\) is \(P+3\), and then cascade the \(V\) histograms to obtain:  
\[\text{D}_{non-local}=(H_{1},H_{2},\cdots,H_{V}) \tag{17}\]  
Figure 7 illustrates the calculation of a non-local descriptor.  
Figure 6: Demonstration of anchors generation.