A semi-trailer positioning method and system based on industrial camera and multi-line laser radar
Through the combination of industrial cameras and multi-line lidar, and using QR codes and point cloud data processing, the relative positions of tractors and semi-trailers on small terminals are accurately positioned, which solves the problem of insufficient positioning accuracy in the existing technology and improves The efficiency and safety of automated docking and docking enhance the competitiveness of the terminal.
Patent Information
- Application Number
- CN202210533629.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-05-17
AI Technical Summary
Existing technology makes it difficult to accurately locate the relative positions of tractors and semi-trailers on small terminals, resulting in low efficiency of automated coupling and insufficient safety.
Using a combination of industrial cameras and multi-line lidar, the relative position of the semi-trailer and the tractor can be accurately determined through QR code image and point cloud data processing. The industrial camera is used to detect the center coordinates of the QR code, and the multi-line lidar is used to Point cloud data is fitted to plane equations to calculate relative position and attitude.
It achieves high-precision positioning of the relative positions of the tractor and the semi-trailer, improves the accuracy and efficiency of automated connection, reduces the risk and cost of terminal operations, and enhances the overall competitiveness of the terminal.
Smart Images

Figure CN114942445B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tractor and semi-trailer positioning, and in particular to a semi-trailer positioning method and system based on an industrial camera and a multi-line laser radar. Background Art
[0002] With the continuous increase in the throughput of the terminal, the loading and unloading work has become more and more complicated. The traditional trailer trucks for handling goods have become a bottleneck restricting the efficiency of loading and unloading. Therefore, there is an urgent need to solve the problem through automation technology. The terminal usually uses trailer trucks to transport goods, which require drivers to drive. The connection with other operating equipment at the terminal is poor and not flexible enough. However, the driving environment of the terminal is flat, wide, and has a high degree of traffic regularity, so it is relatively easy to achieve automatic driving. Existing unmanned terminal transportation mostly uses AGV, which is a transport vehicle equipped with electromagnetic or optical automatic navigation devices, which can travel along the specified navigation path and has safety protection and various transfer functions. However, AGV is mostly used in large port container transportation hubs and is not suitable for small terminals with limited space and irregular transportation of goods.
[0003] The autonomous driving vehicle of the unmanned terminal of Valin Xianggang is an offset transport vehicle, which consists of two parts: a tractor and a semi-trailer. It can be transported immediately after being connected, and is suitable for application scenarios at small terminals. The connection process between the tractor and the semi-trailer is a crucial link. Only when the relative positions of the two are accurately determined can the smooth completion of the automated connection be guaranteed. Common positioning methods include GPS positioning, visual positioning, and lidar positioning. GPS positioning has a low update frequency, is easily affected by signal strength, and has insufficient accuracy, making it difficult to meet the connection requirements. Visual positioning is greatly affected by ambient light and cannot work in dark light. Lidar positioning has high accuracy, high reliability, and mature technology. Summary of the invention
[0004] In view of the above problems, the present invention proposes a semi-trailer positioning method and system based on industrial cameras and multi-line laser radars to solve the problem that the existing positioning methods have low accuracy in determining the relative positions of tractors and semi-trailers on small docks.
[0005] According to one aspect of the present invention, a method for positioning a semitrailer based on an industrial camera and a multi-line laser radar is provided, the method comprising the following steps:
[0006] Step 1: Place the QR code image on the front surface of the semi-trailer, and place the industrial camera and multi-line laser radar on the rear surface of the tractor. When the semi-trailer is detached from the tractor, use the industrial camera to capture an image containing the QR code image, and process the image to obtain the coordinates of the center of the QR code image in the camera coordinates.
[0007] Step 2: Convert the coordinates of the center of the QR code image in the camera coordinate system to the radar coordinate system to obtain the coordinates of the center of the QR code image in the radar coordinate system;
[0008] Step 3: Use a multi-line laser radar to collect original point cloud data, and use the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, preset a first search radius, search the original point cloud data within the first search radius, and obtain a small neighborhood point cloud;
[0009] Step 4: Use the small neighborhood point cloud to fit the plane equation of the QR code image, and obtain the relative position angle between the semi-trailer and the tractor according to the plane equation to obtain the relative posture of the semi-trailer and the tractor;
[0010] Step 5: Taking the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, presetting a second search radius, searching the original point cloud data within the second search radius, and obtaining a large neighborhood point cloud;
[0011] Step 6: According to a preset first distance threshold and the plane equation of the two-dimensional code image, all point clouds whose distance to the plane of the two-dimensional code image is less than the first distance threshold are screened out in the large neighborhood point cloud, that is, point clouds in the same plane as the two-dimensional code image and their line harnesses;
[0012] Step 7: According to the preset second distance threshold, in the screened point cloud and the line bundles in the same plane as the two-dimensional code image, two points whose distance between the two points in each line bundle is less than the second distance threshold are searched as the boundary points on the plane of the two-dimensional code image;
[0013] Step 8: Calculate the precise coordinates of the center of the QR code image in the radar coordinate system based on the coordinates of all the boundary points obtained to obtain the relative positions of the semi-trailer and the tractor.
[0014] Furthermore, in step one, the image is processed as follows: smoothing filtering and binarization are performed to determine the positions of three corner points of the two-dimensional code; and the center coordinates of the two-dimensional code are determined according to the positions of the three corner points.
[0015] Furthermore, the specific steps for obtaining a small neighborhood point cloud in step three include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to find all neighbor points within the first search radius to form a small neighborhood point cloud; the specific steps for obtaining a large neighborhood point cloud in step five include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to find all neighbor points within the second search radius to form a large neighborhood point cloud; wherein the second search radius is larger than the first search radius.
[0016] Furthermore, in step 4, the relative position angle between the semi-trailer and the tractor is:
[0017]
[0018] Where A and B are the coefficients of the plane equation of the QR code image.
[0019] Furthermore, in step six, the point clouds in the point cloud bundle on the same plane as the two-dimensional code image are sorted from small to large according to their horizontal rotation angles, so that when searching for boundary points on the plane of the two-dimensional code image in step seven, the search is performed in the order described.
[0020] Furthermore, the calculation formula for the precise coordinates (x, y) of the center of the QR code image in the radar coordinate system in step eight is as follows:
[0021]
[0022] In the formula, (x p ,y p )、(x q ,y q ) represents the coordinates of the two boundary points in the radar coordinate system.
[0023] According to another aspect of the present invention, a semi-trailer positioning system based on an industrial camera and a multi-line laser radar is provided, wherein a QR code image is placed on the front surface of the semi-trailer, and an industrial camera and a multi-line laser radar are placed on the rear surface of the tractor. The positioning system comprises:
[0024] A camera coordinate acquisition module is configured to use an industrial camera to capture an image containing a QR code image when the semi-trailer is uncoupled from the tractor, and process the image to obtain the coordinates of the center of the QR code image in camera coordinates;
[0025] A coordinate conversion module, configured to convert the coordinates of the center of the two-dimensional code image in the camera coordinate system to the radar coordinate system, and obtain the coordinates of the center of the two-dimensional code image in the radar coordinate system;
[0026] A small neighborhood point cloud acquisition module is configured to collect raw point cloud data using a multi-line laser radar, and use the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of a circle, preset a first search radius, and search the raw point cloud data within the first search radius to acquire a small neighborhood point cloud;
[0027] A relative posture acquisition module is configured to use a small neighborhood point cloud to fit the plane equation of the QR code image, and obtain the relative position angle between the semitrailer and the tractor according to the plane equation to obtain the relative posture of the semitrailer and the tractor;
[0028] A large neighborhood point cloud acquisition module is configured to take the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, preset a second search radius, search the original point cloud data within the second search radius, and acquire a large neighborhood point cloud;
[0029] A point cloud screening module is configured to screen out all point clouds whose distance to the plane of the two-dimensional code image is less than the first distance threshold in the large neighborhood point cloud according to a preset first distance threshold and the plane equation of the two-dimensional code image, that is, point clouds in the same plane as the two-dimensional code image and their line harnesses;
[0030] A boundary point search module is configured to search, according to a preset second distance threshold, in the screened point cloud and the line bundles in the same plane as the two-dimensional code image, for two points in each line bundle whose distance is less than the second distance threshold, which are boundary points on the plane of the two-dimensional code image;
[0031] The relative position acquisition module is configured to calculate and obtain the precise coordinates of the center of the two-dimensional code image in the radar coordinate system according to the obtained coordinates of all boundary points, so as to obtain the relative positions of the semi-trailer and the tractor.
[0032] Furthermore, the camera coordinate acquisition module processes the image as follows: performs smoothing filtering and binarization to determine the positions of three corner points of the two-dimensional code; and determines the center coordinates of the two-dimensional code according to the positions of the three corner points.
[0033] Furthermore, the specific steps for obtaining a small neighborhood point cloud in the small neighborhood point cloud acquisition module include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to search for all neighboring points within the first search radius to form a small neighborhood point cloud; the specific steps for obtaining a large neighborhood point cloud in the large neighborhood point cloud acquisition module include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to search for all neighboring points within the second search radius to form a large neighborhood point cloud; wherein the second search radius is larger than the first search radius.
[0034] Furthermore, the relative position angle between the semitrailer and the tractor in the relative posture acquisition module is:
[0035]
[0036] Where A and B are the coefficients of the plane equation of the QR code image.
[0037] Furthermore, the calculation formula for the precise coordinates (x, y) of the center of the two-dimensional code image in the radar coordinate system in the relative position acquisition module is as follows:
[0038]
[0039] In the formula, (xp ,y p )、(x q ,y q ) represents the coordinates of the two boundary points in the radar coordinate system.
[0040] The beneficial technical effects of the present invention are:
[0041] The present invention sets and fixes the positions of the two-dimensional code, industrial camera and laser radar, and uses the industrial camera to detect the two-dimensional code when the semi-trailer is unhooked from the tractor, extracts the detection value of the center coordinate of the two-dimensional code, and processes the laser radar point cloud through an algorithm to obtain a more accurate calculation value of the center coordinate of the two-dimensional code, thereby realizing the determination of the relative position between the tractor and the semi-trailer. In the present invention, the determination of the center coordinate of the two-dimensional code is realized by plane equation fitting and two-dimensional code boundary point search, and a large amount of equipment and infrastructure do not need to be invested in the early stage. It is suitable for the positioning scene of small docks, and solves the existing problems of low accuracy, low efficiency, heavy and dangerous dock operations, etc., which not only frees dock workers from heavy labor, but also makes the dock more cost-effective, efficient and performance-effective, and the comprehensive competitiveness is further enhanced; further, the present invention introduces an algorithm for sorting point clouds according to radar beams on the basis of the existing PCL library encapsulation algorithm, which effectively improves the accuracy of boundary point search. Compared with the existing GPS positioning and visual positioning methods, the present invention is not easily affected by environmental factors and has higher positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The present invention can be better understood by referring to the description given below in conjunction with the accompanying drawings, which together with the following detailed description are included in this specification and form a part of this specification, and are used to further illustrate the preferred embodiments of the present invention and explain the principles and advantages of the present invention.
[0043] Figure 1 A schematic diagram of a flow chart of a method for positioning a semi-trailer based on an industrial camera and a multi-line laser radar according to an embodiment of the present invention;
[0044] Figure 2 A detailed flow chart of a method for positioning a semi-trailer based on an industrial camera and a multi-line laser radar according to an embodiment of the present invention;
[0045] Figure 3 This is a specific implementation flow chart of step 1 in an embodiment of the present invention;
[0046] Figure 4 This is a schematic diagram of the assembly of a QR code base in an embodiment of the present invention;
[0047] Figure 5 This is a schematic diagram of the assembly of an industrial camera and a laser radar holder in an embodiment of the present invention;
[0048] Figure 6 A schematic diagram of the positions of the QR code and the laser radar in an embodiment of the present invention;
[0049] Figure 7 This is an example diagram of the point cloud processing effect in an embodiment of the present invention;
[0050] Figure 8 This is a specific implementation flow chart of step 2 in an embodiment of the present invention;
[0051] Fig. 9 This is a specific implementation flow chart of step three in an embodiment of the present invention;
[0052] Fig.10 This is a specific implementation flow chart of step 4 in the embodiment of the present invention.
[0053] Fig.11 The present invention is a schematic structural diagram of a semi-trailer positioning system based on an industrial camera and a multi-line laser radar according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to enable those skilled in the art to better understand the scheme of the present invention, exemplary implementations or embodiments of the present invention will be described below in conjunction with the accompanying drawings. Obviously, the described implementations or embodiments are only implementations or embodiments of a part of the present invention, not all of them. Based on the implementations or embodiments of the present invention, all other implementations or embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.
[0055] An embodiment of the present invention provides a method for positioning a semitrailer based on an industrial camera and a multi-line laser radar, the method comprising the following steps:
[0056] Step 1: Place the QR code image on the front surface of the semi-trailer, and place the industrial camera and multi-line laser radar on the rear surface of the tractor. When the semi-trailer is detached from the tractor, use the industrial camera to capture an image containing the QR code image, and process the image to obtain the coordinates of the center of the QR code image in the camera coordinates.
[0057] Step 2: Convert the coordinates of the center of the QR code image in the camera coordinate system to the radar coordinate system to obtain the coordinates of the center of the QR code image in the radar coordinate system;
[0058] Step 3: Use a multi-line laser radar to collect original point cloud data, and use the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, preset a first search radius, search the original point cloud data within the first search radius, and obtain a small neighborhood point cloud;
[0059] Step 4: Use the small neighborhood point cloud to fit the plane equation of the QR code image, and obtain the relative position angle between the semi-trailer and the tractor according to the plane equation to obtain the relative posture of the semi-trailer and the tractor;
[0060] Step 5: Taking the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, presetting a second search radius, searching the original point cloud data within the second search radius, and obtaining a large neighborhood point cloud;
[0061] Step 6: According to a preset first distance threshold and the plane equation of the two-dimensional code image, all point clouds whose distance to the plane of the two-dimensional code image is less than the first distance threshold are screened out in the large neighborhood point cloud, that is, point clouds in the same plane as the two-dimensional code image and their line harnesses;
[0062] Step 7: According to the preset second distance threshold, in the screened point cloud and the line bundles in the same plane as the two-dimensional code image, two points whose distance between the two points in each line bundle is less than the second distance threshold are searched as the boundary points on the plane of the two-dimensional code image;
[0063] Step 8: Calculate the precise coordinates of the center of the QR code image in the radar coordinate system based on the coordinates of all the boundary points obtained to obtain the relative positions of the semi-trailer and the tractor.
[0064] In this embodiment, optionally, in step one, the image is processed as follows: smoothing filtering and binarization are performed to determine the positions of three corner points of the two-dimensional code; and the center coordinates of the two-dimensional code are determined according to the positions of the three corner points.
[0065] In this embodiment, optionally, the specific steps of obtaining the small neighborhood point cloud in step three include: creating a KD tree structure, using a nearest neighbor search algorithm based on the KD tree to find all neighboring points within the first search radius to form a small neighborhood point cloud.
[0066] In this embodiment, optionally, the specific steps for obtaining a large neighborhood point cloud in step five include: creating a KD tree structure, using a nearest neighbor search algorithm based on a KD tree to search for all neighboring points within the second search radius to form a large neighborhood point cloud; wherein the second search radius is larger than the first search radius.
[0067] In this embodiment, optionally, the relative position angle between the semitrailer and the tractor in step 4 is:
[0068]
[0069] Where A and B are the coefficients of the plane equation of the QR code image.
[0070] In this embodiment, optionally, the calculation formula of the precise coordinates (x, y) of the center of the two-dimensional code image in the radar coordinate system in step eight is as follows:
[0071]
[0072] In the formula, (x p ,y p )、(x q ,y q ) represents the coordinates of the two boundary points in the radar coordinate system.
[0073] Another embodiment of the present invention provides a semi-trailer positioning method based on an industrial camera and a multi-line laser radar, such as Figure 1 , 2 As shown, the method is specifically carried out according to the following steps:
[0074] Step 1: According to the operation mode of the semi-trailer at the terminal, set and fix the positions of the identification object (QR code) and the sensor (industrial camera, lidar). When the semi-trailer is detached from the tractor, use the industrial camera to detect the QR code, extract the center coordinates of the QR code, and convert them to the lidar coordinate system, such as Figure 3 As shown;
[0075] According to an embodiment of the present invention, Figure 4 , 5 As shown in Figure 6, the positions and fixing methods of the QR code, industrial camera, and laser radar are as follows: an inverted trapezoidal base is designed with a 38×38 (cm) QR code attached to it and fixed to the front surface of the semi-trailer. A camera radar holder is set on the tractor to place the ZED industrial camera and the Sagitar RS-Ruby_Lite multi-line laser radar. The coordinate systems of the camera and the laser radar both meet the right-hand criterion, among which the coordinate system of the ZED industrial camera is O C X C Y C Z C , O C is the origin of the coordinate system, Z C The axis coincides with the camera optical axis, X C Axis vertical camera pointing right, Y C The axis is vertical and the camera is pointing downward; the laser radar coordinate system is O L X L Y L Z L , O L is the origin of the coordinate system, X L The Y axis coincides with the center axis of the radar laser. L Axis vertical radar pointing left, Z L Axis vertical radar pointing upwards.
[0076] The QR code is composed of black and white, and the QR code is not designed to be centrally symmetrical and has directionality, so it is easy to be discovered by processing the image threshold. The industrial camera is used to capture the QR code image, perform smoothing filtering and binarization, find the positioning corner points of the three corners of the QR code, determine the positions of the three corner points, and determine that the largest angle of the triangle formed by the three corner points is the point in the upper left corner of the QR code. The lower left and upper right positions of the other two corner points are determined based on the angle difference between the two sides of the angle, and the range of the QR code is identified based on these features.
[0077] Furthermore, considering that the camera and the QR code are not necessarily facing each other, the captured image can be stretched first, the captured QR code can be restored to a square, and then image processing is performed through smoothing filtering and binarization. Feature detection is performed on the processing result, and the upper left, upper right and lower left corners of the QR code are extracted. Finally, the center point of the QR code is obtained through the geometric characteristics of the square, and the coordinates of the center point of the QR code are obtained by multiplying it by the inverse matrix of the stretching transformation.
[0078] It should be noted that the identification object here - the QR code only needs to provide graphic features, so any square graphic composed of black and white, not centrally symmetrical, and directional can be used as an identification object.
[0079] Using the QR code range detected by the camera, calculate the center coordinates of the QR code (x C ,y C ,z C ), which is the coordinate in the industrial camera coordinate system, is converted to the laser radar coordinate system; according to the designed camera radar holder, the offset of the relative position of the laser radar and the camera geometric center is calculated as △x, △y, △z; the x-axis of the radar is the z-axis of the camera, the y-axis of the radar is opposite to the x-axis of the camera, and the z-axis of the radar is opposite to the y-axis of the camera, so the center coordinate of the QR code in the laser radar coordinate system is O=(x L ,y L ,z L )=(z C +△x,-x C +△y,-y C +△z).
[0080] Step 2: Use laser radar to collect the original point cloud of the semi-trailer and the tractor in the uncoupled state, use the center coordinate O of the QR code obtained in step 1 as the center of the circle to query the specified radius range, fit the QR code plane equation with the searched point cloud, and obtain the normal vector and angle of the front surface of the semi-trailer;
[0081] According to an embodiment of the present invention, Figure 8As shown, the specific process is: Step 2.1, create a KD tree, perform a query within a specified radius, and obtain a small neighborhood point cloud: create a KD tree structure, use the nearest neighbor search algorithm based on the KD tree to speed up the calculation, set the search radius to r1, call the radiusSearch function, and search for all neighboring points within the radius range; the KD tree constructed for the three-dimensional point cloud is three-dimensional, and each node is a three-dimensional binary tree. For each data point, start from the root node and compare it with the search radius r1, and continue downward until it reaches a child node. The node is the nearest neighbor point, and then search the remaining child nodes, compare their distance values with the current nearest neighbor point distance value, and continuously update the nearest neighbor point until all searches are completed, and the final nearest neighbor point is obtained to form a small neighborhood point cloud;
[0082] Step 2.2, Fitting the QR code plane equation: Call the random sampling consensus algorithm encapsulated in the PCL library, and estimate the parameters of the plane model in an iterative manner from the point cloud data obtained by searching the neighborhood containing the "outlier point". To improve the accuracy, set a higher number of iterations and iterate the plane model until the optimal value is reached; the final fitted QR code plane equation is:
[0083] Ax+By+Cz+D=0 (1)
[0084] In the formula, A, B, C, and D are the four coefficients of the QR code plane equation; the QR code plane equation is the plane equation in the laser radar coordinate system;
[0085] Step 2.3, calculate the normal vector and angle of the front surface of the semi-trailer: The normal vector of the QR code plane, that is, the normal vector of the front surface of the semi-trailer, is obtained from the plane equation (1), which is (A, B, C). The relative position angle between the semi-trailer and the tractor is calculated and output as:
[0086]
[0087] Where A and B are the coefficients of the QR code plane equation.
[0088] Step 3: Create a KD tree, perform a query within a specified radius, obtain a large neighborhood point cloud, sort the searched point cloud, filter out the point cloud in the same plane as the QR code and determine the line harness where it is located;
[0089] According to an embodiment of the present invention, Fig. 9As shown, the specific process is: Step 3.1, create a KD tree, perform a query within a specified radius, and obtain a large neighborhood point cloud: create a KD tree structure, use a nearest neighbor search algorithm based on a KD tree to speed up the calculation, set the search radius to r2, call the radiusSearch function, and search for all neighboring points within the radius range; the KD tree constructed for a three-dimensional point cloud is three-dimensional, and each node is a three-dimensional binary tree. For each data point, start from the root node and compare it with the search radius r2, and continue downward until it reaches a child node. The node is the nearest neighbor point, and then search the remaining child nodes, compare their distance values with the current nearest neighbor point distance value, and continuously update the nearest neighbor point until all searches are completed, and the final nearest neighbor point is obtained to form a large neighborhood point cloud;
[0090] Step 3.2, point cloud classification and sorting: The Sagitar RS-Ruby-Lite used is an 80-line radar, and the radar beam N_SCANS=80 is defined. According to the Ring (beam) value output by the radar's own point cloud coordinates, the searched point cloud is placed in the corresponding established radar frame channel laserRing (RING). The point cloud data format includes the y-axis coordinate value. According to the working characteristics of the mechanical laser radar rotating 360° to collect point clouds, the y-axis coordinate value reflects the horizontal rotation angle of the point cloud. For the point cloud in each channel, it is sorted from small to large according to the horizontal rotation angle of the point cloud, that is, the point cloud in the channel is sorted from left to right.
[0091] It should be noted that there is no restriction on the wiring harness of the multi-line laser radar, which is determined according to the selected laser radar. Therefore, it can also be a multi-line laser radar of other brands.
[0092] Step 3.3: Filter the point clouds in each line bundle that are in the same plane as the QR code: Calculate the point (x o ,y o ,z o ) to the two-dimensional code plane Ax+By+Cz+D=0 is:
[0093]
[0094] In the formula, A, B, C, D are the coefficients of the plane equation;
[0095] Set the first distance threshold d1 from the point to the plane, and the judgment condition is:
[0096] d o-plane <d1 (4)
[0097] The point clouds that meet the threshold requirements are those that are on the same plane as the QR code, and the number of point clouds on the plane in each channel can be obtained.
[0098] Step 4: Corresponding to the width of the QR code base, find the boundary points of each harness, select the harness located on the plane, and calculate the center coordinates of the QR code;
[0099] According to an embodiment of the present invention, Fig.10 As shown, the specific process is as follows: Step 4.1, for the wire bundles that have completed the point cloud sorting, search the boundary points of each wire bundle in order to obtain the wire bundle located on the plane: In the wire bundles that have completed the point cloud sorting, search from left to right according to the point cloud order, set the boundary threshold d2, i.e., the second distance threshold, according to the width of the QR code base, and search for the two boundary points P(x p ,y p ,z p )、Q(x q ,y q ,z q ), judged by the Euclidean distance between two points, the judgment condition is:
[0100]
[0101] Those that meet the threshold requirements are the wire bundles on the QR code plane;
[0102] Step 4.2, calculate the center coordinates of the QR code: The number of laser radar beams located on the plane is N, and the center coordinates of the QR code are calculated by the average value of the coordinates of each pair of boundary points:
[0103]
[0104] Where x and y are the center of the QR code. L Axis, Y L The coordinate value of the axis, x p 、x q ,y p ,y q For each boundary point X L Axis, Y L The coordinate values of the axis.
[0105] Another embodiment of the present invention provides a semi-trailer positioning system based on an industrial camera and a multi-line laser radar, wherein a QR code image is placed on the front surface of the semi-trailer, and an industrial camera and a multi-line laser radar are placed on the rear surface of the tractor. Fig.11 As shown, the positioning system includes:
[0106] The camera coordinate acquisition module 10 is configured to use an industrial camera to collect an image containing a QR code image when the semi-trailer is uncoupled from the tractor, and process the image to obtain the coordinates of the center of the QR code image in the camera coordinates;
[0107] A coordinate conversion module 20, configured to convert the coordinates of the center of the two-dimensional code image in the camera coordinate system to the radar coordinate system, and obtain the coordinates of the center of the two-dimensional code image in the radar coordinate system;
[0108] The small neighborhood point cloud acquisition module 30 is configured to collect original point cloud data using a multi-line laser radar, and use the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, preset a first search radius, and search the original point cloud data within the first search radius to obtain a small neighborhood point cloud;
[0109] A relative posture acquisition module 40 is configured to fit the plane equation of the QR code image using a small neighborhood point cloud, and obtain the relative position angle between the semi-trailer and the tractor according to the plane equation to obtain the relative posture of the semi-trailer and the tractor;
[0110] A large neighborhood point cloud acquisition module 50 is configured to take the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of a circle, preset a second search radius, and search the original point cloud data within the second search radius to acquire a large neighborhood point cloud;
[0111] The point cloud screening module 60 is configured to screen out all point clouds whose distance to the plane of the two-dimensional code image is less than the first distance threshold in the large neighborhood point cloud according to the preset first distance threshold and the plane equation of the two-dimensional code image, that is, the point clouds in the same plane as the two-dimensional code image and the line bundles in which they are located; sort the point clouds in the point cloud line bundles in the same plane as the two-dimensional code image in ascending order according to their horizontal rotation angles;
[0112] The boundary point search module 70 is configured to search for boundary points on the plane of the two-dimensional code image in the point cloud and the line bundle in which the point cloud is located, according to the preset second distance threshold, in the point cloud and the line bundle in which the point cloud is located, and to search for boundary points on the plane of the two-dimensional code image in the order of the point cloud sorted in the line bundle, and to search for two points in each line bundle whose distance between the two points is less than the second distance threshold as boundary points on the plane of the two-dimensional code image;
[0113] The relative position acquisition module 80 is configured to calculate and obtain the precise coordinates of the center of the two-dimensional code image in the radar coordinate system according to the obtained coordinates of all boundary points, so as to obtain the relative positions of the semi-trailer and the tractor.
[0114] In this embodiment, optionally, the camera coordinate acquisition module 10 processes the image as follows: performs smoothing filtering and binarization to determine the positions of three corner points of the two-dimensional code; and determines the center coordinates of the two-dimensional code according to the positions of the three corner points.
[0115] In this embodiment, optionally, the specific steps for obtaining a small neighborhood point cloud in the small neighborhood point cloud acquisition module 30 include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to search for all neighbor points within the first search radius to form a small neighborhood point cloud; the specific steps for obtaining a large neighborhood point cloud in the large neighborhood point cloud acquisition module include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to search for all neighbor points within the second search radius to form a large neighborhood point cloud; wherein the second search radius is larger than the first search radius.
[0116] In this embodiment, optionally, the relative position angle between the semitrailer and the tractor in the relative posture acquisition module 40 is:
[0117]
[0118] Where A and B are the coefficients of the plane equation of the QR code image.
[0119] In this embodiment, optionally, the calculation formula of the precise coordinates (x, y) of the center of the two-dimensional code image in the radar coordinate system in the relative position acquisition module 80 is as follows:
[0120]
[0121] In the formula, (x p ,y p )、(x q ,y q ) represents the coordinates of the two boundary points in the radar coordinate system.
[0122] The functions of the semi-trailer positioning system based on an industrial camera and a multi-line laser radar described in this embodiment can be explained by the aforementioned semi-trailer positioning method based on an industrial camera and a multi-line laser radar. Therefore, for the parts not described in detail in this embodiment, please refer to the above method embodiments and will not be repeated here.
[0123] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments are contemplated within the scope of the invention thus described. The disclosure of the present invention is intended to be illustrative rather than restrictive of the scope of the invention, which is defined by the appended claims.
Claims
1. A semi-trailer positioning method based on industrial camera and multi-line laser radar, characterized in that: The following steps are involved: Step 1: Place the QR code image on the front surface of the semi-trailer, and place the industrial camera and multi-line laser radar on the rear surface of the tractor. When the semi-trailer is detached from the tractor, use the industrial camera to capture an image containing the QR code image, and process the image to obtain the coordinates of the center of the QR code image in the camera coordinates. Step 2: Convert the coordinates of the center of the QR code image in the camera coordinate system to the radar coordinate system to obtain the coordinates of the center of the QR code image in the radar coordinate system; Step 3: Use a multi-line laser radar to collect original point cloud data, and use the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, preset a first search radius, search the original point cloud data within the first search radius, and obtain a small neighborhood point cloud; Step 4: Use the small neighborhood point cloud to fit the plane equation of the QR code image, and obtain the relative position angle between the semi-trailer and the tractor according to the plane equation to obtain the relative posture of the semi-trailer and the tractor; Step 5: Taking the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, presetting a second search radius, searching the original point cloud data within the second search radius, and obtaining a large neighborhood point cloud; Step 6: According to a preset first distance threshold and the plane equation of the two-dimensional code image, all point clouds whose distance to the plane of the two-dimensional code image is less than the first distance threshold are screened out in the large neighborhood point cloud, that is, point clouds in the same plane as the two-dimensional code image and their line harnesses; Step 7: According to the preset second distance threshold, in the screened point cloud and the line bundles in the same plane as the two-dimensional code image, two points whose distance between the two points in each line bundle is less than the second distance threshold are searched as the boundary points on the plane of the two-dimensional code image; Step 8: Calculate the precise coordinates of the center of the QR code image in the radar coordinate system based on the coordinates of all the boundary points obtained to obtain the relative positions of the semi-trailer and the tractor.
2. A method for positioning a semitrailer based on an industrial camera and a multi-line laser radar according to claim 1, characterized in that: In step 1, the image is processed as follows: smoothing filtering and binarization are performed to determine the positions of the three corner points of the QR code; and the center coordinates of the QR code are determined based on the positions of the three corner points.
3. A method for positioning a semitrailer based on an industrial camera and a multi-line laser radar according to claim 1 or 2, characterized in that: The specific steps for obtaining a small neighborhood point cloud in step three include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to find all neighbor points within the first search radius to form a small neighborhood point cloud; the specific steps for obtaining a large neighborhood point cloud in step five include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to find all neighbor points within the second search radius to form a large neighborhood point cloud; wherein the second search radius is larger than the first search radius.
4. A method for positioning a semitrailer based on an industrial camera and a multi-line laser radar according to claim 3, characterized in that: The relative position angle between the semi-trailer and the tractor in step 4 is: Where A and B are the coefficients of the plane equation of the QR code image.
5. A method for positioning a semitrailer based on an industrial camera and a multi-line laser radar according to claim 4, characterized in that: In step 6, the point clouds in the point cloud bundle on the same plane as the two-dimensional code image are sorted from small to large according to their horizontal rotation angles, so that the boundary points on the plane of the two-dimensional code image can be searched in order in step 7.
6. A method for positioning a semitrailer based on an industrial camera and a multi-line laser radar according to claim 5, characterized in that: The calculation formula for the precise coordinates (x, y) of the center of the QR code image in the radar coordinate system in step 8 is as follows: In the formula, (x p ,y q )、(x q ,y q ) represents the coordinates of the two boundary points in the radar coordinate system.
7. A semi-trailer positioning system based on industrial camera and multi-line laser radar, characterized in that: The QR code image is placed on the front surface of the semi-trailer, and the industrial camera and multi-line laser radar are placed on the rear surface of the tractor. The positioning system includes: A camera coordinate acquisition module is configured to use an industrial camera to capture an image containing a QR code image when the semi-trailer is uncoupled from the tractor, and process the image to obtain the coordinates of the center of the QR code image in camera coordinates; A coordinate conversion module, configured to convert the coordinates of the center of the two-dimensional code image in the camera coordinate system to the radar coordinate system, and obtain the coordinates of the center of the two-dimensional code image in the radar coordinate system; A small neighborhood point cloud acquisition module is configured to collect raw point cloud data using a multi-line laser radar, and use the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of a circle, preset a first search radius, and search the raw point cloud data within the first search radius to acquire a small neighborhood point cloud; A relative posture acquisition module is configured to use a small neighborhood point cloud to fit the plane equation of the QR code image, and obtain the relative position angle between the semitrailer and the tractor according to the plane equation to obtain the relative posture of the semitrailer and the tractor; A large neighborhood point cloud acquisition module is configured to take the coordinates of the center of the obtained two-dimensional code image in the radar coordinate system as the center of the circle, preset a second search radius, search the original point cloud data within the second search radius, and acquire a large neighborhood point cloud; A point cloud screening module is configured to screen out all point clouds whose distance to the plane of the two-dimensional code image is less than the first distance threshold in the large neighborhood point cloud according to a preset first distance threshold and the plane equation of the two-dimensional code image, that is, point clouds in the same plane as the two-dimensional code image and their line harnesses; A boundary point search module is configured to search, according to a preset second distance threshold, in the screened point cloud and the line bundles in the same plane as the two-dimensional code image, for two points in each line bundle whose distance is less than the second distance threshold, which are boundary points on the plane of the two-dimensional code image; The relative position acquisition module is configured to calculate and obtain the precise coordinates of the center of the two-dimensional code image in the radar coordinate system according to the obtained coordinates of all boundary points, so as to obtain the relative positions of the semi-trailer and the tractor.
8. A semi-trailer positioning system based on industrial camera and multi-line laser radar according to claim 7, characterized in that: The camera coordinate acquisition module processes the image as follows: performs smoothing filtering and binarization to determine the positions of three corner points of the two-dimensional code; and determines the center coordinates of the two-dimensional code according to the positions of the three corner points.
9. A semi-trailer positioning system based on industrial camera and multi-line laser radar according to claim 7 or 8, characterized in that: The specific steps for obtaining a small neighborhood point cloud in the small neighborhood point cloud acquisition module include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to find all neighbor points within the first search radius to form a small neighborhood point cloud; the specific steps for obtaining a large neighborhood point cloud in the large neighborhood point cloud acquisition module include: creating a KD tree structure, and using a nearest neighbor search algorithm based on a KD tree to find all neighbor points within the second search radius to form a large neighborhood point cloud; wherein the second search radius is larger than the first search radius.
10. A semi-trailer positioning system based on industrial camera and multi-line laser radar according to claim 9, characterized in that: The relative position angle between the semitrailer and the tractor in the relative posture acquisition module is: Where A and B are the coefficients of the plane equation of the QR code image; The calculation formula for the precise coordinates (x, y) of the center of the two-dimensional code image in the radar coordinate system in the relative position acquisition module is as follows: In the formula, (x p ,y p )、(x p ,y q ) represents the coordinates of the two boundary points in the radar coordinate system.
