## 3 Image-Servo Control and Pattern Recognition of the Positioning Mark
### Image Recognition Using COG and GHT  
To compare the difference between the COG method and the generalized HT (GHT) method for the image recognition, four case studies are designed to check the robustness of these two methods. As shown in Figure 12, the first case is the normal situation of the lower circle mark; the second case is the special situation of the partial lower circular mark; the third is the normal situation with the upper and lower marks; the fourth is the special situation of the full upper mark with the partial lower mark. Table 7 shows the experimental results for these two methods (COG, GHT), where the resulting data is the average root mean square error of 100 different experiments with the same situation. For Case 1 with the full circle mark, the COG is much better than the GHT. However, for Case 2 with the partial circle mark, the error of the COG is the two times that of the GHT. After comparing the results with the upper mark, Case studies 3 and 4 are used to examine the image recognition for the cases with the upper and lower marks. The GHT is better than the COG in Cases 3 and 4. According to the results summarized in Table 1, whether the lower mark is full or partial, the experimental results show that the GHT has a smaller error than the COG. the target position to be aligned. To compute the command of the XXY stage to make the lower mask align with the upper mask (the red block), the green dot is the fiducial mark for the lower mask and the red circle is the fiducial mark of the upper target to be aligned. After obtaining the image positions in the ROI using the above GHT method, the self-developed code is used to transfer the masks' positions in the image space to the Cartesian-space's coordinates. In Figure 13, (\(x1,y1\)) and (\(x3,y3\)) represents the initial coordinates of the lower fiducial marks; (\(x2,y2\)) and (\(x4,y4\)) are the target coordinates of the upper fiducial marks. To make the lower mask align with the upper mask, the motors' command of the XXY stage \(\mathbf{m}=[dx1\ dx2\ dy]^{T}\) is needed to achieve the alignment task. If the desired translation and angular displacement of the stage [\(\delta x\ \delta y\ \delta\)]^{T}\) is known, the command \(\mathbf{m}\) can be obtained from Equation (7). In fact, the desired [\(\delta x\ \delta y\ \delta\)]^{T}\) can be obtained according to the relationship between [(\(x1,y1\)), (\(x3,y3\))] and [(\(x2,y2\)), (\(x4,y4\))] as follows. From Figure 11, the blue block using dotted line represents only translation movement with \(\overset{\rightarrow}{t}=[\ \delta_{x}\ \ \ \delta_{y}]^{T}\) and the final target orientation is the red block which is the form of giving the blue block a rotational movement of \(\delta\)0. Therefore, the kinematic relationship can be described as follows. \[\overset{\rightarrow}{t}=\overset{\rightarrow}{q}_{1}^{\prime}+\overset{ \rightarrow}{c}_{1}-\overset{\rightarrow}{q}_{1} \tag{9}\] \[\overset{\rightarrow}{t}=\overset{\rightarrow}{q}_{2}+\overset{ \rightarrow}{c}_{2}-\overset{\rightarrow}{q}_{2}\]  
where \(\overset{\rightarrow}{c}_{1}=[x_{2},y_{2}]^{T}-[x_{1},y_{1}]^{T}\), \(\overset{\rightarrow}{c}_{2}=[x_{4},y_{4}]^{T}-[x_{3},y_{3}]^{T}\) are obtained by AOI code and \(\overset{\rightarrow}{q}_{1}^{\prime}\), \(\overset{\rightarrow}{q}_{2}^{\prime}\) are system parameters and known. Without considering the rotational movement, there is only translation movement which implies that \(\overset{\rightarrow}{t}=\overset{\rightarrow}{c}_{1}=\overset{ \rightarrow}{c}_{2}\), where \(\overset{\rightarrow}{q}_{1}=\overset{\rightarrow}{q}_{1}^{\prime}\), \(\overset{\rightarrow}{q}_{2}=\overset{\rightarrow}{q}_{2}^{\prime}\). Now, consider the rotational movement \(\delta\)0 between \(\overset{\rightarrow}{q}_{1}\) and \(\overset{\rightarrow}{q}_{1}^{\prime}\) as the same as \(\overset{\rightarrow}{q}_{2}\) and \(\overset{\rightarrow}{q}_{2}^{\prime}\).