*3.3. Results of Tree-Row Line Fitting*

Determining the position of each fruit tree in the image is the basis of orchard mechanical operation, which can obtain the straight line of fruit trees on both row sides. The fitting results of reference lines on both sides of the fruit tree row under different sunlight are shown in Figure 11, including weed environment, strong sunlight, weak sunlight, and normal sunlight. The analysis of the line fitting of fruit tree rows is shown in Table 3.

(**a**) corridor with weed (**b**) strong sunlight (**c**) weak sunlight

(**d**) normal sunlight on a corridor with leaves (**e**) normal sunlight

**Figure 11.** Reference line of a fruit tree row under different sunlight.

**Table 3.** Accuracy of line fitting of the fruit tree rows.


Thirty images were selected to test the accuracy of the fruit tree line fit, all of which included both left and right fruit tree rows. The four environments were weeded, low light, high light, and normal light. There were 7 images of the weedy environment, 7 images of the low light environment, 7 images of the high light environment, and 9 images of the normal light environment. When performing this study, the fitted lines should describe the fruit tree rows evenly and accurately, with errors categorized as right-leaning or left-leaning on the left side and right-leaning or left-leaning on the left side. Sixty lines were included in the 30 images, divided into 30 lines on the left and 30 lines on the right side; the specific fruit tree lines fitted are shown in Table 3. In the weed environment, one line on the left side of the tree was fitted to the left, while the other 13 lines were fitted correctly. In the weak-light environment, one line on the left side was fitted to the left, while the other 13 lines were fitted correctly. The right fruit tree row line was fitted to the right in the strong-light environment, while the other 13 were fitted correctly. Under normal light conditions, one line on the left side of the tree was fitted to the left and one line on the right side of the tree was fitted to the right, while the remaining 16 lines were fitted correctly. A total of 55 lines were fitted correctly and 5 lines were fitted inaccurately. The average accuracy of the fruit tree line fits was calculated to be 91.67%.
