# A Vision Servo System for Automated Harvest of Sweet Pepper in Korean Greenhouse Environment
## 3 Results and Discussion
### Set-Up of Control Variables  
An experiment was carried out to make the center of the sweet pepper detected from the image of the sweet pepper that existed in 350-600 mm distance matched with the center of camera, and then use the necessary control variables to control the manipulator to directions of vertical (Y) and horizontal (X). The rotation axis was made to rotate by 2.4\({}^{\circ}\) per 10,000 pulses, and the horizontal axis was made to be controlled by 10 mm per 10,000 pulses. The size of a pixel corresponding to a length of 30 mm at a distance of 350 mm and a distance of 600 mm was measured. The position of the changed pixel was calculated according to the angle change. When the distance from the camera was 350 mm, the number of pixels occupied by the 30 mm length line in the image was 342 pixels. When the distance from the camera was 600 mm, the number of pixels occupied by the 30 mm length line in the image was 127 pixels. The actual length of one pixel at each distance was 0.088 mm at a distance of 350 mm and 0.236 mm at a distance of 600 mm. When 1 pixel changes in 350 mm distance, 02 must be controlled by 0.014\({}^{\circ}\). On the other hand, when 1 pixel changes in 600 mm distance, 02 must be controlled by 0.023\({}^{\circ}\). However, it was not possible to control the information of distance in the experiment, and therefore the angle was controlled only  
Figure 18: Extracted sweet peppers. by the average 0.018\({}^{\circ}\) for 1 pixel. Since the rotating axis can rotate 2.4\({}^{\circ}\) per 10,000 pulses, 75 pulses must be given to rotate 0.018\({}^{\circ}\). In other words, 75 pulses for 1 X-axis pixel are used to control 02. As it approaches the center of the picture and the difference of X-axis pixels is less than 15, 50 pulses are used to control the pose accurately. As for the Y-axis control based on correlation between pixels and distances presented in Table 1, change of 1 pixel in an image is 0.088 mm on 350 mm distance, and 0.236 mm on 600 mm distance. As in the control of the X-axis, an average of 0.16 mm per pixel are used to control L3. A total of 160 pulses per Y-axis pixel was used to control L3. As a result of the control experiment using the set control variables, it was confirmed that the error diverges without converging to 0 based on \(\pm\)30 pixels. Therefore, when the Y-axis pixel errors were less than 30, 100 pulses per pixel were used to control. Since harvest was carried out with the sweet pepper that exists within the distance of 90\(\sim\)150 mm from the camera installed at the end-effector, the change of distance per pixel in that scope of distance was measured. Table 1 presents the change of the image coordinate for the 10 mm change of spatial coordinate from the distances of 90, 110, 130, and 150 mm, through the camera of the end-effector. The table presents that the difference of measurement from the distance of 90 mm is bigger than that from any other distances. This difference seems to be caused by the distortion of the image that is taken at a close distance. Therefore, on the basis of 10 mm/100 pixels, L3 for the control of the Y-axis in three steps were established at 100 pulses/per pixel. In addition, in order to convert the result to angles, it is necessary to have the value of the manipulator L1 variable. \[\alpha=2\tan^{-1}\left(\frac{1}{L1+230}\right), \tag{10}\]  
Equation (10) presents the calculation of angle \(\alpha\) for the change of 1 mm X coordinate using L1 variable. Angle \(\alpha\) is used to calculate the control pulse of 02 according to the angle per pulse. Table 2 presents the result of the experiment. Repeated 20 times, the table presents the errors of the X-axis and Y-axis, together with the times of control executed in every experiment. In order to detect the position of the sweet pepper from the image and then move the end-effector to the target position, it was necessary to carry out an average 4.15 times of controlling process. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**No.