# Table Recognition for Sensitive Data Perception in an IoT Vision Environment
## 3 Recognition Method Design
### Directional Connected Chain (DCC)  
DCC is a novel image structure element and is made up of run lengths. The definition of a run length and Directional Connected Chain (DCC) are explained in this section. Run length includes horizontal run length and vertical run length. Vertical run length is a black continuous pixel segment in the vertical direction and the segment width is only one pixel. Correspondingly, horizontal run length is a black continuous pixel segment in the horizontal direction and the segment length is only a \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Symbol** & **Notation** & **Symbol** & **Notation** \\ \hline \(R\) & run length & \(T_{dis}\) & the threshold of overlapped distance \\ \(k\) & _theslope_\(l\) & _end_\(\mathit{idx}\) & the x-coordinate of the end point of \(l_{i}\) \\ \(l\) & the fitting line & \(\mathit{start_{ix}}\) & x-coordinate of the starting point of \(l_{i}\) \\ \(W_{k}\) & the weight of \(k\) & \(M_{l}\)_time_ & the threshold of the length of run length \\ \(b\) & the intercept of \(l\) & \(d_{PL}((x,y),C)\) & the distance from the point (\(x,y\)) to \(C\) \\ \(\text{len}(C_{i})\) & the length of \(C_{i}\) & \(diff_{o}(C_{1},C_{2})\) & overlapped deviation between \(C_{1}\) and \(C_{2}\) \\ \(C\) & directional connected chain & \(GapT(C_{1},C_{2})\) & threshold of interval distance between \(l_{1}\) and \(l_{2}\) \\ \(A\) & perspective transformation matrix & \(p(C_{i},x)\) & y-coordinate predicted by \(C_{i}\) when x-coordinate is \(x\) \\ \(d_{LL}(C_{1},C_{2})\) & overlapped distance & \(D(C_{1},C_{2})\) & distance between \(l_{1}\) and \(l_{2}\) on horizontal direction \\ \(T_{diff}\) & the threshold of overlapped mistake & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The notations of symbols. Figure 2: Table-recognition process. DCC: Directional Connected Chain. pixel. Figure 3 is an image consisting of pixels, in which \(R_{1}\) is a vertical run length, \(R_{3}\) is a horizontal run length, and \(R_{2}\) can represent both a horizontal run length and a vertical run length. DCC is a series of adjacent run lengths. It includes horizontal DCC and vertical DCC. Horizontal DCC is made up of a series of adjacent vertical run lengths, and it is used to detect horizontal lines and diagonal lines whose angles are less than 45\({}^{\circ}\). Correspondingly, vertical DCC is made up of a series of adjacent horizontal run lengths, and it is used to detect vertical lines and diagonal lines whose angles are larger than 45\({}^{\circ}\). DCC can go in any direction by connecting run lengths. Therefore, DCC can be used to represent a diagonal line. As Figure 4 shows, the vertical run lengths through which the red line passes make up a horizontal DCC. Perspective transformation makes table ruling lines become diagonal lines of different diagonal angles. In addition, most stamps and signatures are in an irregular shape, which are easy to distinguish from long straight lines in tables. Therefore, DCC is used in this paper to achieve table recognition. DCC can represent the straight line of a table, so the DCC search is a key step in table recognition. As Figure 4 shows, DCC search can be divided into two steps: determining the direction of a DCC, and predicting the run lengths that should be on the DCC. The first step is to determine the direction of DCC. DCC is made up of adjacent run lengths, but adjacent run lengths can be either singly connected or non-singly connected. For a run length,  
Figure 4: Searching a horizontal DCC. Figure 3: Run length. if there is only one adjacent run length on each side, such as \(R_{2}\), or one side has no run length and one side has only one connected run length, such as \(R_{1}\), it is singly connected. Otherwise, it is non-singly connected, such as \(R_{12}\). The DCC will create branches and goes to several directions if there is a non-singly connected run length. In addition, the first \(T_{n}\) run lengths will determine the direction of a DCC.