# Texture Construction Edge Detection Algorithm
## 2 Texture Construction Edge Detection Algorithm
### Optimal Edge Thinning Process
Therefore, when the adjacent \(P\) block has adjacent point \(p6\) or \(p7\), it corresponds to the \(P\) block texture template of Table 4; when the adjacent \(Q\) block \(q7\) has edge points, it corresponds to the \(Q\) block texture template of Table 5; and when the adjacent \(R\) block \(r1\) or \(r8\) has edge points, it corresponds to the \(R\) block texture template of Table 6. \(x4\) is the \(R\) block texture template corresponding to Table 7 and \(x5\) is adjacent to \(R\) and \(S\) 2 blocks. When the adjacent \(R\) block \(r7\) or \(r8\) has edge points, it corresponds to the \(R\) block texture template of Table 8; when the adjacent \(S\) block \(s1\) has edge points, it corresponds to the \(S\) block texture template of Table 9. During the lookup process, when the texture distribution of all adjacent blocks matches the corresponding texture template, the block texture extension analysis is completed and all required positions in the \(X\) block and adjacent areas are recorded, and the next step in the flowchart is followed. If this is not the case, it goes to the cross-block texture extension judgement. When there are two edge points, they are divided into the left side of \(x1\), \(x2\), and \(x3\) and upper side of \(x3\), \(x4\), and \(x5\), according to the distribution position of \(x1\)-\(x5\) in the \(X\) block, and whether the two points are on the same side is judged by the position of the edge point. When the two edge points do not fall on the same side, the method is the same as the one edge point, and the adjacent block texture templates are sequentially checked and compared; when the two edge points are located on the same side, there are three cases on the left side, comprising \(x1\) and \(x2\), \(x1\) and \(x3\), and \(x2\) and \(x3\), and the corresponding \(P\) block texture templates are shown in Tables 10-12. When there is an edge point in \(x3\) and because it is adjacent to the \(Q\) and \(R\) blocks, when the \(Q\) block \(q7\) has an edge point or the \(r1\) or \(r8\) in \(R\) block has an edge point, one will sequentially lookup and compare the corresponding Tables 5 and 6. There are three cases of \(x3\) and \(x4\), \(x3\) and \(x5\), and \(x4\) and \(x5\) on the upper side, and the corresponding \(R\) block texture templates are shown in Tables 13-15. When there is an edge point in \(x3\) and because it is adjacent to the \(P\) and \(Q\) blocks, when the \(P\) block \(p5\) or \(p6\) has an edge point or the \(Q\) block \(q7\) has an edge point, one will sequentially look up and compare the corresponding Tables 4 and 5. When \(x5\) has edge points and because it is adjacent to the \(S\) block, it must be compared with the corresponding Table 9 when the \(S\) block \(s1\) has edge points. In the process of checking the table, when the texture distribution of the adjacent block matches the corresponding texture template, the block texture extension analysis is completed and all required positions in the \(X\) block and adjacent areas are recorded, and the next step in the flowchart is followed. If this is not the case, the cross-block texture extension judgement is performed. When there are three edge points, there are two cases according to the distribution position of \(x1\)-\(x5\) in the \(X\) block. In the first case, when \(x3\) has edge points, there will be two edge points on both the left and upper sides. In the second case, when \(x3\) has no edge point, there are two points on one side and one point on the other side. For the case where there are two points on one side, the block texture extension analysis is performed in the manner of the above two edge points, and in the case where there is only one point on one side, the block texture extension analysis is performed in the manner of the above one edge point. Next, when the adjacent block texture extension is judged in the table comparison process, the method of judging the cross-block texture extension is further required when the non-conforming block texture template is checked.