# Texture Construction Edge Detection Algorithm
## 2 Texture Construction Edge Detection Algorithm
### Optimal Edge Thinning Process
The cross-block texture extension judges that the position of the edge point of \(x1\)-\(x5\) in the \(X\) block is used as a judgment starting point, and searches for and extends the adjacent edge point by a range of eight adjacent points. When the adjacent edge points are less than three, and none of them are marked as a valid point, the \(X\) block and the adjacent edge points are not marked, and then, the block texture extension analysis is completed and the next step of the flowchart is performed. When the number of adjacent edge points is within three (inclusive) and there are edge points marked as valid, the block texture extension analysis is completed and all required positions in the \(X\) block and the adjacent areas are recorded, and the next step in the flowchart is followed. When the number of adjacent edge points reaches three, the block texture extension analysis is completed and all required positions in the \(X\) block and the adjacent areas are recorded, and the next step in the flowchart is followed. Two examples are used to illustrate the analysis process of adjacent block texture extension judgment and cross-block texture extension judgment. First, in the adjacent block texture extension analysis, a more complex three-point edge in \(X\) block \(x1\)-\(x5\) is used. Figure 10 shows a schematic of the texture extension of adjacent blocks. First, one determines the number of edge points of \(x1\)-\(x5\) in the \(X\) block, and knows that in the \(X\) block, there are three edge points, consisting of \(x1\), \(x3\), and \(x5\). Then, one can determine that \(x1\)-\(x5\) is in the \(X\) block according to the distribution position of the above three points in the block. Because there is an \(x3\) edge point, there are two edge points on both the left and upper sides, so one sequentially checks whether the adjacent blocks have adjacent points. When there are adjacent points, the adjacent block is further checked and compared. To start the next step, one checks the edge point of the adjacent \(P\) block \(p7\), and then compares the \(P\) block texture template of Table 11 with two points on the left side. Table 11 shows that the \(P\) block texture code is 000000111 and the decimal is 7, so one knows that the data in the first column is consistent. When the adjacent \(Q\) block \(q7\) has edge points, based on the \(Q\) block texture template corresponding to Table 5 to check the table comparison, it can be known that the \(Q\) block texture code is 010010001, the decimal is 145, and it is consistent with the third data in the fourth column in Table 5. When the block texture of the adjacent block \(R\) has no adjacent points, no table lookup is performed. When the adjacent \(S\) block s1 has edge points, it corresponds to the \(S\) block texture template in Table 9. From the table lookup and comparison, it can be known that the \(S\) block texture code is 000001110, the decimal is 14, and it is consistent with the second data of the first column in Table 9. The block texture extension analysis is then completed and the next step of the flowchart is performed after recording all required positions of edge points in the \(X\) and the adjacent \(P\), \(Q\), and \(S\) blocks. Figure 11 shows the cross-block texture extension diagram. First, one determines the number of edge points of \(x1\)-\(x5\) in the \(X\) block and finds that \(x2\) has one edge point. One then checks the edge points in the adjacent block and finds that there is an edge in the \(P\) block \(p6\); the table comparison is performed with the \(P\) block texture template corresponding to Table 3. After checking the table, there is no matching data, and the cross-block texture extension judgment is performed. First, one searches for eight adjacent points with \(x2\) as the center to find \(p6\). Then, one searches for eight adjacent points centered on \(p6\), and finds \(p4\). Finally, one searches for eight adjacent points with \(p4\) as the center and finds \(q8\).