A method and system for precise pesticide application by drone based on machine vision

Through the canopy pixel segmentation and target detection and tracking algorithm of machine vision technology, precise drone spraying is achieved, which solves the problems of uneven spraying of fruit trees and waste of pesticides, and improves the efficiency and accuracy of fruit tree spraying.

CN117598273BActive Publication Date: 2025-10-03AGRI MACHINERY INST CHINESE TROPICAL ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311648935.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2025-10-03
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

Existing drone spraying technology cannot accurately spray according to the size of the fruit tree canopy, resulting in problems such as pesticide waste and low efficiency, and poor anti-interference ability.

Method used

Using machine vision technology and the FastSAM model for canopy pixel segmentation, combined with YOLOX target detection and DeepSORT target tracking algorithms, the drone spraying route is pre-designed, the volume and number of tree canopies are calculated, the amount of pesticide is accurately configured, and precise application of pesticides is achieved.

Benefits of technology

It improves the accuracy and efficiency of pesticide application, reduces pesticide waste, and enhances spraying stability and anti-interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117598273B_ABST
    Figure CN117598273B_ABST
Patent Text Reader

Abstract

The present invention provides a method for precise pesticide application using a drone based on machine vision. The method obtains images and videos of the pesticide application area by pre-designing the drone spraying route, and accurately segments the tree canopy pixels using a pixel segmentation model based on machine learning, effectively ensuring the accuracy of tree canopy volume calculation. At the same time, the present invention combines a target detection algorithm and a target tracking algorithm to count the number of trees in the video, and finally accurately calculates the total amount of pesticide sprayed, which can effectively improve the accuracy of pesticide application, reduce pesticide waste, and provide a reference idea for precise pesticide application of trees. In addition, since the present invention pre-plans the spraying route and accurately calculates the amount of pesticide applied in the pesticide application area, and then directly performs the spraying operation, there is no need to repeatedly adjust the drone posture during the operation, which effectively improves the efficiency, stability and anti-interference of the spraying operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision and unmanned aerial vehicle (UAV) control, and more specifically, to a method and system for precise pesticide application by an unmanned aerial vehicle (UAV) based on machine vision. Background Art

[0002] Fruit tree pesticide application is an essential step in fruit cultivation. However, my country's orchards are primarily concentrated in hilly and mountainous areas. Due to the constraints of planting patterns and complex topography, large-scale pesticide application equipment is difficult to use. Consequently, fruit tree pesticide application is still primarily done with backpack handheld sprayers, which suffer from low efficiency, high costs, and uneven spraying. They are also prone to missed or inaccurate spraying, impacting production efficiency and quality.

[0003] With the continuous development of drone technology, drones are increasingly being used in agriculture, becoming a vital tool for agricultural operations. Drones offer excellent spraying effectiveness and high efficiency, making them a widespread application in agricultural spraying. They can effectively address the problem of spraying fruit trees in hilly and mountainous areas. However, current drone spraying methods primarily focus on metered application, failing to precisely tailor spraying to the size of the fruit tree canopy. This leads to pesticide waste and other issues. Combining machine vision with drone precision spraying can effectively address this issue.

[0004] The prior art discloses a method for controlling precise spraying of a crop protection drone. The drone is equipped with a machine vision camera and an infrared thermal imaging camera. The method includes subjecting the pesticide to temperature control and then spraying the temperature-controlled pesticide on the spraying target according to the planned spraying route and the set spraying angle. A temperature difference is formed between the sprayed area and the unsprayed area on the spraying target. During spraying, the machine vision camera and the infrared thermal imaging camera are used to collect visible light images and infrared images of the spraying target, respectively. After image processing, the total spraying target area St is obtained. and the total area of ​​the sprayed area Sc, compare St and Sc to obtain the un-pesticided area and the area of ​​the un-pesticided area, and readjust the spraying angle of the spraying device or the flight path of the drone according to the area of ​​the un-pesticided area and the area of ​​the un-pesticided area to compensate for the spraying deviation; the spraying control method in the prior art requires multiple detections of the spraying effect during the spraying process, and continuously adjusts the spraying angle multiple times according to the detected spraying effect to achieve precise spraying, which is time-consuming and labor-intensive, and has low efficiency; and the spraying route needs to be adjusted multiple times during the spraying process, and the stability and anti-interference performance are also poor. Summary of the Invention

[0005] In order to overcome the defects of the above-mentioned existing technologies in precision pesticide application, such as low efficiency, large waste of pesticide liquid and poor anti-interference ability, the present invention provides a method and system for precision pesticide application using drones based on machine vision. Through the method of machine vision, the drone spraying route is pre-designed and the total amount of pesticide sprayed is obtained more quickly, which can improve the accuracy of pesticide application, reduce pesticide waste, and provide a reference idea for precise pesticide application of trees.

[0006] In order to solve the above technical problems, the technical solutions of the present invention are as follows:

[0007] A method for precise pesticide application using a drone based on machine vision is provided for precisely applying pesticides to trees, comprising the following steps:

[0008] S1: The drone flies in a pesticide application area according to a preset flight route and captures image data and video data of the pesticide application area in real time; the pesticide application area contains a plurality of trees to be pesticided;

[0009] S2: Preprocess all acquired images of the spraying area, perform canopy pixel segmentation on all trees in each preprocessed image using a preset pixel segmentation model, and calculate the actual canopy volume of each tree based on the segmented canopy pixels of each tree;

[0010] Calculate the amount of pesticide required for each tree based on the actual canopy volume of all trees;

[0011] S3: Counting the number of all trees in the video data of the spraying area using the target detection algorithm and the target tracking algorithm to obtain the number of trees to be sprayed in the spraying area;

[0012] S4: Calculate the total amount of pesticide required for the application area based on the amount of pesticide required for a single tree and the number of trees to be applied. Prepare the pesticide solution based on the total amount of pesticide required for the application area. The drone, equipped with the pesticide solution, applies the pesticide to each tree along the preset flight route, completing precise pesticide application.

[0013] Preferably, in step S2, the specific method of pre-processing the acquired images of all the pesticide application areas is: performing distortion correction on the acquired images of all the pesticide application areas to complete the pre-processing.

[0014] Preferably, in step S2, the specific formula for calculating the actual volume of each tree canopy based on the segmented canopy pixels of each tree is:

[0015]

[0016] Among them, V 冠 is the actual volume of the tree canopy; H pixelirepresents the actual height of the i-th pixel in the tree canopy, n is the number of tree canopy pixels; GSD represents the distance between the UAV and the ground during flight.

[0017] Preferably, in step S2, after calculating the actual canopy volume of each tree, the method further includes: obtaining the canopy volume of each tree by actual measurement, and comparing and correcting the actual measured value of the canopy volume of each tree with the calculated value.

[0018] Preferably, in step S2, the specific formula for calculating the amount of pesticide required for all trees based on the actual canopy volume of all trees is:

[0019] S=8×10 -3 ×V

[0020] Where S is the amount of pesticide required for all trees; V is the average actual canopy volume of all trees.

[0021] Preferably, the pixel segmentation model preset in step S2 is specifically a FastSAM neural network model.

[0022] Preferably, the target detection algorithm in step S3 is specifically the YOLOX algorithm; the target tracking algorithm is specifically the DeepSORT algorithm.

[0023] Preferably, the steps of step S3 are specifically as follows:

[0024] Extract frames from the video data of the spraying area, use the YOLOX target detection algorithm to perform target detection on each frame of the video image of the spraying area, and mark each detected tree with an ID;

[0025] The DeepSORT target tracking algorithm is used to track all trees in each frame of the video image of the spraying area, and the number of all trees is counted according to the ID of each tree to obtain the number of trees to be sprayed in the spraying area.

[0026] Preferably, the model of the drone is PHANTOM 3 PROFESSIONAL drone.

[0027] The present invention also provides a UAV precision pesticide application system based on machine vision, which applies the above-mentioned UAV precision pesticide application method based on machine vision, including:

[0028] Data acquisition unit: used to make the UAV fly in the pesticide application area according to a preset flight route and capture image data and video data of the pesticide application area in real time; the pesticide application area is provided with a plurality of trees to be applied with pesticides;

[0029] Single tree pesticide dosage calculation unit: used to pre-process all acquired images of the pesticide application area, perform canopy pixel segmentation on all trees in each pre-processed image using a preset pixel segmentation model, and calculate the actual canopy volume of each tree based on the segmented canopy pixels of each tree;

[0030] Calculate the amount of pesticide required for each tree based on the actual canopy volume of all trees;

[0031] Tree Counting Unit: This unit is used to count the number of all trees in the video data of the spraying area using target detection and tracking algorithms, and obtain the number of trees to be sprayed in the spraying area;

[0032] Pesticide application unit: used to calculate the total amount of pesticide required in the application area based on the amount of pesticide required for a single tree and the number of trees to be applied, and to allocate the pesticide solution based on the total amount of pesticide required in the application area. The drone carries the pesticide solution and applies the pesticide to each tree according to the preset flight route, completing precise pesticide application.

[0033] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0034] The present invention provides a method for precise pesticide application using a drone based on machine vision, which is used for precise pesticide application on trees. First, the drone is caused to fly in a pesticide application area according to a preset flight route, and image data and video data of the pesticide application area are captured in real time. A plurality of trees to be pesticided are arranged in the pesticide application area. All acquired images of the pesticide application area are preprocessed, and canopy pixels of all trees in each preprocessed image are segmented using a preset pixel segmentation model. The actual canopy volume of each tree is calculated based on the segmented canopy pixels of each tree. The amount of pesticide required for each tree is calculated based on the actual canopy volume of all trees. The number of all trees in the video data of the pesticide application area is counted using a target detection algorithm and a target tracking algorithm to obtain the number of trees to be pesticided in the pesticide application area. Finally, the total amount of pesticide required in the pesticide application area is calculated based on the amount of pesticide required for each tree and the number of trees to be pesticided. A pesticide solution is prepared based on the total amount of pesticide required in the pesticide application area. The drone, carrying the pesticide solution, applies the pesticide to each tree according to the preset flight route, thereby completing precise pesticide application.

[0035] The present invention obtains images and videos of the spraying area by pre-designing the drone spraying route, and uses a pixel segmentation model based on machine learning to accurately segment the tree canopy pixels, effectively ensuring the accuracy of the tree canopy volume calculation; at the same time, the present invention will combine the target detection algorithm and the target tracking algorithm to count the number of trees in the video, and finally accurately calculate the total amount of sprayed pesticides, which can effectively improve the accuracy of spraying, reduce pesticide waste, and provide a reference idea for the precise spraying of trees; in addition, since the present invention pre-plans the spraying route and accurately calculates the amount of pesticide applied in the spraying area, after the liquid medicine is prepared, it is added to the drone medicine box and the spraying operation is directly carried out. There is no need to repeatedly adjust the drone posture during the operation, which effectively improves the spraying operation efficiency, stability and anti-interference. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flow chart of a method for precise pesticide application using a drone based on machine vision provided in Example 1.

[0037] Figure 2 This is an architecture diagram of a method for precise pesticide application using a drone based on machine vision, as provided in Example 2.

[0038] Figure 3 This is the flight route map of the drone provided in Example 2.

[0039] Figure 4 This is the FastSAM network architecture diagram provided in Example 2.

[0040] Figure 5 This is a schematic diagram of the FastSAM model image segmentation provided in Example 2.

[0041] Figure 6 This is a schematic diagram of the canopy pixel calculation method provided in Example 2.

[0042] Figure 7 This is the YOLOX structural principle diagram provided in Example 2.

[0043] Figure 8 This is a flow chart of the DeepSORT tracking algorithm provided in Example 2.

[0044] Figure 9 This is a schematic diagram of the DeepSORT tracking algorithm structure provided in Example 2.

[0045] Figure 10 This is a flow chart of the detection and tracking algorithm provided in Example 2 to implement fruit tree quantity statistics.

[0046] Figure 11 This is a structural diagram of a machine vision-based drone precision pesticide application system provided in Example 3. DETAILED DESCRIPTION

[0047] The accompanying drawings are for illustrative purposes only and are not to be construed as limiting this patent;

[0048] In order to better illustrate this embodiment, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product size;

[0049] It is understandable to those skilled in the art that some well-known structures and descriptions thereof may be omitted in the drawings.

[0050] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.

[0051] Example 1

[0052] like Figure 1 As shown, this embodiment provides a method for precise pesticide application using a drone based on machine vision, which is used for precise pesticide application on trees, including the following steps:

[0053] S1: The drone flies in a pesticide application area according to a preset flight route and captures image data and video data of the pesticide application area in real time; the pesticide application area contains a plurality of trees to be pesticided;

[0054] S2: Preprocess all images of the spraying area obtained, perform canopy pixel segmentation on all trees in each preprocessed image using the preset FastSAM model, and calculate the actual canopy volume of each tree based on the segmented canopy pixels of each tree;

[0055] Calculate the amount of pesticide required for each tree based on the actual canopy volume of all trees;

[0056] S3: Using the YOLOX object detection algorithm as the detector and the DeepSORT object tracking algorithm as the tracker, we count the number of trees in the video data of the spraying area and obtain the number of trees to be sprayed in the spraying area.

[0057] S4: Calculate the total amount of pesticide required for the application area based on the amount of pesticide required for a single tree and the number of trees to be applied. Prepare the pesticide solution based on the total amount of pesticide required for the application area. The drone, equipped with the pesticide solution, applies the pesticide to each tree along the preset flight route, completing precise pesticide application.

[0058] In the specific implementation process, first, the UAV is made to fly in the spraying area according to a preset flight route and capture image data and video data of the spraying area in real time;

[0059] Preprocess all images of the spraying area, use the preset FastSAM model to segment the canopy pixels of all trees in each preprocessed image, and calculate the actual canopy volume of each tree based on the segmented canopy pixels of each tree.

[0060] Calculate the amount of pesticide required for each tree based on the actual canopy volume of all trees;

[0061] Using the YOLOX object detection algorithm as the detector and the DeepSORT object tracking algorithm as the tracker, we counted the number of trees in the video data of the spraying area and obtained the number of trees to be sprayed in the spraying area.

[0062] Finally, the total amount of pesticide required for the application area is calculated based on the amount of pesticide required for each tree and the number of trees to be treated. The pesticide solution is then allocated based on the total amount of pesticide required for the application area. The drone, carrying the pesticide solution, applies the pesticide to each tree along the preset flight route, completing precise pesticide application.

[0063] This method obtains images and videos of the spraying area by pre-designing the drone spraying route. Based on machine learning, the FastSAM model is used to accurately segment the tree canopy pixels, effectively ensuring the accuracy of tree canopy volume calculation. At the same time, this method uses the YOLOX detection algorithm as a detector and DeepSORT as a tracker to count the number of trees in the video. Finally, the total amount of pesticide sprayed is accurately calculated, which can effectively improve the accuracy of pesticide application, reduce pesticide waste, and provide a reference idea for the precise application of trees.

[0064] Example 2

[0065] like Figure 2 As shown, this embodiment provides a method for precise pesticide application using a drone based on machine vision, which is used for precise pesticide application on fruit trees, including the following steps:

[0066] S1: The drone flies in a pesticide application area according to a preset flight route and captures image data and video data of the pesticide application area in real time; the pesticide application area contains a plurality of trees to be pesticided;

[0067] S2: Preprocess all images of the spraying area obtained, perform canopy pixel segmentation on all trees in each preprocessed image using the preset FastSAM model, and calculate the actual canopy volume of each tree based on the segmented canopy pixels of each tree;

[0068] Calculate the amount of pesticide required for each tree based on the actual canopy volume of all trees;

[0069] S3: Using the YOLOX object detection algorithm as the detector and the DeepSORT object tracking algorithm as the tracker, we count the number of trees in the video data of the spraying area and obtain the number of trees to be sprayed in the spraying area.

[0070] S4: The total amount of pesticide required for the application area is calculated based on the amount of pesticide required for each tree and the number of trees to be treated. The pesticide solution is then prepared based on the total amount of pesticide required for the application area. The drone, equipped with the pesticide solution, applies the pesticide to each tree along the preset flight route, achieving precise pesticide application.

[0071] In step S2, the specific method of pre-processing the acquired images of all the pesticide application areas is as follows: performing distortion correction on the acquired images of all the pesticide application areas to complete the pre-processing;

[0072] In step S2, the specific formula for calculating the actual volume of each tree canopy based on the segmented canopy pixels of each tree is:

[0073]

[0074] Among them, V 冠 is the actual volume of the tree canopy; H pixeli represents the actual height of the i-th pixel in the tree canopy, n is the number of tree canopy pixels; GSD represents the distance between the UAV and the ground during flight;

[0075] After calculating the actual canopy volume of each tree in step S2, the method further includes: obtaining the canopy volume of each tree by actual measurement, and comparing and correcting the actual measured value of the canopy volume of each tree with the calculated value;

[0076] In step S2, the specific formula for calculating the amount of pesticide required for all trees based on the actual canopy volume of all trees is:

[0077] S=8×10 -3 ×V

[0078] Where S is the amount of pesticide required for all trees; V is the average actual canopy volume of all trees;

[0079] The specific method of step S3 is:

[0080] Extract frames from the video data of the spraying area, use the YOLOX target detection algorithm to perform target detection on each frame of the video image of the spraying area, and mark each detected tree with an ID;

[0081] The DeepSORT target tracking algorithm is used to track all trees in each frame of the video image of the spraying area, and the number of all trees is counted according to the ID of each tree to obtain the number of trees to be sprayed in the spraying area;

[0082] The model of the drone is specifically the PHANTOM 3 PROFESSIONAL drone.

[0083] In the specific implementation process, first, the UAV is made to fly in the spraying area according to a preset flight route and capture image data and video data of the spraying area in real time;

[0084] Shooting time affects the quality of images and videos, which plays a vital role in accurate estimation of canopy volume and target detection. Therefore, in order to obtain high-quality images and videos, shooting should be carried out under clear weather, sufficient lighting, and low wind speed conditions, while avoiding shadows and jitter effects. A rotary-wing drone is used for shooting. The drone used in this embodiment is the DJI PHANTOM 3 PROFESSIONAL drone. Shooting is carried out at the experimental base. To ensure that all trees in the base can be photographed, the drone's flight route is designed as follows: Figure 3 As shown in the figure, the images and videos were taken at a constant flight altitude of 30 meters from the takeoff point, with a resolution of 4000 × 3000 pixels (width × height). The captured images and videos are stored in the SD card on the drone for further processing.

[0085] Remove the SD card from the drone, read the data on the SD card through a card reader, obtain the images and videos taken by the drone, save the image and video data on the computer, and use relevant software to perform geometric correction and distortion correction on the single collected image to complete image preprocessing;

[0086] Next, we calculated the canopy volume of the fruit trees. To ensure accurate canopy volume calculations, accurately segmenting the canopy is crucial. To ensure segmentation effectiveness, we compared the performance of deep learning segmentation algorithms with traditional segmentation algorithms both vertically and horizontally. After continuous exploration, we found that FastSAM performed best. FastSAM is a new segmentation algorithm, an improved version of SAM (Segment Anything Model). Its segmentation performance is comparable to SAM, but it's 50 times faster. Therefore, we selected FastSAM for fruit tree canopy segmentation.

[0087] like Figure 4The figure shows the FastSAM network architecture. FastSAM consists of two main stages: full instance segmentation and cue-guided selection. It first uses YOLOv8-seg to segment all objects or regions in the image, and then uses various cues (point cues, box cues, text cues) to identify specific objects of interest, which can converge faster with a smaller number of parameters.

[0088] like Figure 5 As shown in the figure, the geometrically corrected image is input into FastSAM for image segmentation. It can be clearly seen that the canopy of the fruit tree can be accurately segmented with good segmentation effect.

[0089] The preset FastSAM model is used to segment the canopy pixels of all trees in each preprocessed image, and the actual canopy volume of each tree is calculated based on the segmented canopy pixels of each tree.

[0090] Extract the segmented fruit tree canopy pixels according to Figure 6 The method shown is used to calculate the height pixels of the fruit tree canopy; the specific formula for calculating the actual canopy volume of each tree based on the canopy pixels of each tree segmented is:

[0091]

[0092] Among them, V 冠 is the actual volume of the tree canopy; H pixeli represents the actual height of the i-th pixel in the tree canopy, n is the number of tree canopy pixels; GSD represents the distance between the UAV and the ground during flight;

[0093] To ensure the accuracy of the fruit tree canopy volume calculated using the formula, the canopy volume of the fruit trees was actually measured for comparison and corrected accordingly, thereby making the calculated canopy volume of the fruit trees more accurate. After the actual canopy volume of each fruit tree was calculated, the average value was calculated, that is, the average value of the actual canopy volume of the fruit trees was obtained, and then the amount of pesticide required for each fruit tree was calculated based on the average value of the actual canopy volume of the fruit trees.

[0094] After determining the canopy volume of all fruit trees, the required amount of pesticide is calculated based on the maximum spray liquid retention capacity of the fruit trees. The requirement is that at this spray rate, all canopy leaf surfaces should be wetted by the first spray runoff. Based on relevant research and experiments, and taking into account the maximum canopy retention capacity, the pesticide dosage is calculated according to the following formula:

[0095] S=8×10 -3 ×V

[0096] Where S is the amount of pesticide required for all trees; V is the average actual canopy volume of all trees;

[0097] After that, we counted the number of fruit trees. We used the YOLOX object detection algorithm as the detector and the DeepSORT object tracking algorithm as the tracker to count all the trees in the video data of the spraying area and obtain the number of trees to be sprayed in the spraying area.

[0098] like Figure 7 As shown in the figure, it is the principle diagram of YOLOX structure. The YOLOX backbone network structure is as follows Figure 7 As shown in the CSPDarknet in the figure, it consists of the Focus module, Conv2D_BN_SiLU module, CSpLayer module and SPPBottleneck module. The input image is processed by the Focus module to increase the receptive field range, and then the Conv2D_BN_SiLU module is used to increase the number of feature map channels and reduce the size of the feature map. The CSpLayer module is used for feature extraction, and the SPPBottleneck module is used for feature compression and extraction of main features. Finally, the YOLOHead module is used to generate the final target box and target category prediction effect.

[0099] YOLOX has good detection effect and detection speed, and can realize accurate detection and identification of fruit tree canopies. However, to realize the number of fruit trees, it needs to be combined with tracking algorithms. DeepSORT is a target tracking algorithm based on deep learning. It realizes multi-target tracking by combining detection and tracking. Its basic process is as follows: Figure 8 As shown;

[0100] like Figure 9As shown in the figure, this is the schematic diagram of the DeepSORT structure. Its workflow is as follows: (1) Create the corresponding Tracks for the results detected in the first frame, initialize the motion variables of the Kalman filter, and predict the corresponding box through the Kalman filter; (2) Perform IOU matching on the box of the target detection in this frame and the box predicted by Tracks in the previous frame, and then calculate the cost matrix based on the result of IOU matching; (3) Use the cost matrix as the input of the Hungarian algorithm to obtain the linear matching result. If Tracks mismatch, they will be deleted, and if Detections mismatch, they will be initialized to new Tracks, if the match is successful, it means that the tracking is successful, and the corresponding Detections are updated with the corresponding Tracks variables through Kalman filtering; (4) Repeat (2)-(3) until the confirmed Tracks appear or the video frame ends; (5) Use Kalman filtering to predict the boxes corresponding to the confirmed Tracks and the unconfirmed Tracks, and perform cascade matching on the boxes of the confirmed Tracks and Detections. If the Tracks match, the corresponding Tracks variables are updated through Kalman filtering. If they do not match, IOU matching is performed, and the method is as (3); (6) Repeat (5) steps until the video frame ends;

[0101] DeepSORT is a two-stage algorithm that uses a deep learning model to extract target appearance features for nearest neighbor matching, achieving real-time tracking. It has the advantages of improving target tracking in occluded conditions and reducing the problem of target ID jumps.

[0102] Therefore, in order to count the number of fruit trees in the video taken by drone, the YOLOX detection algorithm is used as the detector and DeepSORT is used as the tracker to count the number of fruit trees in the video. The process of combining YOLOX and DeepSORT to count the number of fruit trees is as follows: Figure 10 As shown;

[0103] When YOLOX and DeepSORT are used in combination, the DeepSORT method also needs to be trained on the dataset. The label files in the dataset need to be manually separated in a one-to-one manner and the information in the label needs to be modified; the path parameters of the training set and the total number of training rounds in the corresponding code are modified, and the weight path obtained after training is modified to avoid overwriting the original weight file. The final weight file is obtained after the training is completed; after inputting the video, the entire YOLOX folder is placed in the DeepSORT folder, the target detection method weight file path in the track.py file is changed, the DeepSORT method weight file path is changed, and the video path of the fruit tree to be tracked is changed, so that the detection and tracking of the fruit trees in the video can be achieved;

[0104] Finally, the total amount of pesticide required for the spraying area is calculated based on the amount of pesticide required for each tree and the number of trees to be sprayed. After obtaining the total amount of pesticide required for spraying the orchard, the secondary dilution method is used to prepare the solution, and the corresponding aerial spraying adjuvant is added during the solution preparation process. After the solution is prepared, it is added to the drone's medicine box and the spraying operation can be carried out. The drone carries the solution and sprays each tree according to the preset flight route, completing the precise spraying.

[0105] This method obtains images and videos of the spraying area by pre-designing the drone spraying route. Based on machine learning, the FastSAM model is used to accurately segment the tree canopy pixels, effectively ensuring the accuracy of tree canopy volume calculation. At the same time, this method uses the YOLOX detection algorithm as a detector and DeepSORT as a tracker to count the number of trees in the video. Finally, the total amount of pesticide sprayed is accurately calculated, which can effectively improve the accuracy of pesticide application, reduce pesticide waste, and provide a reference idea for the precise application of trees.

[0106] Example 3

[0107] like Figure 11 As shown, this embodiment provides a UAV precision pesticide application system based on machine vision, applying a UAV precision pesticide application method based on machine vision described in Example 1 or 2, including:

[0108] Data acquisition unit 301: used to make the UAV fly in the pesticide application area according to a preset flight route and capture image data and video data of the pesticide application area in real time; the pesticide application area is provided with a plurality of trees to be applied with pesticides;

[0109] Single tree pesticide dosage calculation unit 302: used to pre-process all acquired images of the pesticide application area, perform canopy pixel segmentation on all trees in each pre-processed image using a preset FastSAM model, and calculate the actual canopy volume of each tree based on the segmented canopy pixels of each tree;

[0110] Calculate the amount of pesticide required for each tree based on the actual canopy volume of all trees;

[0111] The tree number counting unit 303 is used to count the number of all trees in the video data of the spraying area using the YOLOX target detection algorithm as a detector and the DeepSORT target tracking algorithm as a tracker, and obtain the number of trees to be sprayed in the spraying area;

[0112] Pesticide application unit 304: used to calculate the total amount of pesticide required for the application area based on the amount of pesticide required for a single tree and the number of trees to be applied, and to prepare the pesticide solution based on the total amount of pesticide required for the application area. The drone carries the pesticide solution and applies the pesticide to each tree according to the preset flight route, completing precise pesticide application.

[0113] In a specific implementation process, first, the data acquisition unit 301 enables the drone to fly in the spraying area according to a preset flight route and captures image data and video data of the spraying area in real time;

[0114] The single tree pesticide dosage calculation unit 302 pre-processes all acquired images of the pesticide application area, performs canopy pixel segmentation on all trees in each pre-processed image using a preset FastSAM model, and calculates the actual canopy volume of each tree based on the segmented canopy pixels of each tree.

[0115] Calculate the amount of pesticide required for each tree based on the actual canopy volume of all trees;

[0116] The tree number counting unit 303 uses the YOLOX target detection algorithm as a detector and the DeepSORT target tracking algorithm as a tracker to count the number of all trees in the video data of the spraying area and obtain the number of trees to be sprayed in the spraying area;

[0117] Finally, the pesticide application unit 304 calculates the total amount of pesticide required for the application area based on the amount of pesticide required for each tree and the number of trees to be applied. The pesticide solution is then prepared based on the total amount required for the application area. The drone, carrying the pesticide solution, applies the pesticide to each tree along a pre-set flight path, achieving precise pesticide application.

[0118] This system obtains images and videos of the spraying area by pre-designing the drone spraying route. Based on machine learning, it uses the FastSAM model to accurately segment the tree canopy pixels, effectively ensuring the accuracy of the tree canopy volume calculation. At the same time, this system uses the YOLOX detection algorithm as a detector and DeepSORT as a tracker to count the number of trees in the video and finally accurately calculate the total amount of pesticide sprayed. This can effectively improve the accuracy of pesticide application, reduce pesticide waste, and provide a reference idea for the precise application of trees.

[0119] The same or similar reference numerals correspond to the same or similar components;

[0120] The terms used in the drawings to describe positional relationships are for illustrative purposes only and should not be construed as limiting this patent;

[0121] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the scope of the present invention's concepts and principles are intended to be included within the scope of protection of the claims of the present invention.

Claims

1. A method for precise pesticide application using a drone based on machine vision, which is used for precise pesticide application on trees, characterized in that: The following steps are involved: S1: The drone flies in a pesticide application area according to a preset flight route and captures image data and video data of the pesticide application area in real time; the pesticide application area contains a plurality of trees to be pesticided; S2: Preprocessing all acquired images of the spraying area, performing canopy pixel segmentation on all trees in each preprocessed image using a preset pixel segmentation model, and calculating the actual canopy volume of each tree based on the segmented canopy pixels of each tree; the preset pixel segmentation model is specifically a FastSAM neural network model; The amount of pesticide required for a single tree is calculated based on the average actual canopy volume of all trees. The specific formula is: in, The amount of pesticide required for a single tree; is the average of the actual canopy volume of all trees; S3: Counting the number of all trees in the video data of the spraying area using a target detection algorithm and a target tracking algorithm to obtain the number of trees to be sprayed in the spraying area; the target detection algorithm is specifically the YOLOX algorithm; the target tracking algorithm is specifically the DeepSORT algorithm; S4: Calculate the total amount of pesticide required for the application area based on the amount of pesticide required for a single tree and the number of trees to be applied. Prepare the pesticide solution based on the total amount of pesticide required for the application area. The drone, equipped with the pesticide solution, applies the pesticide to each tree along the preset flight route, completing precise pesticide application.

2. The method for precise pesticide application using a drone based on machine vision according to claim 1, characterized in that: In step S2, the specific method of pre-processing the acquired images of all the pesticide application areas is: performing distortion correction on the acquired images of all the pesticide application areas to complete the pre-processing.

3. The method for precise pesticide application using a drone based on machine vision according to claim 1, wherein: In step S2, the specific formula for calculating the actual volume of each tree canopy based on the segmented canopy pixels of each tree is: in, is the actual volume of the tree canopy; represents the actual height of the i-th pixel in the tree canopy, and n is the number of pixels in the tree canopy; Indicates the distance between the drone and the ground during flight.

4. The method for precise pesticide application using a drone based on machine vision according to claim 1, wherein: In the step S2, after calculating the actual canopy volume of each tree, the method further includes: obtaining the canopy volume of each tree by actual measurement, and comparing and correcting the actual measured value of the canopy volume of each tree with the calculated value.

5. The method for precise pesticide application using a drone based on machine vision according to claim 1, characterized in that: The steps of step S3 are specifically as follows: Extract frames from the video data of the spraying area, use the YOLOX target detection algorithm to perform target detection on each frame of the video image of the spraying area, and mark each detected tree with an ID; The DeepSORT target tracking algorithm is used to track all trees in each frame of the video image of the spraying area, and the number of all trees is counted according to the ID of each tree to obtain the number of trees to be sprayed in the spraying area.

6. A method for precise pesticide application using a drone based on machine vision according to any one of claims 1 to 5, characterized in that: The model of the drone is specifically the PHANTOM 3 PROFESSIONAL drone.

7. A machine vision-based UAV precision pesticide application system, applying a machine vision-based UAV precision pesticide application method according to any one of claims 1 to 6, characterized in that: include: Data acquisition unit: used to make the UAV fly in the spraying area according to the preset flight route and capture image data and video data of the spraying area in real time; A plurality of trees to be sprayed are arranged in the spraying area; Single tree pesticide dosage calculation unit: used to pre-process all acquired images of the pesticide application area, perform canopy pixel segmentation on all trees in each pre-processed image using a preset pixel segmentation model, and calculate the actual canopy volume of each tree based on the segmented canopy pixels of each tree; the preset pixel segmentation model is specifically a FastSAM neural network model; The amount of pesticide required for a single tree is calculated based on the average actual canopy volume of all trees. The specific formula is: in, The amount of pesticide required for a single tree; is the average of the actual canopy volume of all trees; Tree number counting unit: used to count the number of all trees in the video data of the spraying area using a target detection algorithm and a target tracking algorithm to obtain the number of trees to be sprayed in the spraying area; the target detection algorithm is specifically the YOLOX algorithm; the target tracking algorithm is specifically the DeepSORT algorithm; Pesticide application unit: used to calculate the total amount of pesticide required in the application area based on the amount of pesticide required for a single tree and the number of trees to be applied, and to allocate the pesticide solution based on the total amount of pesticide required in the application area. The drone carries the pesticide solution and applies the pesticide to each tree according to the preset flight route, completing precise pesticide application.

Citation Information

Patent Citations

  • Method for controlling unmanned aerial vehicles for spraying pesticides on fruit trees

    CN106774465A

  • Smoke agent spray system and spray method for unmanned aerial vehicle adapted to mountains and hills

    CN108552149A