# Irregular Workpiece Template-Matching Algorithm Using Contour Phase
## 4 Experimental Analysis and Verification  
The object of this experiment is the backrest and cushion of the child seat, and the irregular artifacts to which our proposed algorithm is mainly applied are based on these products. During the mixing spray adhesive process of the backrests and cushions, it is necessary to identify which product the incoming material is, that is, we need to compare it with the template database, which contains the backrests and cushions data of all models of the company. To verify the validity of this algorithm, several products need to will be taken from the template database to form a sub-template database. As Figure 6 shows, the KB-Left and the KB-Right are mirrored symmetrically and the contour curves of the four template workpieces are shown in Figure 7.  
A target product is selected from each of the KB-Left, KB-Right, ZD631, and ZD632 models, and the target product relative to the template rotation angle is: \(-18^{\circ},22^{\circ},180^{\circ},90^{\circ}\). Then the matching experiments are conducted using the algorithm proposed in this paper and the external rectangle algorithm proposed in the literature [21; 22; 23]. The matching results by the algorithm proposed in this paper are shown in Figure 8.  
Figure 6: Sub-template work piece database. Figure 7: Sub-template workpiece contour curve. The specific matching results compared with the external matrix algorithm are shown in the following Table 2.  
To further verify the effectiveness of the algorithm, some of the shaped workpieces mentioned in the previous sections are selected for verification comparison. The model's names for the target workpiece are B and B-Mirror. The rotation angles of the target product with respect to the template are \(-70^{\circ}\) and \(-180^{\circ}\). The matching results are shown in Figure 9.  
The specific matching results compared with the external matrix algorithm are shown in the following Table 3. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{\begin{tabular}{c} **Target Work** \\ **Piece** \\ \end{tabular} } & \multirow{2}{*}{\
\begin{tabular}{c} **Rotation Angle** \\ **(Degree)** \\ \end{tabular} } & \multirow{2}{*}{**Template**} & \multicolumn{2}{c}{**The Proposed**} & \multirow{2}{*}{**Error**} & \multirow{2}{*}{
\begin{tabular}{c} **Calculation Angle of Exterior** \\ **Rectangle**[21; 22; 23] **(Degree)** \\ \end{tabular} } & \multirow{2}{*}{**Error**} \\  & & & & & & \\ \hline KB-Left & \(-18\) & KB-Left & \(-17.9275\) & \(0.40\%\) & \(-18.0098\) & \(0.05\%\) \\ KB-Right & \(22\) & KB-Right & \(22.0169\) & \(0.07\%\) & \(22.2304\) & \(1.04\%\) \\ ZD631 & \(180\) & ZD631 & \(180\) & \(0\) & \(0\) & \(100\%\) \\ ZD632 & \(90\) & ZD632 & \(90\) & \(0\) & \(0\) & \(100\%\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Target workpiece phase difference match. Figure 8: Target workpiece phase difference match. (**a**) \(-18^{\circ}\) Rotation of the KB-Left; (**b**) \(22^{\circ}\)rotation of the KB-Right; (**c**) \(180^{\circ}\)rotation of the ZD631; (**d**) \(90^{\circ}\)rotation of the ZD632. From the above results, the phase difference algorithm proposed in this paper adapts well to the matching of various types of irregular workpieces, with the maximum error of the rotation angle of the target workpiece relative to the template calculated by the algorithm is at most 1%. When the long and short shafts of the workpiece differ greatly, the rotation angle calculated by the external rectangular algorithm proposed by the reference [21; 22; 23] is close to the actual angle, but the error is slightly larger than that calculated by the algorithm in this paper. With slightly difference, the external rectangular algorithm does not work and the algorithm proposed in this paper has high accuracy. As long as the target workpiece has a position or angle deviation from the template workpiece, the phase difference algorithm works.