Target positioning method and device, equipment, storage medium and program product
By calculating the compensation distance and compensating the target positioning coordinates, the problem of insufficient target positioning accuracy in the prior art is solved, and higher precision target positioning and more unified multi-camera positioning reference points are achieved.
Patent Information
- Application Number
- CN202411582617.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art lacks positioning accuracy in object detection, especially in complex or dynamic environments, and cannot provide sufficiently accurate target positioning.
By obtaining the latitude and longitude coordinates and target size information of key points on the horizontal line of the lower edge of the target's boundary detection box, the compensation distance is calculated, and the latitude and longitude coordinates of the mapping center point are compensated to obtain more accurate target positioning coordinates.
The accuracy of target positioning is improved, ensuring that the reference points of positioning coordinates for the same target from different angles are unified, and the reliability and accuracy of target fusion is enhanced.
Smart Images

Figure CN119468912A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle driving technology, and in particular to a target positioning method, device, equipment, storage medium and program product. Background Art
[0002] Visual object detection is an important application in the field of computer vision and is widely used in scenarios such as autonomous driving, monitoring systems, and intelligent transportation. Modern object detection algorithms can identify and locate target objects (such as vehicles, pedestrians, traffic signs, etc.) from images, usually by generating a bounding box to represent the location of the target.
[0003] In image target detection, although the algorithm can effectively identify the target object selected by the boundary detection box, the positioning accuracy may be affected by many factors, such as reference point selection, image plane and world coordinate system transformation matrix, camera viewing angle, road slope of the camera screen, image resolution, target size, target shape and field of view distortion.
[0004] That is, although the existing technology can provide basic target detection capabilities, in practical applications, the positioning accuracy of the edge center detection result of the 2D detection box is still not enough to meet the needs. For example, in an autonomous driving system, very accurate target positioning is required to make safe driving decisions. However, in existing detection methods, especially in complex or dynamic environments, it is impossible to provide sufficiently accurate target positioning. Summary of the invention
[0005] The present invention provides a target positioning method, device, equipment, storage medium and program product, which are used to solve the problem of low positioning accuracy of targets in existing target detection results.
[0006] In order to solve the above technical problems, the embodiments of the present invention provide the following technical solutions:
[0007] An embodiment of the present invention provides a target positioning method, including:
[0008] Obtaining the latitude and longitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and target size information of the first target;
[0009] According to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame and the target size information, a first distance is obtained, where the first distance is a compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target;
[0010] The first distance is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
[0011] Optionally, the key points on the lower edge horizontal line of the boundary detection box include:
[0012] A mapping center point of the first target on the lower edge horizontal line of the boundary detection box;
[0013] a first point on the horizontal line of the lower edge and a second point on the horizontal line of the lower edge;
[0014] The mapping center point of the first target on the lower edge horizontal line of the boundary detection frame is the midpoint between the first point on the lower edge horizontal line of the boundary detection frame and the second point on the lower edge horizontal line of the boundary detection frame;
[0015] The first point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the first corner point of the boundary detection box, and the second point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the second corner point of the boundary detection box;
[0016] The first corner point of the boundary detection box and the second corner point of the boundary detection box are corner points on both sides of the lowermost corner point of the boundary detection box;
[0017] The lower edge horizontal line is a horizontal line passing through the lowermost corner point of the boundary detection frame.
[0018] Optionally, obtaining the latitude and longitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and target size information of the first target includes:
[0019] Using visual detection technology, obtaining pixel coordinates of key points on a lower edge horizontal line of a boundary detection box of the first target and a target type of the first target;
[0020] Using a camera calibration matrix, transforming the pixel coordinates of the key points to obtain the longitude and latitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame of the first target;
[0021] According to the target type, target size information of the first target is obtained.
[0022] Optionally, obtaining the first distance according to the latitude and longitude coordinates of the key point on the lower edge horizontal line of the boundary detection box and the target size information includes:
[0023] Obtaining a projection width of the boundary detection frame projected onto the lower edge horizontal line according to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame;
[0024] The first distance is obtained according to the projection width and the target size information.
[0025] Optionally, obtaining the first distance according to the projection width and the target size information includes:
[0026] Obtaining a posture angle of the first target according to the projection width and the target size information;
[0027] The first distance is obtained according to the posture angle, the projection width and the target size information.
[0028] Optionally, the target size information includes a first size of the first target, where the first size is a size of the first target in a direction perpendicular to the posture angle;
[0029] Obtaining the first distance according to the posture angle, the projection width and the target size information includes:
[0030] The first distance is obtained according to the posture angle, the projection width and the first size.
[0031] Optionally, the method further comprises:
[0032] Determining a compensation direction according to the direction in which the first target is projected onto the lower edge horizontal line;
[0033] Wherein, using the first distance, compensating the latitude and longitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target includes:
[0034] In the compensation direction, the first distance is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
[0035] The embodiment of the present invention further provides a target positioning device, including:
[0036] A first acquisition module, used to acquire the longitude and latitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and the target size information of the first target;
[0037] A first processing module, configured to obtain a first distance according to the latitude and longitude coordinates of a key point on the lower edge horizontal line of the boundary detection frame and the target size information, wherein the first distance is a compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target;
[0038] The second processing module is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box by using the first distance to obtain the positioning coordinates of the first target.
[0039] An embodiment of the present invention further provides a target positioning device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program implements the steps in any one of the target positioning methods described above when executed by the processor.
[0040] An embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the steps in any one of the target positioning methods described above are implemented.
[0041] An embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps in any one of the target positioning methods described above.
[0042] The beneficial effects of the present invention are:
[0043] The target positioning method provided by the scheme of the present invention obtains the latitude and longitude coordinates of the key points of the boundary detection frame of the first target and the target size information of the first target, and obtains a first distance according to the latitude and longitude coordinates of the key points of the boundary detection frame and the target size information. The first distance is the compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target. The first distance is used to compensate the latitude and longitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection frame to obtain the positioning coordinates of the first target, and the positioning coordinates perceived by the roadside perception device are compensated and corrected, so that the positioning coordinate reference points of multiple roadside cameras for the same target from different angles are unified, thereby improving the accuracy of the positioning coordinates of the obtained target. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A flow chart showing a target positioning method provided by an embodiment of the present invention;
[0045] Figure 2 One of the schematic diagrams showing a first target in a picture captured by a camera field of view of a roadside camera provided in an embodiment of the present invention;
[0046] Figure 3 A second schematic diagram showing a first target in a picture captured by a camera field of view of a roadside camera provided in an embodiment of the present invention;
[0047] Figure 4 A specific flow chart showing the target positioning method provided by an embodiment of the present invention;
[0048] Figure 5 A schematic diagram showing the structure of a target positioning device provided by an embodiment of the present invention;
[0049] Figure 6 A schematic diagram showing the structure of a target positioning device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the technical problems, technical solutions and advantages to be solved by the application clearer, the following will be described in detail in conjunction with the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help fully understand the embodiments of the application. Therefore, it should be clear to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the application. In addition, for clarity and brevity, the description of known functions and structures has been omitted.
[0051] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0052] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0053] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0054] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0055] In order to solve the problem of low target positioning accuracy in existing target detection results, embodiments of the present invention provide a target positioning method, apparatus, device, storage medium and program product.
[0056] like Figure 1 As shown, an embodiment of the present invention provides a target positioning method, including:
[0057] Step 101: Obtain the longitude and latitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and the target size information of the first target.
[0058] The first target is a target to be detected or a target to be located.
[0059] In this embodiment, the first target is taken as various types of traffic participants in a traffic scene, such as vehicles, pedestrians, etc., for example.
[0060] The target size information includes at least the sizes of the first target in two vertical directions, and the sizes in the two vertical directions can represent the shape or approximate shape of the first target. For example, when the first target is a vehicle, the target size information includes the length and width of the first target.
[0061] In this step, the visual target detection technology is used to identify and locate the position of the first target in the camera image of the roadside camera. The boundary detection frame of the first target is used to indicate the position of the first target, and it can also be understood that the boundary detection frame of the first target is used to select and locate the first target. The boundary detection frame is a rectangular frame, that is, it can also be understood that the boundary detection frame of the first target is the target circumscribed rectangular frame of the first target.
[0062] Among them, the key points on the lower edge horizontal line of the boundary detection box include:
[0063] A mapping center point of the first target on the lower edge horizontal line of the boundary detection box;
[0064] a first point on the horizontal line of the lower edge and a second point on the horizontal line of the lower edge;
[0065] The mapping center point of the first target on the lower edge horizontal line of the boundary detection frame is the midpoint between the first point on the lower edge horizontal line of the boundary detection frame and the second point on the lower edge horizontal line of the boundary detection frame;
[0066] The first point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the first corner point of the boundary detection box, and the second point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the second corner point of the boundary detection box;
[0067] The first corner point of the boundary detection box and the second corner point of the boundary detection box are corner points on both sides of the lowermost corner point of the boundary detection box;
[0068] The lower edge horizontal line is a horizontal line passing through the lowermost corner point of the boundary detection box, and the lower edge horizontal line may also be referred to as a target projection line of the first target.
[0069] Among them, it can be understood that the first corner point of the boundary detection box is the left corner point of the bottom corner point of the boundary detection box, and the second corner point of the boundary detection box is the right corner point of the bottom corner point of the boundary detection box, or, the first corner point of the boundary detection box is the right corner point of the bottom corner point of the boundary detection box, and the second corner point of the boundary detection box is the left corner point of the bottom corner point of the boundary detection box.
[0070] The first point on the lower edge horizontal line is the point on the lower edge horizontal line where the first corner point of the boundary detection box is vertically mapped. It can be understood that the line between the first point on the lower edge horizontal line and the first corner point of the boundary detection box is perpendicular to the lower edge horizontal line.
[0071] The second point on the lower edge horizontal line is the point on the lower edge horizontal line where the second corner point of the boundary detection box is vertically mapped. It can be understood that the line between the second point on the lower edge horizontal line and the second corner point of the boundary detection box is perpendicular to the lower edge horizontal line.
[0072] For example, Figure 2 Schematic diagram of a first target (vehicle) in a picture captured by a roadside camera's camera field of view. In a picture captured by a roadside camera's camera field of view, the boundary detection frame of the first target is a rectangular frame surrounding the vehicle in the figure, where N represents the bottom corner point of the boundary detection frame, the horizontal line passing through point N in the figure is the lower edge horizontal line, A represents the first point on the lower edge horizontal line, B represents the second point on the lower edge horizontal line, and P represents the mapping center point of the first target on the lower edge horizontal line. L represents the length of the first target, and W represents the width of the first target.
[0073] Step 102: Obtain a first distance based on the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame and the target size information. The first distance is a compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target.
[0074] It should be noted that, since the angles of the first target photographed by the roadside cameras at different positions are different, the orientations and angles of the first target in the roadside cameras at different positions are also different. Therefore, the positions of the positioning reference points of the first target detected by the visual detection technology (the positioning reference point can also be understood as the mapping center point of the first target on the horizontal line of the lower edge of the boundary detection box) are also different, that is, there is an error between the position of the positioning reference point of the detected first target and the actual position of the first target. For example, when the first target is a vehicle and the vehicle is at an intersection, a roadside camera is set on each side of the intersection. The positions of the positioning reference points of the first target detected by the roadside cameras at several intersections may be located on different sides of the vehicle. The coordinate difference between the positioning reference points of the camera in the front direction and the camera in the rear direction can even reach an error of about 5 meters in vehicle length. If it is a large vehicle (such as common vehicles such as trucks and buses), the positioning error of each camera will be more significant, which will lead to the problem of poor accuracy of the positioning reference points detected by multiple cameras of roadside fusion perception for the same target.
[0075] Therefore, in this step, by setting the lower edge horizontal line of the boundary detection box and using the latitude and longitude coordinates of the key points on the lower edge horizontal line and the target size information, the compensation distance between the lower edge horizontal line of the boundary detection box and the chassis center point of the first target is obtained, thereby realizing distance compensation for the reference point position.
[0076] The compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target can be understood as the vertical distance from the center point of the chassis of the first target to the lower edge horizontal line of the boundary detection frame.
[0077] Step 103: using the first distance, compensating the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
[0078] In this step, the first distance obtained above is used to perform distance compensation on the latitude and longitude coordinates of the mapping center point of the first target on the lower edge horizontal line, so that the positioning coordinates of the first target are more accurate, and the positioning coordinates perceived by the roadside perception device (i.e., the positioning reference point coordinates mentioned above) are compensated and corrected, so that the positioning coordinate reference points of multiple roadside cameras for the same target from different angles are unified, thereby improving the accuracy of the positioning coordinates of the target.
[0079] In an optional embodiment, obtaining the latitude and longitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and the target size information of the first target includes:
[0080] The pixel coordinates of the key points on the horizontal line of the lower edge of the boundary detection frame of the first target and the target type of the first target are obtained by using visual detection technology. The visual detection technology is 2D visual detection. In this optional embodiment, in the visual detection technology, deep neural network technology is used to perform target detection on various types of traffic participants in the traffic scene captured by the roadside camera to obtain an image detection frame (i.e., boundary detection frame). These frames represent the position of the target in each camera image. Traffic participants at the same intersection will have multiple cameras for visual detection. The visual detection results include the boundary detection frame and the target category. At the same time, the pixel coordinates of the left and right corners of the lower edge of the boundary detection frame (i.e., the first corner point of the boundary detection frame and the second corner point of the boundary detection frame mentioned above) can also be detected.
[0081] The pixel coordinates of the bottom corner point of the boundary detection frame and the bottom edge horizontal line can be calculated according to the pixel coordinates of the left corner point and the right corner point of the bottom edge of the boundary detection frame.
[0082] Furthermore, based on the left and right corner points of the lower edge of the boundary detection box, the distance between the first point on the lower edge horizontal line and the second point on the lower edge horizontal line can be obtained, and this distance can be called the perspective projection width of the first target in the camera field of view.
[0083] The pixel coordinates of the key points are converted using the camera calibration matrix to obtain the longitude and latitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame of the first target. The camera calibration matrix is a pre-calibrated camera extrinsic matrix. By converting the pixel coordinates of the key points into the longitude and latitude coordinates of the key points, the target can be located more accurately and the positioning accuracy can be improved.
[0084] According to the target type, target size information of the first target is obtained.
[0085] The target types include pedestrians, vehicles, traffic indicators, etc. Specifically, vehicles can also be divided into cars, trucks, special vehicles, etc.
[0086] After obtaining the target type of the first target, the length and width of the target can be estimated, which is usually based on industry standards or empirical data. For example, if a target is detected as a car, the typical size of a common car is used as a benchmark for estimation.
[0087] In an optional embodiment, obtaining the first distance according to the latitude and longitude coordinates of the key point on the lower edge horizontal line of the boundary detection box and the target size information includes:
[0088] According to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection box, the projection width of the boundary detection box projected onto the lower edge horizontal line is obtained, wherein the projection width can also be understood as the above-mentioned perspective projection width, that is, the horizontal distance between the first point on the lower edge horizontal line of the boundary detection box and the second point on the lower edge horizontal line of the boundary detection box is calculated, which is the projection width.
[0089] The first distance is obtained according to the projection width and the target size information.
[0090] Optionally, obtaining the first distance according to the projection width and the target size information includes:
[0091] According to the projection width and the target size information, the posture angle (or posture inclination) of the first target is obtained, that is, firstly based on the projection width and the target size information, the posture angle of the first target is solved, wherein the posture angle refers to the angle formed between the driving direction (or orientation) of the first target and the lower edge horizontal line, or the posture angle refers to the angle formed between the axis (such as the longitudinal axis) of the first target and the lower edge horizontal line. This angle reflects the rotational posture of the first target relative to the roadside camera. Through the principle of perspective, combined with the estimated length and width of the target and the projection width, the top view of the target is inferred on the basis of assuming that the top view of the target is the circumscribed rectangle of the actual projection. This step helps to more accurately understand the positioning of the target in three-dimensional space. The posture angle is Figure 2 The angle α is shown.
[0092] Furthermore, the first distance is obtained according to the posture angle, the projection width and the target size information.
[0093] The target size information includes a first size of the first target, where the first size is a size of the first target in a direction perpendicular to the posture angle. In this embodiment, the first size is the width of the first target;
[0094] Obtaining the first distance according to the posture angle, the projection width and the target size information includes:
[0095] The first distance is obtained according to the posture angle, the projection width and the first size.
[0096] The following is combined with Figure 2 , specifically explain the solution process of the first distance:
[0097] Figure 2 In the figure, O represents the center point of the chassis of the first target, and the distance between O and P is the first distance. Figure 2From the geometric relationship shown, it can be seen that the length of the AB line segment (projected width) is the sum of the AN and BN line segments, and the geometric relationship is shown in Formula 1:
[0098] AB=W·sinα+L·cosα Formula 1
[0099] From the above formula, we can see that the pose angle α is only related to the projection width and the length and width of the first target. The length of the AB line segment is known, the length and width of the first target, L and W, are known, and the target has been approximated by the circumscribed rectangle. The position order of the front and rear of the vehicle does not affect the value of the pose angle. Therefore, the range of α can be defaulted to The posture angle α can be solved using the trigonometric function characteristics according to the above formula.
[0100] When the posture inclination angle is small, the specific posture modeling is as follows Figure 2 As shown, a perpendicular line is drawn through point P along the perpendicular line AB, intersecting with the center axis of the vehicle. The distance from the intersection point O to point P is the compensation distance (i.e., the first distance). The intersection point between the ray (or extension line) of the center axis (longitudinal axis) of the vehicle and the horizontal line of the lower edge is M. Based on the above modeling relationship, the solution can be obtained by formula 2:
[0101]
[0102] MN and AN can be solved by formula 3 and formula 4:
[0103]
[0104] AN=W·sinα Formula 4
[0105] According to the trigonometric function relationship, it can be simplified to formula 5:
[0106]
[0107] Then the compensation distance OP can be obtained by solving formula 6:
[0108]
[0109] It should also be noted that when the posture inclination angle is large, such as Figure 3 As shown, Figure 3 Another schematic diagram of a first target (vehicle) in a picture captured by a camera field of view of a roadside camera.
[0110] according to Figure 3 Perform posture modeling and obtain the PM length solution formula as shown in Formula 7:
[0111]
[0112] It can be seen that Formula 2 is the same as Formula 7. Therefore, from Formula 3 and Formula 4, it can be known that the solution formulas for MN and AN line ends are independent of the change in α angle. Therefore, in the case of large target inclination, the solution formula for compensation distance OP still conforms to Formula 6. Therefore, no matter what the inclination angle of the target relative to the camera is, the compensation distance can be calculated according to Formula 6.
[0113] In an optional embodiment, the method further includes:
[0114] Determining a compensation direction according to the direction in which the first target is projected onto the lower edge horizontal line;
[0115] Wherein, using the first distance, compensating the latitude and longitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target includes:
[0116] In the compensation direction, the first distance is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
[0117] It should be noted that in scenarios similar to roadside cameras, the camera usually looks down slightly at the intersection to detect traffic participants at the intersection. In this scenario, the camera settings and shooting angles can meet certain conditions so that the bottom edge of the detection frame can be regarded as the ground line of the target.
[0118] Camera pose:
[0119] Since the camera is slightly overlooking the intersection, the optical axis of the camera (camera axis) is not completely perpendicular to the ground, but has a certain depression angle. In this case, the horizontal and vertical lines on the ground will be tilted to a certain extent in the image.
[0120] Bottom edge of bounding box:
[0121] The bottom edge of the bounding box is horizontal in the image, which means it is horizontal in the image. Although the camera optical axis is not completely perpendicular to the ground, the bottom edge of the bounding box can still be regarded as the ground line of the target as long as the depression angle is not too large.
[0122] In scenes where the camera is looking down slightly, the lower edge of the bounding box can be approximated as the ground line of the target, because in most cases, the bottom of the traffic participant in contact with the ground is horizontal in the image. This approximation is feasible in practical applications, especially when dealing with multi-target detection and tracking, and can be used as an effective simplification method.
[0123] Based on the above analysis, in the traffic roadside camera scene, if the lower edge of the boundary detection box is horizontal in the image, it can be considered as the grounding line of the target, which can be used to approximately describe the contact relationship between the target and the ground. Although the camera optical axis is not completely perpendicular to the ground, this approximation is acceptable as long as the depression angle is not large. This processing method is common in actual traffic monitoring and target detection applications, which helps to simplify the processing process and improve detection efficiency. Therefore, the vertical direction of the AB segment (i.e., the compensation direction) can be used for positioning compensation, which conforms to the scene logic.
[0124] Afterwards, according to the above compensation direction and compensation distance, the positioning optimization update is performed from the midpoint P of the lower edge of the detection frame, and the coordinates are updated as the approximate position of the center point of the target chassis, that is, Figure 2 Through a series of calculations in the above steps, the positioning point of the target is shifted from point P to point O, which significantly improves the positioning accuracy.
[0125] Combine the following Figure 4 , specifically describe the specific process of the target positioning method provided by the embodiment of the present invention:
[0126] Utilize 2D visual detection technology to obtain a boundary detection frame of a first target and a target type of the first target in an image captured by a roadside camera; utilize a pre-calibrated camera calibration matrix to process the pixel coordinates of the boundary detection frame to obtain a projection width of the boundary detection frame projected onto the lower edge horizontal line, and, based on the target type, estimate the length and width of the first target; calculate the posture angle of the first target based on the projection width and the length and width of the first target; determine the compensation direction based on the direction in which the first target is projected onto the lower edge horizontal line; calculate the compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target based on the posture angle, the projection width and the size of the first target; utilize the compensation distance to compensate and update the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection frame to obtain the updated positioning coordinates of the first target.
[0127] The present invention optimizes the positioning information of 2D detection, and logically and accurately shifts the longitude and latitude positions corresponding to the center pixel point of the lower edge in traditional detection to the center point of the vehicle chassis, thereby improving the positioning accuracy of visual detection targets and bringing significant gains to multi-sensor fusion. The detection coordinates of multiple sensors for the same target from different directions have become more aggregated from being relatively discrete before, thereby improving the reliability and accuracy of target fusion.
[0128] The target positioning method provided by the embodiment of the present invention is based on the pixel coordinate information of the lower edge of the image detection frame obtained by the 2D image detection algorithm, and uses the pre-calibrated camera external parameter matrix to convert the pixel coordinates into longitude and latitude coordinates, solves the real projection length of the lower edge of the vehicle pixel frame, and combines the target length and width size information obtained by the detection algorithm to model the position of the target relative to the camera field of view, and finally estimates the longitude and latitude coordinates of the center point of the vehicle chassis to replace the longitude and latitude coordinates corresponding to the center point of the lower edge of the pixel frame, thereby realizing the optimization of the positioning accuracy of 2D visual target detection and the unification of positioning reference points. It is intended to compensate and correct the positioning coordinates perceived by the road test perception device, so that the positioning coordinate reference points of multiple cameras for the same traffic participant from different angles are unified, and provide positioning accuracy guarantee for subsequent algorithm processes such as target fusion.
[0129] like Figure 5 As shown, an embodiment of the present invention further provides a target positioning device, comprising:
[0130] A first acquisition module 501 is used to acquire the longitude and latitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and the target size information of the first target;
[0131] A first processing module 502 is used to obtain a first distance according to the latitude and longitude coordinates of the key point on the lower edge horizontal line of the boundary detection frame and the target size information, where the first distance is a compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target;
[0132] The second processing module 503 is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box by using the first distance to obtain the positioning coordinates of the first target.
[0133] Optionally, the key points on the lower edge horizontal line of the boundary detection box include:
[0134] A mapping center point of the first target on the lower edge horizontal line of the boundary detection box;
[0135] a first point on the horizontal line of the lower edge and a second point on the horizontal line of the lower edge;
[0136] The mapping center point of the first target on the lower edge horizontal line of the boundary detection frame is the midpoint between the first point on the lower edge horizontal line of the boundary detection frame and the second point on the lower edge horizontal line of the boundary detection frame;
[0137] The first point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the first corner point of the boundary detection box, and the second point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the second corner point of the boundary detection box;
[0138] The first corner point of the boundary detection box and the second corner point of the boundary detection box are corner points on both sides of the lowermost corner point of the boundary detection box;
[0139] The lower edge horizontal line is a horizontal line passing through the lowermost corner point of the boundary detection frame.
[0140] Optionally, the first acquisition module 501 includes:
[0141] A first acquisition unit is used to acquire the pixel coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and the target type of the first target by using visual detection technology;
[0142] A first processing unit is used to transform the pixel coordinates of the key points by using a camera calibration matrix to obtain the longitude and latitude coordinates of the key points on the lower edge horizontal line of the boundary detection box of the first target;
[0143] The second processing unit is configured to obtain target size information of the first target according to the target type.
[0144] Optionally, the first processing module 502 includes:
[0145] A third processing unit is used to obtain a projection width of the boundary detection frame projected onto the lower edge horizontal line according to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame;
[0146] The fourth processing unit is used to obtain the first distance according to the projection width and the target size information.
[0147] Optionally, the fourth processing unit is specifically configured to:
[0148] Obtaining a posture angle of the first target according to the projection width and the target size information;
[0149] The first distance is obtained according to the posture angle, the projection width and the target size information.
[0150] Optionally, the target size information includes a first size of the first target, where the first size is a size of the first target in a direction perpendicular to the posture angle;
[0151] The fourth processing unit is specifically configured to:
[0152] The first distance is obtained according to the posture angle, the projection width and the first size.
[0153] Optionally, the device further comprises:
[0154] A first determination module, configured to determine a compensation direction according to a direction in which the first target is projected onto the lower edge horizontal line;
[0155] Wherein, the second processing module 503 includes:
[0156] The fifth processing unit is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box in the compensation direction using the first distance to obtain the positioning coordinates of the first target.
[0157] It should be noted that the target positioning device provided in the embodiment of the present invention is a device capable of executing the above-mentioned target positioning method, and all embodiments of the above-mentioned target positioning method are applicable to the device and can achieve the same or similar technical effects.
[0158] like Figure 6 As shown, an embodiment of the present invention also provides a target positioning device, including: a processor 601; and a memory 603 connected to the processor 601 through a bus interface 602, wherein the memory 603 is used to store programs and data used by the processor 601 when performing operations, and the processor 601 calls and executes the programs and data stored in the memory 603.
[0159] The transceiver 604 is connected to the bus interface 602 and is used to receive and send data under the control of the processor 601. Specifically, the processor 601 is used to read the program in the memory 603, and the processor 601 is used to perform the following process:
[0160] Obtaining the latitude and longitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and target size information of the first target;
[0161] According to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame and the target size information, a first distance is obtained, where the first distance is a compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target;
[0162] The first distance is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
[0163] Optionally, the key points on the lower edge horizontal line of the boundary detection box include:
[0164] A mapping center point of the first target on the lower edge horizontal line of the boundary detection box;
[0165] a first point on the horizontal line of the lower edge and a second point on the horizontal line of the lower edge;
[0166] The mapping center point of the first target on the lower edge horizontal line of the boundary detection frame is the midpoint between the first point on the lower edge horizontal line of the boundary detection frame and the second point on the lower edge horizontal line of the boundary detection frame;
[0167] The first point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the first corner point of the boundary detection box, and the second point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the second corner point of the boundary detection box;
[0168] The first corner point of the boundary detection box and the second corner point of the boundary detection box are corner points on both sides of the lowermost corner point of the boundary detection box;
[0169] The lower edge horizontal line is a horizontal line passing through the lowermost corner point of the boundary detection frame.
[0170] Optionally, the processor 601 is configured to:
[0171] Using visual detection technology, obtaining pixel coordinates of key points on a lower edge horizontal line of a boundary detection box of the first target and a target type of the first target;
[0172] Using a camera calibration matrix, transforming the pixel coordinates of the key points to obtain the longitude and latitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame of the first target;
[0173] According to the target type, target size information of the first target is obtained.
[0174] Optionally, the processor 601 is configured to:
[0175] Obtaining a projection width of the boundary detection frame projected onto the lower edge horizontal line according to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame;
[0176] The first distance is obtained according to the projection width and the target size information.
[0177] Optionally, the processor 601 is configured to:
[0178] Obtaining a posture angle of the first target according to the projection width and the target size information;
[0179] The first distance is obtained according to the posture angle, the projection width and the target size information.
[0180] Optionally, the target size information includes a first size of the first target, where the first size is a size of the first target in a direction perpendicular to the posture angle;
[0181] The processor 601 is specifically configured to:
[0182] The first distance is obtained according to the posture angle, the projection width and the first size.
[0183] Optionally, the processor 601 is further configured to:
[0184] Determining a compensation direction according to the direction in which the first target is projected onto the lower edge horizontal line;
[0185] The processor 601 is specifically configured to:
[0186] In the compensation direction, the first distance is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
[0187] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 601 and memory represented by memory 603. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides a user interface 605. The transceiver 604 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 601 is responsible for managing the bus architecture and general processing, and the memory 603 may store data used by the processor 601 when performing operations.
[0188] In addition, a specific embodiment of the present invention further provides a readable storage medium on which a computer program is stored, wherein when the program is executed by a processor, the steps in the target positioning method as described in any one of the above are implemented.
[0189] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0190] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0191] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the resource selection method described in each embodiment of the present invention, or to perform some steps of the information sending method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0192] A specific embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0193] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary personnel in this technical field, several improvements and modifications can be made without departing from the principles described in the present invention. These improvements and modifications are also within the scope of protection of the present invention.
Claims
1. A target positioning method, characterized in that: include: Obtaining the latitude and longitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and target size information of the first target; According to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame and the target size information, a first distance is obtained, where the first distance is a compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target; The first distance is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
2. The method according to claim 1, characterized in that The key points on the lower edge horizontal line of the boundary detection box include: A mapping center point of the first target on the lower edge horizontal line of the boundary detection box; a first point on the horizontal line of the lower edge and a second point on the horizontal line of the lower edge; The mapping center point of the first target on the lower edge horizontal line of the boundary detection frame is the midpoint between the first point on the lower edge horizontal line of the boundary detection frame and the second point on the lower edge horizontal line of the boundary detection frame; The first point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the first corner point of the boundary detection box, and the second point on the lower edge horizontal line is a point on the lower edge horizontal line that is vertically mapped to the second corner point of the boundary detection box; The first corner point of the boundary detection box and the second corner point of the boundary detection box are corner points on both sides of the lowermost corner point of the boundary detection box; The lower edge horizontal line is a horizontal line passing through the lowermost corner point of the boundary detection frame.
3. The method according to claim 1, characterized in that: Acquiring the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection box of the first target and the target size information of the first target, including: Using visual detection technology, obtaining pixel coordinates of key points on a lower edge horizontal line of a boundary detection box of the first target and a target type of the first target; Using a camera calibration matrix, transforming the pixel coordinates of the key points to obtain the longitude and latitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame of the first target; According to the target type, target size information of the first target is obtained.
4. The method according to claim 1, characterized in that Obtaining a first distance according to the latitude and longitude coordinates of a key point on the lower edge horizontal line of the boundary detection box and the target size information includes: Obtaining a projection width of the boundary detection frame projected onto the lower edge horizontal line according to the latitude and longitude coordinates of the key points on the lower edge horizontal line of the boundary detection frame; The first distance is obtained according to the projection width and the target size information.
5. The method according to claim 4, characterized in that Obtaining the first distance according to the projection width and the target size information includes: Obtaining a posture angle of the first target according to the projection width and the target size information; The first distance is obtained according to the posture angle, the projection width and the target size information.
6. The method according to claim 5, characterized in that The target size information includes a first size of the first target, where the first size is a size of the first target in a direction perpendicular to the posture angle; Obtaining the first distance according to the posture angle, the projection width and the target size information includes: The first distance is obtained according to the posture angle, the projection width and the first size.
7. The method according to claim 1, characterized in that The method further comprises: Determining a compensation direction according to the direction in which the first target is projected onto the lower edge horizontal line; Wherein, using the first distance, compensating the latitude and longitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target includes: In the compensation direction, the first distance is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box to obtain the positioning coordinates of the first target.
8. A target positioning device, characterized in that: include: A first acquisition module, used to acquire the longitude and latitude coordinates of key points on the lower edge horizontal line of the boundary detection box of the first target and the target size information of the first target; A first processing module, configured to obtain a first distance according to the latitude and longitude coordinates of a key point on the lower edge horizontal line of the boundary detection frame and the target size information, wherein the first distance is a compensation distance between the lower edge horizontal line of the boundary detection frame and the center point of the chassis of the first target; The second processing module is used to compensate the longitude and latitude coordinates of the mapping center point of the first target on the lower edge horizontal line of the boundary detection box by using the first distance to obtain the positioning coordinates of the first target.
9. A target positioning device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps in the target positioning method according to any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is executed by a processor, the steps in the target positioning method according to any one of claims 1 to 7 are implemented.
11. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps in the target positioning method according to any one of claims 1 to 7.