A target detection method based on the fusion of binocular camera and lidar
Through the fusion technology of binocular cameras and lidar, the problem of low detection accuracy in water target detection is solved, efficient perception in harsh environments is achieved, and it is suitable for target detection in water and land scenes.
Patent Information
- Application Number
- CN202311392226.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2043-10-25
AI Technical Summary
Existing target detection methods based on cameras and millimeter-wave radars cannot obtain reliable information and locations in water target detection, resulting in low detection accuracy and cannot be applied to water ships and large ships.
Using the fusion technology of binocular cameras and lidar, by constructing a spatial model of binocular cameras and lidar, image and point cloud preprocessing is performed, combined with the improved YOLOv5 network model, depth information and parallax information are calculated, and Quadratic map matching for object detection.
It improves the detection accuracy and reliability of water target detection, enables effective perception in harsh environments, and is suitable for both water and land scenarios.
Smart Images

Figure CN117372680B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of perception technology of watercraft and large water vessels, and in particular to a target detection method based on the fusion of a binocular camera and a laser radar. Background Art
[0002] Object detection technology is widely used in many fields such as assisted driving, pedestrian detection, microbial detection, impact recognition, etc. Its main task is to identify or separate the target of interest from the target group. Currently, object detection technology mainly obtains the shape, texture and category of the target through detection algorithms based on image and point cloud data.
[0003] The Chinese patent with publication number CN115937842A discloses a 3D target detection method based on the fusion of camera and millimeter wave radar. The target detection method proposed by the patent can achieve reliable detection results at a relatively low cost. However, the detection algorithm based on camera and millimeter wave radar still has inherent defects in actual scenarios. For example, the fusion of camera and millimeter wave radar cannot obtain reliable information and position information of water targets. Therefore, the current target detection algorithm is not suitable for target detection of water vessels and large ships on the water. Summary of the invention
[0004] In view of the defects of the prior art, the present invention proposes a method for fusion at the data layer and the feature layer based on the perception technology of the fusion of binocular camera and lidar, which solves the problem of low detection accuracy caused by reliance on image information for water target detection. The detection information is more reliable and the perception effect is better in harsh environments. It has good application prospects both in water detection and on land detection.
[0005] In order to achieve the above object, the present invention provides a target detection method based on the fusion of binocular camera and laser radar, comprising the following steps:
[0006] (1) Construct a spatial model for the fusion of binocular camera and lidar, and collect binocular images and point clouds based on this model;
[0007] (2) performing adaptive local histogram equalization, marginalization and grayscale preprocessing on the binocular image;
[0008] (3) for the point cloud, establishing an adaptive filtering rule to perform point cloud preprocessing, and performing point cloud clustering to obtain different point cloud clusters;
[0009] (4) constructing an improved YOLOv5 network model, detecting the preprocessed binocular image, and calculating depth information and disparity information;
[0010] (5) Perform secondary mapping matching and detection on the depth information and the point clouds of the different point cloud clusters to obtain target detection results.
[0011] Furthermore, the spatial model of the fusion of the binocular camera and the lidar sensor is specifically:
[0012] (1.1) Use a binocular camera and a laser radar to simultaneously scan and capture data of the scene to be calibrated, obtain the binocular image and point cloud, and record the posture and position;
[0013] (1.2) Calibrate the binocular camera to obtain the intrinsic parameters and distortion parameters of the binocular camera, and calculate the extrinsic parameter matrix of the binocular camera according to the transformation of the camera coordinates and the world coordinates of the binocular camera. The mapping relationship is as follows:
[0014]
[0015] Where: (X c , Y c , Z c ) is the camera coordinate of the binocular camera; (X w , Y w , Z w ) is its corresponding world coordinate; R, t is the external parameter matrix of the binocular camera, R is a 3*3 rotation orthogonal matrix, and t is a 3*1 translation matrix;
[0016] (1.3) Calculate the point cloud coordinates of the laser radar, project the point cloud coordinates of the laser radar onto the camera coordinate system of the binocular camera, and obtain the corresponding pixel coordinates and depth values, specifically:
[0017]
[0018]
[0019] Where: (X L , Y L , Z L ) is the point cloud coordinate of the laser radar; E is the transformation matrix from the point cloud coordinate of the laser radar to the camera coordinate system of the binocular camera, E -1 is the inverse matrix of the transformation matrix; H is the coefficient matrix from the camera coordinates of the binocular camera to the pixel coordinates, (X i , Y i ) are the pixel coordinates of the binocular camera;
[0020] (1.4) adjusting the scanning direction and phase angle of the laser radar, repeating step (1.3) multiple times, and calculating the optimal coordinates of the point cloud coordinates of the laser radar in the camera coordinate system of the binocular camera according to the calibration parameters of the binocular camera;
[0021] (1.5) Based on the internal and external parameters of the binocular camera and the optimal coordinates of the laser radar in the binocular camera coordinate system, a change relationship between the binocular camera and the laser radar is established, and a spatial model of the binocular camera and the laser radar is constructed.
[0022] Furthermore, the adaptive local histogram equalization is specifically as follows:
[0023] The binocular image is divided into a plurality of sub-block areas, and the number of pixels of the cut sub-block areas is calculated when the histogram value is 255. Whether it is greater than 110; if it is true, the original image is directly output; otherwise, the illumination and brightness of the entire image and each sub-block area are calculated;
[0024] If the average brightness value of the sub-block area is less than the average value of the entire image, an adaptive histogram equalization method is used; otherwise, a limited contrast adaptive histogram equalization method is used, and finally the sub-block area images are spliced and output;
[0025] For the binocular image after adaptive local histogram equalization, smoothing filtering is also used to remove image noise;
[0026] The marginalization includes Gaussian filtering, calculating the size and direction of image gradient, non-maximum suppression, double threshold edge screening and edge connection;
[0027] The Gaussian filter is used to smooth the binocular image and reduce noise;
[0028] The calculating image gradient magnitude and direction is to calculate the gradient and gradient direction of each pixel point on the binocular image;
[0029] The non-maximum suppression is to simplify the edge detection result by suppressing non-maximum pixels;
[0030] The double threshold edge screening is to use two thresholds to screen out the real edge;
[0031] The connecting edge is to connect the double threshold screening edges to form a complete edge line;
[0032] The grayscale is specifically as follows:
[0033] For the binocular image, the brightness is calculated. If the brightness is lower than 70, grayscale processing is performed using the maximum value method. If the brightness is higher than 70, grayscale processing is performed using the weighted method or the average value method.
[0034] Furthermore, the step of establishing an adaptive filtering rule for the point cloud to process the point cloud is as follows:
[0035] (3.1) Analyze the spatial distribution and density distribution of the point cloud to obtain the average point cloud density in the horizontal and vertical directions;
[0036] (3.2) Determine the average point cloud density. If it is less than the first threshold, the point cloud of this frame is invalid and needs to be re-collected. Otherwise, if it is greater than or equal to the first threshold and less than the second threshold, a radius-based filtering method is used. If it is greater than or equal to the second threshold, a morphology-based filtering method is used.
[0037] Furthermore, the filtering method based on morphology is specifically:
[0038] Dividing the point cloud into a plurality of voxel grids of equal size and equal spacing;
[0039] Calculating the point cloud density at each voxel center position to determine noise and unprocessed areas in the data;
[0040] Selecting an initial filter radius and performing a morphological filter opening operation at the center of each voxel to reduce noise and smooth data;
[0041] The filter radius is gradually reduced, the above morphological filtering operation is repeated, and the point cloud density is calculated at each scale to determine the noise and unprocessed areas until the filter radius is reduced to a given range.
[0042] Furthermore, the detecting of the preprocessed binocular image and the calculation of the depth information and the disparity information are specifically as follows:
[0043] (4.1) Using the improved YOLOv5 network model, target detection is performed on the left and right images of the preprocessed binocular image to obtain the location and category information of the target object;
[0044] (4.2) Matching the left and right images by using a binocular disparity calculation algorithm to obtain the disparity information, and then calculating the depth information;
[0045]
[0046]
[0047] Wherein: Z is the depth information, i.e., the distance from the center point of the target to the center points of the two cameras of the binocular camera; f is the focal length of the binocular camera; B is the center distance between the two cameras of the binocular camera; d is the imaging point P of a certain point of the scene to be observed on the two cameras of the binocular camera tar_l ,P tar_r Bd is the disparity information, that is, the horizontal offset between the pixels of the left and right images.
[0048] Furthermore, the improved YOLOv5 network model is specifically:
[0049] The input end scales the input images of different scales to images of uniform scale; in the classification training stage, the Mosaic data enhancement operation is used to improve the training speed of the image prediction model and the accuracy of the network; the backbone network C3 is replaced with a more lightweight network ShuffleNetV2 structure; and the loss function CIOU is replaced with the EIOU function, and its penalty term formula is as follows:
[0050]
[0051] Where: L IOU is the overlap loss, L dis Center distance loss, L asp is the width-height loss; p represents the Euclidean distance between the two center points of the predicted box and the true box; c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the true box; b, b gt Represent the center points of the predicted box and the real box respectively; w, w gt is the width of the predicted box and the real box; h, h gt Represents the height of the predicted box and the true box.
[0052] Further, the depth information is matched with the point cloud information of the different point cloud clusters for secondary mapping and detection, and the target detection result is obtained as follows:
[0053] (5.1) matching the depth information of the binocular camera with the point clouds of different point cloud clusters of the laser radar according to the depth information;
[0054] (5.2) performing secondary target detection on the target in the binocular image according to the matching result;
[0055] (5.3) The target is reconstructed in three dimensions through the matched depth information and point cloud information, and the detection result is optimized.
[0056] Furthermore, the step (5.1) is specifically as follows:
[0057] Segmenting the different point cloud clusters, that is, dividing the point cloud in each point cloud cluster into two parts: foreground and background; wherein the foreground point refers to a point on the surface of a scene object in the point cloud, and the background point refers to a point in the scene space that is not occupied by an object;
[0058] Acquire depth information corresponding to the point cloud on the binocular camera, and select feature points corresponding to the point cloud according to the depth information as registration points in a matching process;
[0059] Matching the registration points with the point clouds in the different point cloud clusters, and using an iterative closest point algorithm to accurately align the point clouds and the registration points;
[0060] For the aligned point cloud, coordinate information thereof in the camera coordinate system of the binocular camera is calculated by using the depth information to obtain point cloud information in the camera coordinate system of the binocular camera.
[0061] Beneficial effects of the present invention:
[0062] This paper proposes a method to fuse binocular cameras and lidar at the data layer and feature layer, which solves the problem of low detection accuracy caused by reliance on image information for water target detection. At the same time, it realizes the functions of weighted ranging based on the fusion of binocular cameras and lidar and distinguishing sea-sky line. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a network flow diagram of a target detection method based on the fusion of a binocular camera and a laser radar according to an embodiment of the present invention.
[0064] Figure 2 It is a schematic diagram of the network structure of a target detection method based on the fusion of a binocular camera and a laser radar according to an embodiment of the present invention.
[0065] Figure 3 It is a schematic diagram of the binocular image processing flow of an embodiment of the present invention.
[0066] Figure 4 It is a schematic diagram of the laser radar point cloud processing flow according to an embodiment of the present invention.
[0067] Figure 5 It is a schematic diagram of the YOLOv5 network model architecture of an embodiment of the present invention.
[0068] Figure 6 This is a visual detection diagram of the fusion of binocular camera and laser radar in an embodiment of the present invention. DETAILED DESCRIPTION
[0069] In order to more clearly understand the method of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0070] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0071] like Figure 1 , Figure 2 As shown, the embodiment of the present invention provides a target detection method based on the fusion of a binocular camera and a laser radar, comprising the following steps:
[0072] S101, constructing a binocular camera and lidar fusion space model, and collecting binocular images and point clouds based on this model;
[0073] The spatial model of binocular camera and lidar fusion is established as follows:
[0074] (1) Use a binocular camera and lidar to simultaneously scan and capture data of the scene to be calibrated, obtain a binocular image and point cloud, and record the posture and position.
[0075] (2) Calibrate the binocular camera to obtain the intrinsic parameters and distortion parameters of the binocular camera. Calculate the extrinsic parameter matrix of the binocular camera based on the transformation of the camera coordinates and world coordinates of the binocular camera. The mapping relationship is as follows:
[0076]
[0077] Where: (X c , Y c , Z c ) is the camera coordinate of the binocular camera; (X w , Y w , Z w ) is its corresponding world coordinate; R, t is the external parameter matrix of the binocular camera, R is a 3*3 rotation orthogonal matrix, and t is a 3*1 translation matrix.
[0078] (3) Calculate the point cloud coordinates of the laser radar and project the point cloud coordinates of the laser radar onto the camera coordinate system of the binocular camera to obtain the corresponding pixel coordinates and depth values, specifically:
[0079]
[0080]
[0081] Where: (XL ,Y L ,Z L ) is the point cloud coordinate of the laser radar; E is the transformation matrix from the point cloud coordinate of the laser radar to the camera coordinate system of the stereo camera, E -1 is the inverse matrix of the transformation matrix; H is the coefficient matrix from the camera coordinates of the binocular camera to the pixel coordinates, (X i , Y i ) is the pixel coordinate of the binocular camera;
[0082] (4) adjusting the laser radar scanning direction and phase angle of view, repeating step (3) multiple times, and calculating the optimal coordinates of the laser radar point cloud coordinates in the camera coordinate system of the binocular camera according to the binocular camera calibration parameters, that is, the exact position of the point cloud coordinates in the camera coordinate system;
[0083] (5) Based on the internal and external parameters of the binocular camera and the optimal coordinates of the laser radar in the binocular camera coordinate system, a change relationship between the binocular camera and the laser radar is established, and a spatial model of the binocular camera and the laser radar is constructed.
[0084] Based on the above established model, the binocular camera collects binocular images and the lidar collects point clouds.
[0085] S102, performing adaptive local histogram equalization, marginalization and grayscale preprocessing on the binocular image;
[0086] Adaptive local histogram equalization: Figure 3 As shown in the figure, the binocular image is divided into multiple sub-block areas, and the number of pixels of the cut sub-block areas is calculated when the histogram value is 255. If it is true, the original image is directly output, otherwise the illumination and brightness of the entire image and each sub-block area are calculated. If the average brightness value of the sub-block area is less than the average value of the entire image, the adaptive histogram equalization method is used, otherwise the limited contrast adaptive histogram equalization method is used. Finally, all sub-block area images are spliced and output.
[0087] After the binocular image is subjected to adaptive local histogram equalization, the contrast is enhanced while the noise in the image is increased or enhanced. Since the noise in the processed image is evenly distributed, in order to ensure the image quality, it is also necessary to use smoothing filtering to remove the image noise. In the embodiment of the present invention, smoothing median filtering is used for denoising. The principle is to set a one-dimensional sequence f1, f2, ..., f n , take the window length as m (m is an odd number), sort the m numbers and take the middle value, which is the output. The expression is:
[0088]
[0089] Edge processing includes Gaussian filtering, calculating the magnitude and direction of image gradients, non-maximum suppression, double threshold edge screening, and edge connection.
[0090] Gaussian filtering is used to smooth the binocular image and reduce noise; calculating the image gradient size and direction is used to calculate the gradient and gradient direction of each pixel in the binocular image; non-maximum suppression is used to simplify the edge detection results by suppressing non-maximum pixels; dual-threshold edge filtering is used to use two thresholds to filter out the true edges; and connecting edges is used to connect the dual-threshold filtered edges to form a complete edge line.
[0091] Grayscale: For binocular images, calculate their brightness. If the brightness is lower than 70, use the maximum value method for grayscale processing. If it is higher than 70, use the weighted method or average value method for grayscale processing.
[0092] Average method:
[0093]
[0094] Weighted method:
[0095] Gray(i,j)=0.299*R(i,j)+0.578*G(i,j)*+0.114*B(i,j)
[0096] Maximum method:
[0097] Gray(i,j)=max{R(i,j),G(i,j),B(i,j)}
[0098] S103, establishing an adaptive filtering rule for the point cloud to pre-process the point cloud, and performing point cloud clustering to obtain different point cloud clusters;
[0099] like Figure 4 As shown in the figure, the specific steps of establishing adaptive filtering rules for point cloud preprocessing are as follows:
[0100] First, analyze its spatial distribution and density distribution, and calculate the average point cloud density in the horizontal and vertical directions. If there are less than 500 point clouds per cubic meter, the point cloud data of this frame is invalid, and the data is collected again. Otherwise, proceed to the next stage. In order to ensure the rapid accuracy of data detection and analysis, for point cloud data greater than 500 and less than 50,000 per cubic meter, a radius-based filtering method is adopted. The set filtering radius is dynamic. In the embodiment of the present invention, the filtering radius is 1 / 10 of the current frame point cloud density; if there are more than 50,000 point cloud data per cubic meter, a morphological-based filtering method is adopted. The morphological-based filtering method is specifically as follows:
[0101] The point cloud is divided into multiple voxel grids of equal size and spacing; the point cloud density is calculated at the center of each voxel to determine the noise and unprocessed areas in the data; the initial filter radius is selected, and a morphological filter opening operation (first corrosion, then expansion) is performed at the center of each voxel to reduce noise and smooth the data; the filter radius is gradually reduced, the above morphological filtering operation is repeated, and the point cloud density is calculated at each scale to determine the noise and unprocessed areas, until the filter radius is reduced to a given range, and the algorithm terminates.
[0102] The filtered point cloud is clustered to obtain different point cloud clusters.
[0103] S104, constructing an improved YOLOv5 network model, detecting the preprocessed binocular image, and calculating depth information and disparity information;
[0104] like Figure 5 As shown in the figure, the improved YOLOv5 network model is obtained by improving the traditional YOLOv5 network model. The input end scales the input images of different scales to images of uniform scale. In the classification training stage, the Mosaic data enhancement operation is used to improve the training speed of the image prediction model and the accuracy of the network. The backbone network C3 is replaced with a more lightweight network ShuffleNetV2 structure. The loss function CIOU is replaced with the EIOU function. The EIOU function calculates the difference in width and height on the basis of CIOU instead of the aspect ratio. The penalty term formula is as follows:
[0105]
[0106] Where: L IOU is the overlap loss, L dis Center distance loss, L asp is the width-height loss; p represents the Euclidean distance between the two center points of the predicted box and the true box; c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the true box; b,b gt Represent the center points of the predicted box and the real box respectively; w, w gt is the width of the predicted box and the real box; h, h gt Represents the height of the predicted box and the true box.
[0107] The following are the main steps of the YOLOv5 network model:
[0108] Backbone network: YOLOv5 uses a powerful convolutional neural network as its backbone network. CSPDarknet53 is used as its backbone network, which is a deep convolutional neural network structure for extracting image features.
[0109] Feature Pyramid: In order to identify objects of different scales, YOLOv5 uses a feature pyramid network to process features at different levels. This pyramid network fuses features at different levels by adding upsampling and downsampling operations and cross-layer connection operations.
[0110] Prediction head: In each grid cell, YOLOv5 uses a prediction head to predict the object. The prediction head includes multiple convolutional layers to predict the bounding box location and category confidence from the feature map.
[0111] NMS (Non-Maximum Suppression): In order to eliminate redundant bounding boxes, YOLOv5 uses the NMS algorithm. The NMS algorithm screens the final bounding box based on the degree of bounding box overlap and category confidence.
[0112] By using the improved algorithm, a better model is trained to determine the location and category information of the target image in the left and right images of the binocular camera, and displayed as a rectangular box with a center point. This design makes YOLOv5 very suitable for real-time target detection tasks.
[0113] The embodiment of the present invention establishes a data set suitable for water target detection, with a total of 4028 images of 6 categories, namely ships, buoys, cardboard, metal objects, and glass objects. The data set is annotated. The improved YOLOv5 network model is used to detect the preprocessed binocular image as follows:
[0114] The improved YOLOv5 network model is used to perform target detection on the left and right images of the preprocessed binocular image to obtain the location and category information of the target object;
[0115] The left and right images are matched by a binocular disparity calculation algorithm to obtain disparity information, and then the depth information is calculated;
[0116]
[0117]
[0118] Where: Z is the depth information, that is, the distance from the center point of the target to the center points of the two cameras of the binocular camera; f is the focal length of the binocular camera; B is the center distance between the two cameras of the binocular camera; d is the imaging point P of a certain point of the scene to be observed on the two cameras of the binocular camera tar_l , P tar_r The distance between the left and right images; Bd is the disparity information, that is, the horizontal offset between the pixels of the left and right images.
[0119] S105 , performing secondary mapping matching and detection on the depth information and the point clouds of the different point cloud clusters to obtain a target detection result.
[0120] The processed binocular image and point cloud data are subjected to feature extraction and perception detection to find potential targets and generate target 3D candidate frames. In order to further improve the detection accuracy and better reflect the target location information, the target image with the candidate frame is processed again, mapped and reconstructed with the clustered point cloud data, and detection perception is performed again to improve the target detection accuracy. Specifically:
[0121] (1) matching the depth information of the binocular camera with the point clouds of different point cloud clusters of the laser radar according to the depth information;
[0122] Segmentation is performed for different point cloud clusters, that is, the point clouds in each point cloud cluster are divided into foreground and background parts; the foreground points refer to the points on the surface of the scene objects in the point cloud, while the background points refer to the points not occupied by the objects in the scene space;
[0123] The depth information corresponding to the point cloud is obtained on the binocular camera, and the feature points corresponding to the point cloud information are selected through the depth information as the registration points of the matching process;
[0124] Match the registration points with point clouds in different point cloud clusters, and use an iterative closest point algorithm to accurately align the point clouds and registration points;
[0125] For the aligned point cloud, its coordinate information in the binocular camera coordinate system is calculated through the depth information to obtain the point cloud information in the camera coordinate system of the binocular camera.
[0126] (2) Based on the matching results, perform secondary target detection on the target in the binocular image;
[0127] (3) The target is reconstructed in three dimensions through the matched depth information and point cloud information, and the detection results are optimized.
[0128] like Figure 6 As shown, this is a visual detection diagram of the fusion of binocular camera and lidar. It can be seen that through the joint use of binocular camera, effective target retrieval can be performed under adverse conditions.
[0129] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the embodiments of the present invention. Therefore, the embodiments of the present invention will not be limited to the embodiments shown herein, but rather to the widest range consistent with the principles and novel features disclosed herein.
Claims
1. A target detection method based on the fusion of binocular camera and laser radar, characterized in that: The steps include: (1) Construct a spatial model for the fusion of binocular camera and lidar, and collect binocular images and point clouds based on this model; (2) performing adaptive local histogram equalization, marginalization and grayscale preprocessing on the binocular image; (3) for the point cloud, establishing an adaptive filtering rule to perform point cloud preprocessing, and performing point cloud clustering to obtain different point cloud clusters; (4) constructing an improved YOLOv5 network model, detecting the preprocessed binocular image, and calculating depth information and disparity information; The improved YOLOv5 network model is specifically: The input end scales the input images of different scales to images of uniform scale; in the classification training stage, the Mosaic data enhancement operation is used to improve the training speed of the image prediction model and the accuracy of the network; the backbone network C3 is replaced with a more lightweight network ShuffleNetV2 structure; and the loss function CIOU is replaced with the EIOU function, and its penalty term formula is as follows: Where: L IOU is the overlap loss, L dis Center distance loss, L asp is the width-height loss; p represents the Euclidean distance between the two center points of the predicted box and the true box; c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the true box; b, b gt Represent the center points of the predicted box and the real box respectively; w, w gt is the width of the predicted box and the real box; h, h gt Represents the height of the predicted box and the true box; (4.1) Using the improved YOLOv5 network model, target detection is performed on the left and right images of the preprocessed binocular image to obtain the location and category information of the target object; (4.2) Matching the left and right images by using a binocular disparity calculation algorithm to obtain the disparity information, and then calculating the depth information; Wherein: Z is the depth information, i.e., the distance from the center point of the target to the center points of the two cameras of the binocular camera; f is the focal length of the binocular camera; B is the center distance between the two cameras of the binocular camera; d is the imaging point P of a certain point of the scene to be observed on the two cameras of the binocular camera tar_l , P tar_r Bd is the disparity information, that is, the horizontal offset between the pixels of the left and right images; (5) Perform secondary mapping matching and detection on the depth information and the point clouds of the different point cloud clusters to obtain target detection results.
2. The target detection method based on the fusion of binocular camera and laser radar according to claim 1 is characterized in that: The binocular camera and laser radar fusion space model is specifically as follows: (1.1) Use a binocular camera and a laser radar to simultaneously scan and capture data of the scene to be calibrated, obtain the binocular image and point cloud, and record the posture and position; (1.2) Calibrate the binocular camera to obtain the intrinsic parameters and distortion parameters of the binocular camera, and calculate the extrinsic parameter matrix of the binocular camera according to the transformation of the camera coordinates and the world coordinates of the binocular camera. The mapping relationship is as follows: Where: (X c , Y c , Z c ) is the camera coordinate of the binocular camera; (X w , Y w , Z w ) is its corresponding world coordinate; R, t is the external parameter matrix of the binocular camera, R is a 3*3 rotation orthogonal matrix, and t is a 3*1 translation matrix; (1.3) Calculate the point cloud coordinates of the laser radar, project the point cloud coordinates of the laser radar onto the camera coordinate system of the binocular camera, and obtain the corresponding pixel coordinates and depth values, specifically: Where: (X L , Y L , Z L ) is the point cloud coordinate of the laser radar; E is the transformation matrix from the point cloud coordinate of the laser radar to the camera coordinate system of the binocular camera, E -1 is the inverse matrix of the transformation matrix; H is the coefficient matrix from the camera coordinates of the binocular camera to the pixel coordinates, (X i , Y i ) are the pixel coordinates of the binocular camera; (1.4) adjusting the scanning direction and phase angle of the laser radar, repeating step (1.3) multiple times, and calculating the optimal coordinates of the point cloud coordinates of the laser radar in the camera coordinate system of the binocular camera according to the calibration parameters of the binocular camera; (1.5) Based on the internal and external parameters of the binocular camera and the optimal coordinates of the laser radar in the binocular camera coordinate system, a change relationship between the binocular camera and the laser radar is established, and a spatial model of the binocular camera and the laser radar is constructed.
3. The target detection method based on the fusion of binocular camera and laser radar according to claim 1 is characterized in that: The adaptive local histogram equalization is specifically as follows: The binocular image is divided into a plurality of sub-block areas, and the number of pixels of the cut sub-block areas is calculated when the histogram value is 255. Whether it is greater than 110; if true, the original image is directly output; otherwise, the illumination and brightness of the entire image and each of the sub-block areas are calculated; If the average brightness value of the sub-block area is less than the average value of the entire image, an adaptive histogram equalization method is used; otherwise, a limited contrast adaptive histogram equalization method is used, and finally the sub-block area images are spliced and output; For the binocular image after adaptive local histogram equalization, smoothing filtering is also used to remove image noise; The marginalization includes Gaussian filtering, calculating the size and direction of image gradient, non-maximum suppression, double threshold edge screening and edge connection; The Gaussian filter is used to smooth the binocular image and reduce noise; The calculating image gradient magnitude and direction is to calculate the gradient and gradient direction of each pixel point on the binocular image; The non-maximum suppression is to simplify the edge detection result by suppressing non-maximum pixels; The double threshold edge screening is to use two thresholds to screen out the real edge; The connecting edge is to connect the double threshold screening edges to form a complete edge line; The grayscale is specifically as follows: For the binocular image, the brightness is calculated. If the brightness is lower than 70, grayscale processing is performed using the maximum value method. If the brightness is higher than 70, grayscale processing is performed using the weighted method or the average value method.
4. The target detection method based on the fusion of binocular camera and laser radar according to claim 1 is characterized in that: The step of establishing an adaptive filtering rule for point cloud processing is as follows: (3.1) Analyze the spatial distribution and density distribution of the point cloud to obtain the average point cloud density in the horizontal and vertical directions; (3.2) Determine the average point cloud density. If it is less than the first threshold, the point cloud of this frame is invalid and needs to be re-collected. Otherwise, if it is greater than or equal to the first threshold and less than the second threshold, a radius-based filtering method is used. If it is greater than or equal to the second threshold, a morphology-based filtering method is used.
5. The target detection method based on the fusion of binocular camera and laser radar according to claim 4 is characterized in that: The morphology-based filtering method is specifically: Dividing the point cloud into a plurality of voxel grids of equal size and equal spacing; Calculating the point cloud density at each voxel center position to determine noise and unprocessed areas in the data; Selecting an initial filter radius and performing a morphological filter opening operation at the center of each voxel to reduce noise and smooth data; The filter radius is gradually reduced, the above morphological filtering operation is repeated, and the point cloud density is calculated at each scale to determine the noise and unprocessed areas until the filter radius is reduced to a given range.
6. The target detection method based on the fusion of binocular camera and laser radar according to claim 1 is characterized in that: The depth information is matched with the point cloud information of the different point cloud clusters for secondary mapping and detection, and the target detection result is obtained as follows: (5.1) matching the depth information of the binocular camera with the point clouds of different point cloud clusters of the laser radar according to the depth information; (5.2) performing secondary target detection on the target in the binocular image according to the matching result; (5.3) The target is reconstructed in three dimensions through the matched depth information and point cloud information, and the detection result is optimized.
7. The target detection method based on the fusion of binocular camera and laser radar according to claim 6 is characterized in that: The step (5.1) is specifically: Segmenting the different point cloud clusters, that is, dividing the point cloud in each point cloud cluster into two parts: foreground and background; wherein the foreground point refers to a point on the surface of a scene object in the point cloud, and the background point refers to a point in the scene space that is not occupied by an object; Acquire depth information corresponding to the point cloud on the binocular camera, and select feature points corresponding to the point cloud according to the depth information as registration points in a matching process; Matching the registration points with the point clouds in the different point cloud clusters, and using an iterative closest point algorithm to accurately align the point clouds and the registration points; For the aligned point cloud, coordinate information thereof in the camera coordinate system of the binocular camera is calculated by using the depth information to obtain point cloud information in the camera coordinate system of the binocular camera.
