Fruit tree multi-dimensional positioning method based on fusion of laser radar and image sensor

By integrating laser radar and image sensor technology in the orchard, combined with depth information and visual models, the problem of accuracy and reliability of fruit tree positioning in the orchard environment is solved, the precise three-dimensional positioning of fruit trees is achieved, and the efficiency and efficiency of orchard robot navigation are improved. Security.

CN118747878APending Publication Date: 2024-10-08SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410762069.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing obstacle recognition and positioning technology has limitations in the orchard environment and is difficult to meet the high-precision and high-reliability requirements of orchard robot navigation. Image sensors cannot provide precise position and depth information in three-dimensional space, and the data collected by lidar Lack of semantic information to distinguish different types of objects.

Method used

A multi-dimensional positioning method for fruit trees based on the fusion of lidar and image sensors is adopted. By training a visual positioning model specifically for fruit trees, combined with the depth information obtained by lidar, the central positioning formula and the coordinate conversion formula are used to determine the precise position of the fruit tree in the three-dimensional space. .

Benefits of technology

It improves the accuracy and reliability of fruit tree positioning, achieves precise identification and positioning of fruit trees, provides accurate positioning information for orchard robots, and improves operating efficiency and safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747878A_ABST
    Figure CN118747878A_ABST
Patent Text Reader

Abstract

The invention provides a fruit tree multi-dimensional positioning method based on fusion of a laser radar and an image sensor, and relates to the field of agricultural production equipment, the fruit tree multi-dimensional positioning method based on fusion of the laser radar and the image sensor comprises the following steps: training a fruit tree visual positioning model; calibrating a laser radar and an image sensor; images are collected and imported into a fruit tree visual positioning model, and two-dimensional coordinates of a fruit tree positioning frame are output; acquiring laser point cloud data and converting the point cloud data into a depth map; and determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame. By training the visual positioning model specially aiming at the fruit tree, the fruit tree can be effectively identified and the two-dimensional coordinate of the fruit tree in the image can be output, and the precision and reliability of fruit tree positioning can be effectively improved in combination with the depth information acquired by the laser radar, so that accurate fruit tree identification and positioning are realized; accurate positioning information can be provided for the orchard robot, and operation efficiency and safety are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of agricultural production equipment, and in particular to a multi-dimensional positioning method for fruit trees based on the fusion of laser radar and image sensor. Background Art

[0002] The automated management of smart orchards is an important trend in the development of modern agriculture, in which efficient navigation robot systems play a key role. Such systems need to have the ability to accurately identify and locate obstacles and avoid obstacles to ensure the safety and continuous operation of robots. However, existing obstacle recognition and positioning technologies have limitations in orchard environments and are difficult to meet the needs of orchard robot navigation.

[0003] Traditional obstacle recognition and positioning technologies mainly rely on two sensing technologies: image sensors and lidar. Image sensors perform well in identifying object categories by analyzing two-dimensional images and using image recognition algorithms to identify object types. However, image sensors can only capture two-dimensional images of objects and cannot directly provide accurate position and depth information of objects in three-dimensional space, which is insufficient for navigation and obstacle avoidance tasks in three-dimensional space. For example, in an orchard environment, image sensors have difficulty distinguishing different types of fruit trees, and it is also difficult to accurately determine the distance and position of fruit trees, resulting in the robot being unable to perform accurate obstacle avoidance and path planning.

[0004] LiDAR sensors construct a 3D point cloud of the surrounding environment by emitting laser beams and measuring their reflection time. They can accurately determine the position, shape and size of objects, thereby effectively detecting and locating obstacles in 3D space. However, the data collected by LiDAR lacks sufficient semantic information and cannot distinguish between different types of objects.

[0005] The existing technologies have their own shortcomings when using image sensors or lidar alone to locate fruit tree obstacles, and cannot meet the requirements of orchard robot navigation for high precision and high reliability.

[0006] Therefore, it is necessary to improve the existing technology to overcome the defects of the existing technology. Summary of the invention

[0007] In order to overcome the problems existing in the related art, the purpose of the present invention is to provide a multi-dimensional positioning method for fruit trees based on the fusion of laser radar and image sensor. The multi-dimensional positioning method for fruit trees based on the fusion of laser radar and image sensor overcomes the problems existing in the prior art by fusing laser radar and camera.

[0008] A multi-dimensional positioning method for fruit trees based on the fusion of laser radar and image sensor, comprising:

[0009] Fruit tree visual positioning model training;

[0010] Calibration of LiDAR and image sensors;

[0011] Collect images and import them into the fruit tree visual positioning model to output the two-dimensional coordinates of the fruit tree positioning frame;

[0012] Obtain laser point cloud data and convert the point cloud data into a depth map;

[0013] The three-dimensional coordinates of the fruit tree positioning frame are determined according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame.

[0014] By training a visual positioning model specifically for fruit trees and combining it with the depth information obtained by lidar, the accuracy and reliability of fruit tree positioning can be effectively improved, thereby achieving accurate fruit tree identification and positioning.

[0015] Preferably, determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame comprises:

[0016] Get the two-dimensional coordinates of the fruit tree positioning frame;

[0017] According to the two-dimensional coordinates of the fruit tree positioning frame, the central coordinates of the fruit tree trunk are determined by the central positioning formula;

[0018] The three-dimensional coordinates of the fruit tree positioning frame are determined based on the central coordinates of the fruit tree trunk and the depth information of the depth map.

[0019] By obtaining the two-dimensional coordinates of the fruit tree positioning frame and using the central positioning formula to determine the central coordinates of the fruit tree trunk, the edge error of the positioning frame can be effectively eliminated and the positioning accuracy can be improved. Secondly, according to the central coordinates of the fruit tree trunk and the depth information of the depth map, the two-dimensional coordinate information can be converted into three-dimensional space coordinates, thereby accurately determining the position of the fruit tree in three-dimensional space.

[0020] Preferably, the step of acquiring laser point cloud data and converting the point cloud data into a depth map comprises:

[0021] Obtain calibration data for lidar and image sensors;

[0022] The point cloud data in the laser radar coordinate system is converted into a depth map in the image sensor coordinate system through a coordinate conversion formula;

[0023] Get the pixel range of the image sensor and filter out the depth data outside the pixel range of the depth map.

[0024] Obtaining the calibration data of the LiDAR and image sensor can ensure the accuracy of the spatial relationship between the LiDAR and image sensor, providing a reliable basis for subsequent coordinate conversion. The point cloud data in the LiDAR coordinate system is converted into a depth map in the image sensor coordinate system through the coordinate conversion formula, and the three-dimensional point cloud information can be projected onto the image sensor image plane to provide depth information for fruit tree positioning. Obtaining the pixel range of the image sensor and filtering out the depth data outside the pixel range of the depth map can effectively remove invalid data and improve the accuracy and efficiency of the depth map.

[0025] Preferably, the calibration of the laser radar and the image sensor includes:

[0026] Image sensor internal calibration;

[0027] External parameter calibration between LiDAR and image sensor;

[0028] The image sensor internal parameter calibration includes shooting around the calibration board and importing the shot images into MATLAB for internal parameter calculation to determine the internal parameter matrix of the image sensor;

[0029] The external parameter calibration between the laser radar and the image sensor includes performing least square fitting calibration using the cloud data of the point laser radar and the image of the image sensor.

[0030] Image sensor intrinsic calibration can accurately determine the intrinsic matrix of the image sensor, thereby effectively removing the impact of lens distortion on the image and providing accurate visual data for subsequent image processing and analysis. External calibration between LiDAR and image sensor can accurately transform the LiDAR point cloud to the image sensor coordinate system, achieving alignment and synchronization between the point cloud and the image.

[0031] Preferably, after determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame, the method further comprises:

[0032] The three-dimensional coordinates of the fruit tree positioning frame are converted into three-dimensional coordinates in the lidar coordinate system through the coordinate inverse conversion formula.

[0033] Preferably, if there is no depth information at the central coordinate of the fruit tree trunk, the central coordinate of the fruit tree trunk is expanded to the surrounding by an offset amount and the depth information within the expanded range is obtained;

[0034] The depth information of the final central coordinates of the fruit tree trunk is obtained by taking the average value of the total depth information and the number of depth points within the expanded range.

[0035] Due to the sparsity of the lidar point cloud, not every pixel of the image sensor has corresponding depth information. By expanding the central range of the fruit tree trunk, the accuracy and reliability of the positioning data can be guaranteed.

[0036] Preferably, the fruit tree visual positioning model training includes:

[0037] Get training images containing fruit trees;

[0038] Mark the locations of tree trunks in training images;

[0039] Import the labeled training images into the AI ​​model for training.

[0040] By obtaining training images containing fruit trees, we can provide rich sample data for model training. By marking the positions of tree trunks in training images, we can provide accurate label information for model training and help the model learn to identify the characteristics of fruit tree trunks. By importing the labeled training images into the AI ​​model for training, we can train a visual positioning model that can identify and locate fruit trees.

[0041] Preferably, the coordinate transformation formula includes:

[0042]

[0043]

[0044] The Z c is the direction of the optical axis in the image sensor coordinate system;

[0045] The k C is the intrinsic parameter matrix of the image sensor;

[0046] The f x and f y is the focal length parameter of the image sensor;

[0047] The C x and C y is the coordinate of the principal point of the figure;

[0048] The R cl and T cl The rotation and translation matrix that transforms the lidar coordinates to the image sensor coordinate system.

[0049] Preferably, the coordinate inverse transformation formula includes:

[0050]

[0051] The P l The three-dimensional point coordinates of the fruit tree positioning frame in the laser radar coordinate system;

[0052] The x l The X-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system;

[0053] Thel The Y-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system;

[0054] The z l The Z-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system;

[0055] R is the rotation matrix from the image sensor coordinate system to the laser radar coordinate system;

[0056] T is the translation vector from the image sensor coordinate system to the laser radar coordinate system;

[0057] The x c The X-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system;

[0058] The c The Y-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system;

[0059] The z c The Z-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system.

[0060] Preferably, the central positioning formula includes:

[0061] x=x tl +(x br -x tl ) / 2

[0062] y=y br +(y tl -y br ) / 2

[0063] x is the X-axis coordinate of the center of the fruit tree trunk;

[0064] y is the Y-axis coordinate of the center of the fruit tree trunk;

[0065] x tl The X-axis coordinate of the upper left corner of the fruit tree positioning box;

[0066] y tl The Y-axis coordinate of the upper left corner of the fruit tree positioning box;

[0067] x br The X-axis coordinate of the upper right corner of the fruit tree positioning box;

[0068] y br The Y-axis coordinate of the upper right corner of the fruit tree positioning box.

[0069] Preferably, the AI ​​model is yolov8.

[0070] As an advanced target detection model, yolov8 has the advantages of fast speed, high accuracy, and easy deployment. It can quickly identify and locate fruit trees and meet the real-time requirements of the orchard robot navigation system.

[0071] The beneficial effects of the present invention are:

[0072] The present invention provides a fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor can effectively identify the fruit tree and output its two-dimensional coordinates in the image by training a visual positioning model specifically for the fruit tree. The laser radar and the image sensor are calibrated, and the point cloud data obtained by the laser radar can be accurately converted to the image sensor coordinate system to ensure the accurate correspondence between the point cloud data and the image data, thereby improving the accuracy of three-dimensional positioning. The original point cloud data obtained by the laser radar is converted into a depth map to provide depth information for the two-dimensional pixel coordinates in the image, which can effectively expand the two-dimensional coordinate information to the three-dimensional space and improve the positioning accuracy. Combined with the depth information obtained by the laser radar, the accuracy and reliability of fruit tree positioning can be effectively improved, thereby achieving accurate fruit tree identification and positioning, and can provide accurate positioning information for the orchard robot, improving work efficiency and safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 It is a flow chart of a fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor provided in an embodiment of the present application;

[0074] Figure 2 It is a training index diagram of the yolov8 model provided in the embodiment of the present application;

[0075] Figure 3 is a schematic diagram of a fruit tree positioning frame provided in an embodiment of the present application;

[0076] Figure 4 It is a schematic diagram of the three-dimensional positioning frame of the fruit tree trunk in the laser radar coordinate system provided in the embodiment of the present application. DETAILED DESCRIPTION

[0077] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0078] Example 1

[0079] like Figure 1-Figure 4As shown, this embodiment provides a fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor, and the fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor includes:

[0080] Step S1: fruit tree visual positioning model training;

[0081] Step S2: Calibration of laser radar and image sensor;

[0082] Step S3: collect images and import them into the fruit tree visual positioning model, and output the two-dimensional coordinates of the fruit tree positioning frame;

[0083] Step S4: Obtain laser point cloud data and convert the point cloud data into a depth map;

[0084] Step S5: Determine the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame.

[0085] By training a visual positioning model specifically for fruit trees and combining it with the depth information obtained by lidar, the accuracy and reliability of fruit tree positioning can be effectively improved, thereby achieving accurate fruit tree identification and positioning.

[0086] In this embodiment, the fruit tree visual positioning model training includes:

[0087] Get training images containing fruit trees;

[0088] Mark the locations of tree trunks in training images;

[0089] Import the labeled training images into the AI ​​model for training.

[0090] Specifically, training images containing fruit trees can be obtained by collecting a fruit tree dataset in a smart orchard.

[0091] Specifically, the trunk position in the training image can be marked by separately labeling the trunk part category as trunk.

[0092] Specifically, the labeled training images can be imported into the AI ​​model for training. The labeled dataset can be used to train the yolov8 fruit tree model under the Ubuntu system. The initial pre-trained model is yolov8n.pt, which runs the fastest.

[0093] More specifically, after training is completed, an image sensor is used to collect images for target recognition, and the recognition result is the position of the fruit tree positioning box in the pixel coordinate system in the image, which is usually saved as a pixel coordinate system of a group of fruit trees with the upper left corner and the lower right corner.

[0094] Specifically, AI models (Artificial Intelligence Models) refer to mathematical models that are trained through machine learning or deep learning technologies and can perform specific tasks.

[0095] Specifically, the AI ​​model can be a target detection model.

[0096] More specifically, object detection models are a type of AI model that is specifically designed to identify the type and location of objects in images or videos. They usually output a bounding box to mark the location of the target object in the image and predict the category of the target object.

[0097] More specifically, the target detection model can be Faster R-CNN, SSD, Retina Net, etc., and the appropriate model architecture and training method can be selected according to the actual situation. Faster R-CNN is a deep learning target detection model based on region proposal. SSD: is a deep learning target detection model based on Single Shot MultiBox Detector. Retina Net is a deep learning target detection model based on Feature Pyramid Network.

[0098] By obtaining training images containing fruit trees, we can provide rich sample data for model training. By marking the positions of tree trunks in training images, we can provide accurate label information for model training and help the model learn to identify the characteristics of fruit tree trunks. By importing the labeled training images into the AI ​​model for training, we can train a visual positioning model that can identify and locate fruit trees.

[0099] In this embodiment, the AI ​​model is yolov8.

[0100] As an advanced target detection model, yolov8 has the advantages of fast speed, high accuracy, and easy deployment. It can quickly identify and locate fruit trees and meet the real-time requirements of the orchard robot navigation system.

[0101] In this embodiment, the calibration of the laser radar and the image sensor includes:

[0102] Image sensor internal calibration;

[0103] External parameter calibration between LiDAR and image sensor;

[0104] The image sensor internal parameter calibration includes shooting around the calibration board and importing the shot images into MATLAB for internal parameter calculation to determine the internal parameter matrix of the image sensor;

[0105] The external parameter calibration between the laser radar and the image sensor includes performing least square fitting calibration using the cloud data of the point laser radar and the image of the image sensor.

[0106] Specifically, the image sensor intrinsic calibration requires using a calibration board to capture an image and then importing it into MATLAB to calculate the calibration intrinsic parameters to correct the distortion caused by the lens.

[0107] Specifically, the extrinsic calibration between the lidar and the image sensor uses the livox_camera_lidar_calibration package, and the least squares fitting calibration is performed using the pre-recorded point cloud bag package and a PNG image.

[0108] Specifically, the image sensor internal parameter calibration can also be performed by using direct image methods, such as optical flow method, feature tracking, etc. It can also be calibrated using deep learning methods, such as CNN network. It can also be calibrated using the geometric relationship between multiple images, such as calibration based on PnP algorithm.

[0109] More specifically, in addition to MATLAB, other tools can also be used for calibration, such as OpenCV, Kalibr, etc. OpenCV is an open source computer vision library that provides rich image sensor calibration functions. Kalibr is an open source tool for image sensor and IMU calibration.

[0110] More specifically, you can use the cv2.calibrateCamera() function in OpenCV and use a checkerboard calibration plate to calibrate the image sensor intrinsic parameters.

[0111] Specifically, other methods can also be used to calibrate the external parameters between the lidar and the image sensor, for example: calibration based on feature point matching, using feature point matching methods such as SIFT, SURF, etc.; calibration based on the ICP algorithm, using the iterative closest point algorithm (ICP) for calibration; calibration based on deep learning, using deep learning methods such as CNN networks for calibration.

[0112] Image sensor intrinsic calibration can accurately determine the intrinsic matrix of the image sensor, thereby effectively removing the impact of lens distortion on the image and providing accurate visual data for subsequent image processing and analysis. External calibration between LiDAR and image sensor can accurately transform the LiDAR point cloud to the image sensor coordinate system, achieving alignment and synchronization between the point cloud and the image.

[0113] In this embodiment, determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame includes:

[0114] Get the two-dimensional coordinates of the fruit tree positioning frame;

[0115] According to the two-dimensional coordinates of the fruit tree positioning frame, the central coordinates of the fruit tree trunk are determined by the central positioning formula;

[0116] The three-dimensional coordinates of the fruit tree positioning frame are determined based on the central coordinates of the fruit tree trunk and the depth information of the depth map.

[0117] Specifically, although the two-dimensional coordinates of the fruit tree positioning box are usually expressed using the coordinates of the upper left corner and the lower right corner, other formats can also be used, such as: center point and size expression, using the center point coordinates and width and height to express the positioning box; four vertex coordinate expression, using the four vertex coordinates of the positioning box to express the positioning box.

[0118] Specifically, the four corner points corresponding to the fruit tree positioning frame usually exceed the range of the fruit tree body, so it is necessary to take out the pixel coordinates in the middle of the fruit tree and then send them into the point cloud depth map to obtain the three-dimensional coordinates.

[0119] By obtaining the two-dimensional coordinates of the fruit tree positioning frame and using the central positioning formula to determine the central coordinates of the fruit tree trunk, the edge error of the positioning frame can be effectively eliminated and the positioning accuracy can be improved. Secondly, according to the central coordinates of the fruit tree trunk and the depth information of the depth map, the two-dimensional coordinate information can be converted into three-dimensional space coordinates, thereby accurately determining the position of the fruit tree in three-dimensional space.

[0120] In this embodiment, the central positioning formula includes:

[0121] x=x tl +(x br -x tl ) / 2

[0122] y=y br +(y tl -y br ) / 2

[0123] x is the X-axis coordinate of the center of the fruit tree trunk;

[0124] y is the Y-axis coordinate of the center of the fruit tree trunk;

[0125] x tl The X-axis coordinate of the upper left corner of the fruit tree positioning box;

[0126] y tl The Y-axis coordinate of the upper left corner of the fruit tree positioning box;

[0127] x br The X-axis coordinate of the upper right corner of the fruit tree positioning box;

[0128] y brThe Y-axis coordinate of the upper right corner of the fruit tree positioning box.

[0129] In this embodiment, if there is no depth information at the central coordinate of the fruit tree trunk, the central coordinate of the fruit tree trunk is expanded to the surrounding by an offset amount and the depth information within the expanded range is obtained;

[0130] The depth information of the final central coordinates of the fruit tree trunk is obtained by taking the average value of the total depth information and the number of depth points within the expanded range.

[0131] Due to the sparsity of the lidar point cloud, not every pixel of the image sensor has corresponding depth information. By expanding the central range of the fruit tree trunk, the accuracy and reliability of the positioning data can be guaranteed.

[0132] Specifically, in addition to the square area, the expanded area may also use areas of other shapes, such as a circular area, an elliptical area, etc., to obtain depth information.

[0133] Specifically, the size of the offset can be adjusted according to actual conditions, for example, according to the thickness of the fruit tree trunk and the resolution of the depth map. The size of the offset can also be adaptively adjusted according to the depth information of the surrounding pixels in the depth map. For example, if the depth information of the surrounding pixels is dense, the offset can be reduced; if the depth information of the surrounding pixels is sparse, the offset can be increased.

[0134] Specifically, the averaging method of depth information can perform weighted averaging according to the reliability of the depth information, for example: distance weighted averaging, the closer the pixel is to the target pixel, the greater the weight of the depth information; confidence weighted averaging, the higher the depth information confidence, the greater the weight of the depth information; other averaging methods can use other averaging methods, such as median, mode, etc., to calculate the final depth information.

[0135] More specifically, the acquired depth information may be filtered to remove obviously erroneous depth information, such as outliers, and the depth information may be smoothed to reduce the impact of noise.

[0136] In this embodiment, obtaining laser point cloud data and converting the point cloud data into a depth map includes:

[0137] Obtain calibration data for lidar and image sensors;

[0138] The point cloud data in the laser radar coordinate system is converted into a depth map in the image sensor coordinate system through a coordinate conversion formula;

[0139] Get the pixel range of the image sensor and filter out the depth data outside the pixel range of the depth map.

[0140] Specifically, the coordinate transformation formula can be a homogeneous coordinate transformation, which uses a homogeneous coordinate transformation matrix to transform the point cloud data from the lidar coordinate system to the image sensor coordinate system; it can also be a rotation and translation transformation, which uses a rotation matrix and a translation vector to transform the point cloud data from the lidar coordinate system to the image sensor coordinate system; it can also be a quaternion transformation, which uses a quaternion to transform the point cloud data from the lidar coordinate system to the image sensor coordinate system.

[0141] Specifically, in order to ensure that the point cloud data is consistent with the pixel range of the image sensor after being mapped to the pixel coordinate system of the image sensor, the length and width of the image pixels are used as filtering conditions to filter out the point cloud data outside the image pixels, ensuring that the field of view angle is consistent when the lidar point cloud data is mapped to the image pixel coordinate system.

[0142] Obtaining the calibration data of the LiDAR and image sensor can ensure the accuracy of the spatial relationship between the LiDAR and image sensor, providing a reliable basis for subsequent coordinate conversion. The point cloud data in the LiDAR coordinate system is converted into a depth map in the image sensor coordinate system through the coordinate conversion formula, and the three-dimensional point cloud information can be projected onto the image sensor image plane to provide depth information for fruit tree positioning. Obtaining the pixel range of the image sensor and filtering out the depth data outside the pixel range of the depth map can effectively remove invalid data and improve the accuracy and efficiency of the depth map.

[0143] In this embodiment, the coordinate conversion formula includes:

[0144]

[0145] The Z c is the direction of the optical axis in the image sensor coordinate system;

[0146] The k C is the intrinsic parameter matrix of the image sensor;

[0147] The f x and f y is the focal length parameter of the image sensor;

[0148] The C x and C y is the coordinate of the principal point of the figure;

[0149] The R cl and T cl The rotation and translation matrix that transforms the lidar coordinates to the image sensor coordinate system.

[0150] In this embodiment, after determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame, the method further includes:

[0151] The three-dimensional coordinates of the fruit tree positioning frame are converted into three-dimensional coordinates in the lidar coordinate system through the coordinate inverse conversion formula.

[0152] Specifically, the coordinate inverse transformation formula can use a homogeneous coordinate transformation matrix to convert the three-dimensional coordinates from the image sensor coordinate system to the lidar coordinate system; it can also use a rotation matrix and a translation vector to perform rotation and translation operations respectively to convert the three-dimensional coordinates from the image sensor coordinate system to the lidar coordinate system; it can also use a quaternion to perform rotation and translation operations to convert the three-dimensional coordinates from the image sensor coordinate system to the lidar coordinate system.

[0153] Specifically, in actual operation, since the z-axis of the image sensor coordinate system is forward, which is not in line with the usual usage habits, and the x-axis of the radar coordinate system is forward, which is in line with the usual usage habits, the three-dimensional position of the fruit tree is finally expressed in the lidar coordinate system.

[0154] In this embodiment, the coordinate inverse transformation formula includes:

[0155]

[0156] The P l The three-dimensional point coordinates of the fruit tree positioning frame in the laser radar coordinate system;

[0157] The x l The X-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system;

[0158] The l The Y-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system;

[0159] The z l The Z-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system;

[0160] R is the rotation matrix from the image sensor coordinate system to the laser radar coordinate system;

[0161] T is the translation vector from the image sensor coordinate system to the laser radar coordinate system;

[0162] The x c The X-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system;

[0163] The c The Y-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system;

[0164] The z c The Z-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system.

[0165] Example 2

[0166] like Figure 1-Figure 4 As shown, this embodiment provides a fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor, and the fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor includes:

[0167] Calibration of LiDAR and image sensors;

[0168] Fruit tree visual positioning model training;

[0169] Collect images and import them into the fruit tree visual positioning model to output the two-dimensional coordinates of the fruit tree positioning frame;

[0170] Obtain laser point cloud data and convert the point cloud data into a depth map;

[0171] The three-dimensional coordinates of the fruit tree positioning frame are determined according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame.

[0172] Specifically, in the calibration of the laser radar and the image sensor, the internal parameters of the image sensor and the external parameters of the laser radar and the image sensor are calibrated.

[0173] More specifically, image sensor intrinsic calibration is a fundamental step in the image sensor calibration process, and its purpose is to accurately obtain the intrinsic characteristics of the lens, including focal length, principal point coordinates, and radial and tangential distortion coefficients.

[0174] More specifically, through internal parameter calibration, the impact of lens distortion on the image can be effectively removed, thereby providing accurate visual data for subsequent image processing and analysis.

[0175] More specifically, the calibration process usually involves using a calibration plate with known geometric features, taking pictures around the calibration plate, and then importing them into MATLAB for calculation of internal parameters.

[0176] More specifically, the extrinsic calibration of LiDAR and image sensors refers to determining the spatial relationship between the LiDAR and image sensors, including their relative position and rotation.

[0177] More specifically, this step is crucial to achieving the fusion of LiDAR point cloud data and image sensor image data. Through precise external parameter calibration, the LiDAR point cloud can be accurately transformed into the image sensor coordinate system, thereby achieving alignment and synchronization between the point cloud and the image.

[0178] Specifically, in the training of the fruit tree visual positioning model, image sensors are used to collect fruit tree data sets in the smart orchard and train the yolov8 model.

[0179] More specifically, since this method is aimed at the recognition of fruit tree trunks, it is necessary to manually mark the position of the fruit tree trunks after collecting fruit tree images in the smart orchard, and the marking category is trunk. After the marking is completed, it is imported into the yolov8 network training, and the yolov8n.pt with the fastest processing speed is selected as the pre-training model. The training set is 1,800, and the test set and validation set are 400 each. Figure 2 The average precision and recall of the fruit tree model after training is 95.1%, and the results of detecting fruit tree trunks are as follows: Figure 3 After subsequent testing, the fruit tree training model had an average frame rate of 20 Hz and an average accuracy of over 90% under OpenVINO deployment conditions, meeting the performance requirements in practical applications.

[0180] Specifically, when collecting images and importing them into the fruit tree visual positioning model, and outputting the two-dimensional coordinates of the fruit tree positioning frame, each frame of image collected by the image sensor is imported into the fruit tree model to identify the fruit tree trunk, and the recognition result is output as the pixel point coordinates in the image sensor pixel coordinate system, including the upper left and lower right of the rectangular positioning frame as a set of coordinates.

[0181] Specifically, when acquiring laser point cloud data and converting the point cloud data into a depth map, the laser radar uses the calibrated external parameters after acquiring the original point cloud to transform the point cloud to the image sensor coordinate system through a rotation transformation matrix to ensure accurate correspondence between the point cloud data and the image sensor's viewing angle.

[0182] Then, the image sensor intrinsic parameter matrix Kc is used to project each point from the image sensor coordinate system to the two-dimensional pixel plane, and the corresponding depth information is assigned to the pixel points in the image sensor pixel coordinate system.

[0183] In order to ensure that the original point cloud is consistent with the pixel range of the image sensor after being mapped to the pixel coordinate system of the image sensor, the length and width of the image pixel are used as filtering conditions to filter out the point cloud outside the image pixel, ensuring that the field of view angle is consistent when the original point cloud of the lidar is mapped to the image pixel coordinate system.

[0184] Specifically, in determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame, the image pixel space where the two-dimensional coordinates of the fruit tree positioning frame are located is obtained. These two-dimensional pixel coordinates define the position of the target on the image plane, but do not contain enough information to describe its exact position in the three-dimensional space. In order to convert from two-dimensional pixel coordinates to three-dimensional space coordinates, the depth map data must be combined.

[0185] It is necessary to use the fruit tree positioning frame to calculate the pixel coordinates of the center of the fruit tree trunk. The pixel coordinates may not have corresponding depth information. It is necessary to expand a certain amount of offset along the four sides before calculating the depth. In addition, it is necessary to take the average of the sum of the depth values ​​and the number of points involved in the depth calculation to get the average depth multiplied by the pixel coordinates as the three-dimensional coordinates of the fruit tree in the image sensor coordinate system.

[0186] The obtained three-dimensional coordinates are the coordinates in the image sensor coordinate system, which is in the form of z-axis forward, x-axis right, and y-axis downward, which does not conform to the usual representation habits. The commonly used representation habits are x-axis forward, y-axis left, and z-axis upward, which is exactly the representation form of the lidar coordinate system.

[0187] Therefore, it is necessary to transform the obtained coordinates of the fruit tree in the image sensor coordinate system into the coordinates in the radar coordinate system through the rotation transformation matrix to ensure that the x-axis is forward. The final three-dimensional coordinates xyz of the fruit tree are defined in the radar coordinate system, such as Figure 4 Shown is a 3D box of a tree trunk underneath the LiDAR point cloud.

[0188] Example 3

[0189] As shown in the figure, this embodiment provides a fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor, and the fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor includes:

[0190] Using a checkerboard calibration plate, images are taken at different angles and imported into software such as MATLAB for internal parameter calculation to obtain the internal parameter matrix of the image sensor, including focal length, principal point coordinates, and radial and tangential distortion coefficients.

[0191] Use a calibration plate with a reflective target, align the lidar and image sensor with the calibration plate at the same time to collect data, obtain the lidar point cloud data and image sensor image, and use the least squares fitting method to obtain the external parameter matrix between the lidar and image sensor, including the rotation matrix and translation vector.

[0192] Collect a dataset of images of different fruit tree varieties, and make sure the dataset covers different lighting conditions, tree sizes, occlusions, etc.

[0193] Use the image annotation tool to mark the trunk position of the fruit tree in the image and generate the corresponding annotation file.

[0194] Select the YOLOv5 deep learning model and use the labeled data to train the model. The training process requires parameter adjustment based on the data set size, model structure, etc.

[0195] For better explanation, the positioning method in this embodiment is used in an orchard robot to assist the orchard robot in movement, navigation and obstacle avoidance in a litchi plantation. The orchard robot is equipped with a camera and a laser radar.

[0196] During implementation, the robot collects images of litchi plantations through cameras and uses lidar to collect point cloud data of litchi plantations. Each frame of the collected image is imported into the trained fruit tree visual positioning model to obtain the two-dimensional coordinates of the litchi tree positioning frame. The calibrated external parameter matrix is ​​used to convert the point cloud data in the lidar coordinate system into a depth map in the camera coordinate system.

[0197] According to the camera's viewing angle, the depth data outside the pixel range of the depth map is filtered out, and then the central coordinates of the tree trunk are calculated based on the 2D coordinates of the lychee tree positioning frame. The 3D coordinates of the tree positioning frame are determined based on the central coordinates of the lychee tree trunk and the depth information of the depth map. The calibrated external parameter matrix is ​​used to convert the 3D coordinates of the lychee tree positioning frame into 3D coordinates in the LiDAR coordinate system.

[0198] In each frame of the image, the lychee tree positioning processing is performed, and the three-dimensional coordinates are obtained through positioning. The three-dimensional coordinates are transmitted to the orchard robot in real time to assist the orchard robot in movement, navigation and obstacle avoidance in the lychee plantation. By integrating the depth information and visual information of the lidar and camera, the lychee tree can be better judged and located.

[0199] Example 4

[0200] As shown in the figure, this embodiment provides a fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor, and the fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor includes:

[0201] 1. Calibration of LiDAR and image sensor: Use a checkerboard calibration plate to take 20 images at different angles, import them into MATLAB and use the cameraCalibrator function for calibration to obtain the intrinsic parameter matrix of the image sensor, including focal length (fx=1000, fy=1000), principal point coordinates (cx=640, cy=360) and radial distortion coefficients (k1=-0.2, k2=0.1).

[0202] Use a calibration plate with a reflective target, align the lidar and image sensor with the calibration plate at the same time to collect data, obtain the lidar point cloud data and image sensor image, use OpenCV's findHomography function for calibration, and obtain the external parameter matrix between the lidar and image sensor, including the rotation matrix (R) and the translation vector (T).

[0203] 2. Fruit tree visual positioning model training: Collect image datasets containing different varieties of fruit trees, such as apple trees, pear trees, etc., and ensure that the dataset covers different lighting conditions, tree sizes, occlusion conditions, etc., totaling 2,300 images.

[0204] Use the LabelImg tool to mark the trunk position of the fruit tree in the image and generate the corresponding annotation file. Use the YOLOv5 model for training. Use the pre-trained model yolov5s.pt, set the learning rate to 0.001, set the batch size to 16, and train for 100 epochs.

[0205] 3. Data collection and processing: Use image sensors to collect orchard images in real time, import the collected images into the trained fruit tree visual positioning model, obtain the two-dimensional coordinates of the fruit tree positioning frame in real time, and use OpenCV's cv2.rectangle function to draw the positioning frame. For example, the two-dimensional coordinates of the identified apple tree positioning frame are (upper left corner x=200, upper left corner y=200, lower right corner x=300, lower right corner y=100).

[0206] Use LiDAR to collect orchard point cloud data, and use the calibrated extrinsic parameter matrix to convert the point cloud data in the LiDAR coordinate system into a depth map in the image sensor coordinate system.

[0207] 4. Three-dimensional coordinate calculation: According to the two-dimensional coordinates of the apple tree positioning frame, use the central positioning formula to calculate the central coordinates of the apple tree trunk. The calculated central coordinates of the apple tree trunk are (x=250, y=150).

[0208] In this embodiment, there is no depth information at the central coordinates of the apple tree trunk. The central coordinates of the fruit tree trunk are expanded by an offset of 5 pixels in all directions to obtain the depth information within the expanded range. The depth information within the expanded range is counted to obtain the final depth information of the central coordinates of the apple tree trunk.

[0209] The coordinates of the final three-dimensional positioning frame of the apple tree are:

[0210] Upper left corner: (200,200,500)

[0211] Upper right corner: (300, 200, 500)

[0212] Lower left corner: (200,100,500)

[0213] Lower right corner: (300,100,500)

[0214] Behind the upper left corner: (200,200,600)

[0215] Behind the upper right corner: (300, 200, 600)

[0216] Lower left corner: (200,100,600)

[0217] Behind the lower right corner: (300,100,600)

[0218] Unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values ​​of the parts and steps set forth in these embodiments do not limit the scope of the application. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a restriction. Therefore, other examples of exemplary embodiments can have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, and therefore, once a certain item is defined in an accompanying drawing, it does not need to be further discussed in the subsequent accompanying drawings.

[0219] In addition, it should be noted that the use of terms such as "first" and "second" to limit is only for the convenience of distinction. Unless otherwise stated, the above terms have no special meaning and therefore cannot be understood as limiting the scope of protection of this application.

[0220] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A multi-dimensional positioning method for fruit trees based on the fusion of laser radar and image sensor, characterized in that: include: Fruit tree visual positioning model training; Calibration of LiDAR and image sensors; Collect images and import them into the fruit tree visual positioning model to output the two-dimensional coordinates of the fruit tree positioning frame; Obtain laser point cloud data and convert the point cloud data into a depth map; The three-dimensional coordinates of the fruit tree positioning frame are determined according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame.

2. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 1 is characterized in that: Determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame includes: Get the two-dimensional coordinates of the fruit tree positioning frame; According to the two-dimensional coordinates of the fruit tree positioning frame, the central coordinates of the fruit tree trunk are determined by the central positioning formula; The three-dimensional coordinates of the fruit tree positioning frame are determined based on the central coordinates of the fruit tree trunk and the depth information of the depth map.

3. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 1 is characterized in that: The step of obtaining laser point cloud data and converting the point cloud data into a depth map includes: Obtain calibration data for lidar and image sensors; The point cloud data in the laser radar coordinate system is converted into a depth map in the image sensor coordinate system through a coordinate conversion formula; Get the pixel range of the image sensor and filter out the depth data outside the pixel range of the depth map.

4. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 1 is characterized in that: The calibration of the laser radar and image sensor includes: Image sensor internal calibration; External parameter calibration between LiDAR and image sensor; The image sensor internal parameter calibration includes shooting around the calibration board and importing the shot image into MATLAB for internal parameter calculation to determine the internal parameter matrix of the image sensor; The external parameter calibration between the laser radar and the image sensor includes performing least square fitting calibration using the cloud data of the point laser radar and the image of the image sensor.

5. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 1 is characterized in that: After determining the three-dimensional coordinates of the fruit tree positioning frame according to the depth map and the two-dimensional coordinates of the fruit tree positioning frame, the method further includes: The three-dimensional coordinates of the fruit tree positioning frame are converted into three-dimensional coordinates in the lidar coordinate system through the coordinate inverse conversion formula.

6. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 2 is characterized in that: If there is no depth information at the central coordinate of the fruit tree trunk, the central coordinate of the fruit tree trunk is expanded by an offset amount to obtain the depth information within the expanded range; The depth information of the final central coordinates of the fruit tree trunk is obtained by taking the average value of the total depth information and the number of depth points within the expanded range.

7. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 1 is characterized in that: The fruit tree visual positioning model training includes: Get training images containing fruit trees; Mark the locations of tree trunks in training images; Import the labeled training images into the AI ​​model for training.

8. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 4 is characterized in that: The coordinate transformation formula includes: The Z c is the direction of the optical axis in the image sensor coordinate system; The k C is the intrinsic parameter matrix of the image sensor; The f x and f y is the focal length parameter of the image sensor; The C x and C y is the coordinate of the principal point of the figure; The R cl and T cl The rotation and translation matrix that transforms the lidar coordinates to the image sensor coordinate system.

9. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 3 is characterized in that: The coordinate inverse transformation formula includes: The P l The three-dimensional point coordinates of the fruit tree positioning frame in the laser radar coordinate system; The x l The X-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system; The l The Y-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system; The z l The Z-axis coordinate of the fruit tree positioning frame in the laser radar coordinate system; R is the rotation matrix from the image sensor coordinate system to the laser radar coordinate system; T is the translation vector from the image sensor coordinate system to the laser radar coordinate system; The x c The X-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system; The c The Y-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system; The z c The Z-axis coordinate of the fruit tree positioning frame in the image sensor coordinate system.

10. The fruit tree multi-dimensional positioning method based on the fusion of laser radar and image sensor according to claim 7, characterized in that: The AI ​​model is yolov8.