## 2 Methods and Materials
### Dataset Production  
#### 2.2.1 Generated RGB-D Tree Crown Images  
The spraying robots are required to locate citrus crowns in a given planting row. To simplify the spraying process for this study, only the citrus crowns nearest the sensor on the planting line were marked as the current spraying target in each frame. According to the characteristics of orange orchard row planting, when the fruit trees in the back row are used as the background for image segmentation, they are often misjudged as spraying areas. Therefore, this paper uses the distance between the points in the tree crown depth map and the photographing center of the three-dimensional space [25] to process the depth-obtained image data. According to the distance between the camera and tree crown in the front and back scenes, the depth image segmentation method is used to eliminate the redundant image information outside the effective spraying range to block the interference  
Figure 1: Equipment used: (**a**) citrus plantation, (**b**) image acquisition equipment.  
Figure 2: Example citrus tree images: (**a**) forward light, (**b**) slight backlight, (**c**) severe backlight, (**d**) seedling stage, (**e**) flourishing stage, (**f**) fruiting stage.  
of other background trees. The RGB-D image generation process is shown in Figure 3. The RGB images (1280 \(\times\) 720 pixels at 69\({}^{\circ}\)\(\times\) 42\({}^{\circ}\)) and depth images (848 \(\times\) 480 pixels at 87\({}^{\circ}\)\(\times\) 58\({}^{\circ}\)) differ in terms of resolution and field-of-view. Therefore, in order to obtain the depth values corresponding to the pixels in the color graph, it is necessary to convert the image coordinate system of the depth image into that of the RGB image to maintain pixel-point consistency. The matrix is transformed using Equations (1)-(3) to establish a correspondence between the RGB image coordinates and depth image coordinates. Second, redundant and background information are removed by setting the depth threshold as shown in Equation (4); thus, only the foreground tree crown is retained. For example, when the camera (on the platform) is 1.2 m away from the tree, and the total depth of the tree crown (including branches and leaves) is 0.8 m, the areas of depth data exceeding 2 m are removed and shown in black.  
\[T=\begin{pmatrix}R&t\\ 0&1\end{pmatrix} \tag{1}\]  
\[T^{-1}=\begin{pmatrix}R^{-1}&-R^{-1}t\\ 0&1\end{pmatrix} \tag{2}\]  
\[T_{d\omega}=T_{u2c}T_{u2d}^{-1}=\begin{pmatrix}R_{w2c}R_{w2d}^{-1}&t_{w2c}-R_{ w2c}R_{w2d}^{-1}t_{w2d}\\ 0&1\end{pmatrix} \tag{3}\]  
\[depth(x,y)=\begin{cases}depth(x,y),&\text{if }d\textless depth(x,y)<D\\ 0,&\text{otherwise}\end{cases} \tag{4}\]  
In Equations (1)-(3), \(T\) represents the Euclidean transformation matrix; \(R\) is the rotation matrix (and also the unit orthogonal matrix); \(t\) is the translation amount of the axis; \(T_{w2d}\) represents the external parameter of the depth camera; \(T_{w2c}\) represents an external parameter of the RGB camera, and \(T_{d2c}\) represents a transfer matrix of the depth camera to the RGB camera. In Equation (4), \(depth(x,y)\) represents the depth value of the pixel \((x,y)\), and \(d\) and \(D\) are the two thresholds.