Image-based vehicle positioning method and device, storage medium, and electronic device
Through the image-based vehicle positioning method, multi-frame images and predetermined strategies are used to determine the driving direction and position of the vehicle, which solves the problem of high vehicle positioning costs in vehicle-road collaboration and achieves precise positioning and cost reduction.
Patent Information
- Application Number
- CN202110300526.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-19
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-03-19
AI Technical Summary
In the existing technology, vehicle positioning in the field of vehicle-road collaboration is costly and computationally intensive, making it difficult to achieve low-cost accurate positioning.
Through the image-based vehicle positioning method, multiple frames of images taken by road monitoring equipment are used to determine the current driving direction of the vehicle, and a reference point is selected according to a predetermined strategy to approximate points on the vehicle, that is, the positioning reference point, which combines the current driving direction and the vehicle The size parameter determines the current position of the vehicle in the target coordinate system.
It achieves precise positioning of vehicles, reduces costs, does not require the use of sensors such as radar, and improves positioning accuracy.
Smart Images

Figure CN113075716B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent driving technology, and in particular to an image-based vehicle positioning method and device, a storage medium, and an electronic device. Background Art
[0002] With the innovation of science and technology, smart transportation has become an inevitable trend of future development. As one of the core technologies of smart transportation, vehicle-road collaboration has attracted much attention. In vehicle-road collaboration, accurate positioning of the vehicle's position information in the map can eliminate blind spots in the vehicle's driving field of vision, realize real-time dynamic information interaction between vehicles and roads, vehicles and vehicles, and vehicles and people, and effectively avoid traffic accidents such as vehicle collisions at crowded intersections. Existing technologies use sensors such as radar to obtain the depth information of the vehicle, and then perform three-dimensional modeling of the vehicle based on the depth information to achieve vehicle positioning, which is costly. How to achieve accurate positioning of vehicles in the map at a low cost has become a difficult problem that needs to be solved in vehicle-road collaboration technology. Summary of the invention
[0003] In order to solve the above technical problems, the present application is proposed. The embodiments of the present application provide a device, a storage medium, and an electronic device.
[0004] According to the first aspect of the present application, an image-based vehicle positioning method is provided, comprising: determining at least one historical detection frame about a vehicle in at least one historical frame image taken by a road monitoring device; determining a current detection frame of the vehicle in a current frame image; determining a current driving direction of the vehicle based on at least one historical detection frame and a current detection frame; determining a first reference point on the current detection frame based on the current driving direction and a relative position relationship between the vehicle and the road monitoring device; determining a positioning reference point in a target coordinate system based on the first reference point; and determining the current position of the vehicle in the target coordinate system based on the positioning reference point, the current driving direction, and size parameters of the vehicle.
[0005] According to a second aspect of the present application, a vehicle positioning device is provided, comprising: a first determination module, used to determine at least one historical detection frame about a vehicle in at least one historical frame image taken by a road monitoring device; a second determination module, used to determine a current detection frame of the vehicle in a current frame image; a direction determination module, used to determine a current driving direction of the vehicle based on the at least one historical detection frame and the current detection frame; a reference point determination module, used to determine a first reference point on the current detection frame based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device; a reference point determination module, used to determine a positioning reference point in a target coordinate system based on the first reference point; and a positioning module, used to determine the current position of the vehicle in the target coordinate system based on the positioning reference point, the current driving direction, and the size parameters of the target vehicle.
[0006] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a computer program for executing the image-based vehicle positioning method provided by the present application.
[0007] According to a fourth aspect of the present application, an electronic device is provided, comprising: a processor and a memory for storing instructions executable by the processor, wherein the processor is used to execute the image-based vehicle positioning method provided in the present application.
[0008] According to the image-based vehicle positioning method and device, storage medium, and electronic device provided by the present application, the current driving direction of the vehicle is determined based on multiple frames of images taken by a road monitoring device; then, according to a predetermined strategy, a first reference point is selected from the current detection frame in the current frame image to approximate a point on the vehicle, namely, a positioning reference point; then, the current position of the vehicle is determined based on the current driving direction, the positioning reference point, and the size parameters of the vehicle itself. Since the first reference point can be selected based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device, and mapped to the target coordinate system to obtain the positioning reference point, and the size of the vehicle can be determined based on the vehicle's own parameters, the positioning accuracy of the vehicle in the target coordinate system can be ensured. In addition, since the vehicle is positioned by means of images, the vehicle can be positioned without the use of sensors such as radar, thereby reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0010] Figure 1 It is a scene graph applicable to the image-based vehicle positioning method provided in this application.
[0011] Figure 2 It is a flowchart of an image-based vehicle positioning method provided by an exemplary embodiment of the present application.
[0012] Figure 3 Shown is a schematic diagram of multiple frame images superimposed according to an exemplary embodiment of the present application.
[0013] Figure 4 A schematic flow chart of an image-based vehicle positioning method provided for another exemplary embodiment of the present application.
[0014] Figure 5aA schematic diagram of a current frame image provided by an exemplary embodiment of the present application.
[0015] Figure 5b A schematic diagram of a current frame image provided by another exemplary embodiment of the present application.
[0016] Figure 5c A schematic diagram of a current frame image provided for yet another exemplary embodiment of the present application.
[0017] Figure 6 for Figure 3 Schematic diagram of the positional relationship between multiple second reference points of multiple frame images in the target coordinate system.
[0018] Figure 7 A schematic flow chart of an image-based vehicle positioning method provided for yet another exemplary embodiment of the present application.
[0019] Figure 8 An exemplary embodiment of the present application provides Figure 3 The relative position relationship between the vehicle and the road monitoring device corresponding to the current frame image in the target coordinate system.
[0020] Fig. 9 A schematic flow chart of an image-based vehicle positioning method provided for yet another exemplary embodiment of the present application.
[0021] Fig.10 A schematic diagram of the position of a vehicle in a target coordinate system provided for an exemplary embodiment of the present application.
[0022] Fig.11 A structural block diagram of a vehicle positioning device provided by an exemplary embodiment of the present application.
[0023] Fig.12 A structural block diagram of a vehicle positioning device provided for another exemplary embodiment of the present application.
[0024] Fig.13 A block diagram of an electronic device according to an embodiment of the present application is illustrated. DETAILED DESCRIPTION
[0025] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.
[0026] Application Overview
[0027] At present, in the field of vehicle-road collaboration, in order to achieve vehicle positioning, a vehicle positioning technology based on three-dimensional bounding box (3Dbouding Box, referred to as 3D Box) detection is usually used. However, the vehicle positioning technology based on 3D Box detection needs to use laser radar to obtain the depth information of the vehicle, and then three-dimensionally model the vehicle based on the depth information, which has the problems of high cost and large amount of calculation. Based on this situation, the present application provides an image-based vehicle positioning method, which analyzes and processes the images taken by the road monitoring equipment, and uses the displacement of the detection box surrounding the same vehicle in the current frame image and at least one historical frame image to infer the current driving direction of the vehicle; then, according to a predetermined strategy, a point on the current detection box is selected to approximate a point on the vehicle, that is, the positioning reference point; finally, the current driving direction, the positioning reference point, and the size parameters of the vehicle itself are combined to determine the current position of the vehicle. It can be seen that according to the image-based vehicle positioning method provided in the embodiment of the present application, since the first reference point can be selected based on the current driving direction and the relative position relationship between the vehicle and the road monitoring equipment, and mapped to the target coordinate system to obtain a positioning reference point, and the size of the vehicle can be determined based on the vehicle's own parameters, the positioning accuracy of the vehicle in the target coordinate system can be ensured. In addition, since the vehicle is positioned by means of images, the vehicle can be accurately positioned without the use of sensors such as radar, thereby reducing costs.
[0028] Exemplary Systems
[0029] Figure 1 is a scene graph applicable to the image-based vehicle positioning method provided in this application. The image-based vehicle positioning method is applicable to the field of autonomous driving, such as Figure 1 As shown, the unmanned vehicle 1 is traveling on a predetermined road 2, and a road monitoring device 3 is arranged around the road 2. The road monitoring device 3 can take photos or record videos of objects passing through its field of view. The image-based vehicle positioning method provided in the present application can be executed by a positioning device, which can be integrated in the road monitoring device 3, or integrated in a server (not shown in the figure) that is in communication with the road monitoring device 3, or can be placed in the vehicle 1 as a vehicle-mounted device.
[0030] When the road monitoring device 3 captures the image of the vehicle 2, the specific execution process of the image-based vehicle positioning method includes: firstly analyzing and processing the image captured by the road monitoring device 3, and calculating the current driving direction of the vehicle based on the displacement of the detection frame surrounding the same vehicle in the current frame image and at least one historical frame image; then selecting a reference point on the current detection frame according to a predetermined strategy to approximate a point on the vehicle, namely, the positioning reference point; finally, combining the current driving direction, the positioning reference point and the size parameters of the vehicle itself, the current position of the vehicle is determined, thereby realizing the positioning of the vehicle. Subsequently, the obtained vehicle position information can be used to control the autonomous driving of the vehicle, and can also be used for road management, such as vehicle diversion control, so as to realize vehicle-road collaboration.
[0031] Exemplary Methods
[0032] Figure 2 FIG. 1 is a flow chart of an image-based vehicle positioning method provided by an exemplary embodiment of the present application. Figure 1 For example, Figure 2 As shown, the image-based vehicle positioning method 100 includes the following steps:
[0033] Step S110, determining at least one historical detection frame about a vehicle in at least one historical frame image captured by a road monitoring device.
[0034] Specifically, road monitoring equipment such as Figure 1 The road monitoring device 3 shown in the figure can be a camera. The road monitoring device can take pictures or record videos of objects passing through its field of view to obtain at least one historical frame image and the current frame image mentioned later.
[0035] The at least one historical detection frame is obtained and stored in the storage medium using target detection and target tracking technology when the at least one historical frame image is used as the current frame image, and the at least one historical detection frame surrounds the same vehicle in the at least one historical frame image. In this embodiment, the at least one historical detection frame can be directly retrieved from the storage medium to be used for vehicle positioning in the current frame image.
[0036] Step S120, determining a current detection frame of the vehicle in the current frame image captured by the road monitoring device.
[0037] Specifically, after the road monitoring device captures the current frame image, first, the target detection algorithm is used to detect the object of interest in the current frame image to obtain the corresponding position coordinates, classification, and credibility, etc.; then, the detected object of interest is feature matched with the object of interest in at least one stored historical frame image, and the similarity is calculated to determine the vehicle from the objects of interest in the current frame image, and then obtain the current detection frame surrounding the vehicle.
[0038] Step S130, determining the current driving direction of the vehicle based on at least one historical detection frame and the current detection frame.
[0039] At least one historical detection frame and a current detection frame respectively surround the same vehicle, and the arrangement order of the multiple detection frames in the image coordinate system records the driving trajectory of the vehicle, so that the driving direction of the vehicle can be determined based on the multiple detection frames.
[0040] In one embodiment, the moving trajectory of the same predetermined point on the current detection frame and at least one historical detection frame is used to be equivalent to the moving trajectory of the vehicle 1 , and accordingly, the direction of the predetermined point on the current detection frame is the current driving direction of the vehicle 1 .
[0041] Specifically, Figure 3 Shown is a schematic diagram of multiple frame images superimposed according to an exemplary embodiment of the present application. Figure 3 The superimposed image shown includes a current frame image and at least one historical frame image before the current frame image, which are superimposed in sequence. The superimposed image clearly illustrates the current detection frame S 5 And four historical detection boxes S 4 -S 1 , the arrangement order of the five detection frames in the superimposed image illustrates the driving trajectory L formed by the vehicle between the five frames of images, as shown in Figure 3 As shown by the arrow line in the figure, the direction of the arrow indicates the driving direction of the vehicle 1 on the image plane. Figure 3 , when the current detection box S is determined 5 And four historical detection boxes S 4 -S 1 After that, first, select the current detection box S 5 The center point P 0 , that is, the current detection box S 5 The intersection of the two sets of relative corner points connecting the lines m, and then retrieve four historical detection boxes S from the storage medium 4 -S 1 Then, the current driving direction of the vehicle 1 is calculated based on the moving trajectories of the five center points. Alternatively, the current detection frame S can be selected. 5 The lower left corner point P 1 , and then retrieve four historical detection boxes S from the storage medium4 -S 1 The lower left corner point of the vehicle 1 is obtained by calculating the moving trajectories of the five lower left corner points. Similarly, the lower right corner point P 2 Or click P in the upper left corner 3 Or click P in the upper right corner 4 The current driving direction of vehicle 1 is calculated based on the moving trajectory, which will not be described in detail here.
[0042] Step S140, based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device, determine the first reference point on the current detection frame.
[0043] Since the detection frame tightly wraps the vehicle, a point can be selected from the detection frame to approximate a point on the vehicle for vehicle positioning. In theory, the closer the first reference point on the selected detection frame is to the vehicle itself, the higher the positioning accuracy. The inventors have found that different positions of the vehicle relative to the road monitoring device will result in different imaging angles, and accordingly, the point on the detection frame closest to the vehicle itself will change. Therefore, in this embodiment, the first reference point is determined based on the current driving direction of the vehicle 1 and the relative position relationship between the vehicle 1 and the road monitoring device 3, that is, as the current driving direction of the vehicle 1 and the relative position relationship between the vehicle 1 and the road monitoring device 3 are different, the selection strategy of the first reference point is changed to ensure that the first reference point selected for each current detection frame is as close to the vehicle itself as possible, thereby improving the positioning accuracy.
[0044] Step S150: determining a positioning reference point in a target coordinate system based on the first reference point.
[0045] The first reference point is a point on the current detection frame, that is, a point in the image coordinate system. In order to realize the positioning of the vehicle 1, the first reference point needs to be mapped to the target coordinate system as a positioning reference point of the vehicle 1. The target coordinate system can be, for example, a map coordinate system or a GPS coordinate system.
[0046] Step S160, determining the current position of the vehicle in the target coordinate system according to the positioning reference point, the current driving direction, and the size parameters of the vehicle.
[0047] The size parameters of the vehicle 1 include the length and width of the vehicle. In one embodiment, the length and width of the vehicle 1 are respectively represented by the length and width of the vehicle chassis. By converting the size parameters of the vehicle 1 into the target coordinate system through proportional transformation, a rectangular frame obtained by mapping the vehicle 1 to the target coordinate system is obtained, and then the current position of the vehicle 1 can be determined by combining the current driving direction of the vehicle 1 and a point on the vehicle, i.e., the positioning reference point. In one embodiment, the coordinates of the center point of the vehicle 1 are selected as the current position information of the vehicle.
[0048] According to the image-based vehicle positioning method provided in this embodiment, the current driving direction of the vehicle is determined based on multiple frames of images taken by a road monitoring device; then, according to a predetermined strategy, a first reference point is selected from the current detection frame in the current frame image to approximate a point on the vehicle, namely, a positioning reference point; then, the current position of the vehicle is determined based on the current driving direction, the positioning reference point, and the size parameters of the vehicle itself. Since the first reference point can be selected based on the above-mentioned current driving direction and the relative position relationship between the vehicle and the road monitoring device, and mapped to the target coordinate system to obtain the positioning reference point, and the size of the vehicle can be determined based on the vehicle's own parameters, the positioning accuracy of the vehicle in the target coordinate system can be ensured. In addition, since the vehicle is positioned by means of images, the vehicle can be accurately positioned without the use of sensors such as radar, thereby reducing costs.
[0049] Figure 4 A flow chart of an image-based vehicle positioning method provided by another exemplary embodiment of the present application. The image-based vehicle positioning method 200 and Figure 2 The difference of the image-based vehicle positioning method 100 shown is that, in the process of determining the current driving direction of the vehicle according to step S130, the current second reference point is first determined according to the position of the current detection frame in the current frame image, and then combined with at least one historical second reference point of at least one historical detection frame to determine the current driving direction of the vehicle. Figure 1 For example, Figure 4 As shown, in the image-based vehicle positioning method 200, step S130 specifically includes:
[0050] Step S131, determining a current second reference point on the current detection frame according to the position of the current detection frame in the current frame image.
[0051] In this embodiment, a predetermined point on the current detection box is selected as the current second reference point according to the position of the current detection box in the current frame image. That is, the selection strategy of the current second reference point adaptively changes according to the position of the current detection box in the current frame image.
[0052] In one embodiment, step S131 includes: determining the number of pixels surrounded by the current detection frame. When the number of pixels surrounded by the current detection frame is less than the first number threshold, the current detection frame is filtered out. When the number of pixels surrounded by the current detection frame is greater than or equal to the first number threshold and less than the second number threshold, the current second reference point is determined based on two adjacent pixels whose horizontal and vertical coordinates are changed for determining the current detection frame. When the number of pixels surrounded by the current detection frame is greater than or equal to the second number threshold, the current second reference point is determined based on the center point of the current detection frame. The first number threshold is less than the second number threshold, and the first number threshold and the second number threshold are reasonably set according to actual conditions.
[0053] Since the road supervision department and other departments have certain requirements on the installation location of the monitoring equipment, when the relevant requirements are met, a normally traveling vehicle usually enters the image from the four edges of the image. In this case, step S131 can be specifically performed as follows:
[0054] First, determine the number of pixels surrounded by the current detection frame. The detection frame is determined by four pixels. Once the detection frame is determined, the number of pixels surrounded by the detection frame can be determined based on two relative corner points of the four pixels and the image resolution.
[0055] Secondly, the current second reference point is selected according to different situations according to the number of pixels surrounded by the current detection frame.
[0056] For example, Figure 5a FIG. 1 is a schematic diagram of a current frame image provided by an exemplary embodiment of the present application. Figure 5a As shown, less than one third of the vehicle 1 enters the image, and at this time, the number of pixels surrounded by the current detection frame is less than the first number threshold. In this case, the current frame image is not sufficient to reflect the driving direction of the vehicle 1, so the current detection frame in the current frame image is filtered out.
[0057] Next, Figure 5b FIG. 1 is a schematic diagram of a current frame image provided by another exemplary embodiment of the present application. Figure 5b As shown, an area greater than or equal to one third and less than the entire vehicle body of the vehicle 1 enters the image, and at this time, the number of pixels surrounded by the current detection frame is greater than or equal to the first number threshold and less than the second number threshold. In this case, the midpoint of the line connecting two adjacent pixels whose horizontal and vertical coordinates of the current detection frame have changed is selected as the current second reference point.
[0058] like Figure 5bAs shown, when an area greater than or equal to one third and less than the entire vehicle body enters the image, one of the horizontal coordinates and vertical coordinates of two of the four pixel points forming the detection frame remains unchanged, that is, it is always at the edge of the image, for example, the upper right corner point p 4 and the lower right corner point p 2 ; The horizontal and vertical coordinates of the other two adjacent pixels will gradually change. For example, the upper left corner point p 3 and the lower left corner point p 1 In this case, select the upper left corner point p 3 and the lower left corner point p 1 The midpoint Q of the connecting line is used as the current second reference point.
[0059] For example, Figure 5c FIG. 1 is a schematic diagram of a current frame image provided by another exemplary embodiment of the present application. Figure 5c As shown, vehicle 1 completely enters the image. At this time, the number of pixels surrounded by the current detection frame is greater than or equal to the second number threshold. In this case, the center point p of the current detection frame is selected. 0 As the current second reference point.
[0060] It can be seen that, depending on the position of the current detection frame in the image, the current second reference point can be the center point p of the current detection frame. 0 , or the midpoint Q of two adjacent corner points of the current detection box.
[0061] Step S132, determining the current driving direction of the vehicle according to the current second reference point in combination with at least one historical second reference point on at least one historical detection frame.
[0062] Specifically, Figure 3 Take the five frames shown in the figure as an example. Figure 3 The five detection frames in the five frames shown are all completely within the image, and the second reference points of the five detection frames are all the center points of the detection frames. Figure 3 After the second reference points of the five detection frames shown are mapped to the target coordinate system, we get Figure 6 The schematic diagram of the positional relationship of the five second reference points in the target coordinate system is shown in FIG. i (x i ,y i ), i is the number of frames of the image, i = 1, 2, 3, 4, 5. Among them, a 5 (x 5 ,y 5 ) is the current second reference point. Then the process of calculating the current driving direction of the vehicle in the current frame image according to step S112 includes:
[0063] Firstly, based on the current second reference point and a predetermined historical second reference point among at least one historical second reference point, a rough driving direction of the vehicle in the current frame image is determined.
[0064] Taking the predetermined historical second reference point as the historical second reference point a 1 (x 1 ,y 1 ) as an example, the direction vector b of the rough driving direction of the vehicle in the current frame image is 5 is(y 5 -y 1 , x 5 -x 1 ).
[0065] Secondly, a weighted average of a direction vector of the rough driving direction and a direction vector of at least one historical driving direction of the vehicle in at least one historical frame image is determined to obtain a direction vector of the current driving direction.
[0066] Continue reading Figure 3 and Figure 6 , assuming that the direction vectors of the four historical frames before the current frame are B 4 , B 3 , B 2 and B 1 , the direction vector of the vehicle's current driving direction is:
[0067] B 5 =p 1 b 5 +p 2 B 4 =p 1 b 5 +p 2 (p 1 b 4 +p 2 B 3 )=p 1 b 5 +p 2 (p 1 b 4 +p 2 (p 1 b 3 +p 2 B 2 ))=......=(Y 1 , X 1 );p 1 =1-p 2 .
[0068] Among them, p 1 and p 2 The preset weights.
[0069] Subsequently, steps S120, S130 and S140 are continued to be executed to realize the positioning of the vehicle.
[0070] According to the image-based vehicle positioning method provided in this embodiment, the second reference point is determined according to the position of the detection frame in the image. Compared with selecting the same point as the second reference point for the detection frames on multiple frames of images, it can ensure that the second reference point selected for each current detection frame can reflect the vehicle's direction information as well as possible, thereby ensuring that the current driving direction is more accurate, thereby improving positioning accuracy.
[0071] In one embodiment, Figure 4 As shown, step S130 also includes step S130 executed before step S131: according to the center point of the current detection frame, combined with the center point of at least one historical detection frame, determine the running trajectory of the center point. Smooth the running trajectory of the center point. Update the current detection frame based on the running trajectory of the center point after smoothing. Specifically, after the current detection frame is determined by target detection and target tracking technology, first, the center point of the current detection frame is calculated. Secondly, the center point of at least one historical detection frame is retrieved, and combined with the center point of the current detection frame, the running trajectory of the multiple center points is calculated using a fitting algorithm. Then, the running trajectory of the center point is smoothed using a trajectory smoothing algorithm. In one embodiment, the running trajectory of the center point is smoothed using a "five-point first-order" trajectory smoothing algorithm. Finally, the center point of the current detection frame is updated according to the running trajectory after smoothing, and then the corner point coordinates of the current detection frame are re-determined according to the new center point of the current detection frame, thereby obtaining a new current detection frame.
[0072] According to the image-based vehicle positioning method provided in this embodiment, by preprocessing the current detection frame, position jitter can be reduced or even eliminated, thereby reducing the error caused by estimating the current driving direction of the vehicle based on the current detection frame and at least one historical detection frame, and further improving the positioning accuracy.
[0073] Figure 7 A flowchart of an image-based vehicle positioning method provided by another exemplary embodiment of the present application is shown in FIG. Figure 1 The difference between the image-based vehicle positioning method 100 shown is that when determining the first reference point according to step S140, the periphery of the vehicle is divided into multiple intervals with the vehicle as the center, and the corresponding corner point of the current detection frame is selected as the first reference point according to the interval where the monitoring device is located. Figure 1 For example, Figure 7 As shown, step S140 includes:
[0074] Step S141, in the target coordinate system, calculate the angle between the normal of the line connecting the third reference point on the current detection frame and the road monitoring device and the current driving direction.
[0075] The third reference point is a point selected from the current detection frame according to a predetermined strategy. In one embodiment, the third reference point is the same as the second reference point in the image-based vehicle positioning method 200. For example, according to step S131, Figure 3 The current detection box S shown 5 The second reference point is the center point P 0 , then the current detection box S 5 The third reference point is also the center point P 0 Accordingly, the selection strategy of the third reference point is the same as the selection strategy of the second reference point. For details, refer to step S131 in the image-based vehicle positioning method 200, which will not be described in detail here.
[0076] Figure 8 An exemplary embodiment of the present application provides Figure 3 The relative position relationship between the vehicle and the road monitoring device corresponding to the current frame image in the target coordinate system. Figure 8 As shown, Figure 3 The current detection box S shown 5 The third reference point, namely the center point P 0 , mapped to the target coordinate system, and point A is obtained. The position of the road monitoring device 3 in the target coordinate system is as follows: Figure 8 As shown in point B in the figure, the relative position relationship between the vehicle and the road monitoring device can be expressed as an angle θ, that is, the normal L of the line connecting point A and the road monitoring device B and the current driving direction B 5 The angle between.
[0077] Step S142, determining a first reference point according to the included angle combined with the correspondence between the preset angle interval and the corner point of the current detection frame, where the first reference point is the corner point of the current detection frame corresponding to the included angle.
[0078] Continue reading Figure 8 , the detection frames of vehicles with a driving direction difference of 180° have the same position in the target coordinate system, and the calculated angle θ is the same. Therefore, in order to reduce the amount of calculation, the 360° interval around the vehicle is constrained to the interval range of [-90°, 90°]. In this case, in one embodiment, the correspondence between the preset angle interval and the corner point of the current detection frame includes: when the angle θ is [-90°, -30°] or [0°, 30°], the lower right corner point of the corresponding current detection frame in the image coordinate system is used as the first reference point; when the angle θ is [-30°, 0°] or [30°, 90°], the lower left corner point of the corresponding current detection frame in the image coordinate system is used as the first reference point.
[0079] Then, steps S150 and S160 are performed to locate the vehicle.
[0080] According to the image-based vehicle positioning method provided in this embodiment, the angle θ between the normal of the line connecting the third reference point and the road monitoring device and the current driving direction is used to measure the relative position relationship between the road monitoring device and the vehicle, and the correspondence between the angle θ and the corner point of the current detection frame is preset to ensure that the selected first reference point is as close to the vehicle itself as possible, thereby further improving the positioning accuracy.
[0081] In one embodiment, method 300 further includes, after step S160, step S370, calculating the confidence of the current position of the vehicle based on the ratio of the difference between the included angle and the boundary angle of the preset angle interval to the angle interval when the difference between the included angle and the boundary angle of the preset angle interval is less than a preset threshold; and smoothing the current position of the vehicle based on the confidence.
[0082] For example, the current position of the vehicle is represented by the coordinates of the center point of the vehicle. When the angle θ is within 15° from the interval boundary (-30°, 0°, 30°), the confidence of the center point at this time is calculated.
[0083] confidence = (θ-interval boundary) / interval length
[0084] P center =P center1 *confidence+P center2 *(1-confidence)
[0085] Among them, P center represents the current position after smoothing, P center1 represents the current position before smoothing, P center2 Represents the position in the previous history frame after smoothing.
[0086] According to the image-based vehicle positioning method provided in this embodiment, the fluctuation of the vehicle motion trajectory is reduced by smoothing the vehicle position, thereby further improving the positioning accuracy.
[0087] Fig. 9 The following is a flow chart of a vehicle positioning method based on an image provided by another exemplary embodiment of the present application. Fig. 9 As shown, the image-based vehicle positioning method 400 and Figure 2 The difference of the image-based vehicle positioning method 100 is that, in this embodiment, the process of determining the position of the vehicle in the target coordinate system according to step S160 specifically includes:
[0088] Step S161, determining the corresponding rectangular frame in the target coordinate system where the vehicle is mapped based on the acquired length and width of the vehicle.
[0089] According to the ratio between the actual size of the vehicle and the size in the target coordinate system, the acquired length and width of the vehicle are proportionally transformed to obtain the mapping of the vehicle in the target coordinate system, which is represented by a rectangular frame.
[0090] Step S162, determining the position and posture of the rectangular frame in the target coordinate system according to the positioning reference point, the current driving direction, and the orientation of the road monitoring device relative to the road monitored by the road monitoring device. Determining the position and posture of the rectangular frame in the target coordinate system is to determine the coordinates of each vertex of the rectangular frame in the target coordinate system.
[0091] Depending on the different orientations of the road monitoring device relative to the road it monitors, the same corner point of the detection frame surrounding the vehicle in the image it captures will correspond to different corner points of the rectangular frame after being mapped to the target coordinate system. For example, for a road monitoring device located at the north intersection, the lower left corner point of the detection frame in the image it captures corresponds to the upper right corner point of the rectangular frame in the target coordinate system; while for a road monitoring device located at the south intersection, the lower right corner point of the detection frame in the image it captures corresponds to the lower right corner point of the rectangular frame in the target coordinate system. Therefore, it is necessary to determine the correspondence between the positioning reference point and the vertices of the rectangular frame based on the orientation of the road monitoring device relative to the road it monitors.
[0092] For example, Fig.10 The schematic diagram of the position of a vehicle in a target coordinate system provided by an exemplary embodiment of the present application. Fig.10 As shown, assuming that the current direction of the vehicle is B 1 (Y 1 , X 1 ), the first reference point selected is the lower right corner point P of the current detection box 2 In this case, taking the road monitoring equipment at the south intersection as an example, the first reference point is mapped to the lower right corner point q of the corresponding rectangular box in the target coordinate system. 1 Then, the other three corner points are obtained based on trigonometric functions and geometric operations. The specific calculation process is as follows:
[0093] q 2x =q 1x -lcosβ
[0094] q 2y =q 1y -lsinβ
[0095] q 3x =q 2x +wsinβ
[0096] q 3y=q 2y -w×cosβ
[0097] Where l and w are the length and width of the rectangular box respectively; β = tan -1 (Y 1 / X 1 ).
[0098] In this way, the position and posture of the rectangular box in the target coordinate system are determined.
[0099] Step S163, determine the center point q of the rectangular frame in the current position 0 as the current position of the vehicle in the target coordinate system.
[0100] Continue reading Figure 8 , when the rectangular box is in the current position, the coordinates of the center point of the rectangular box are: q 0x =(q 1x +q 3x ) / 2;q 0y =(q 1y +q 3y ) / 2.
[0101] According to the image-based vehicle positioning method provided in this embodiment, the position and posture of the rectangular box in the target coordinate system is determined according to the positioning reference point, the current driving direction, and the orientation of the road monitoring device relative to the road monitored by the road monitoring device. The algorithm is simple and easy to implement.
[0102] Exemplary Devices
[0103] The present application also provides a vehicle positioning device, which can be used to execute the image-based vehicle positioning method provided in any embodiment of the present application. Fig.11 This is a structural block diagram of a vehicle positioning device provided by an exemplary embodiment of the present application. Fig.11As shown, the vehicle positioning device 90 includes: a first determination module 91, a second determination module 92, a direction determination module 93, a reference point determination module 94, a benchmark point determination module 95 and a positioning module 96. Among them, the first determination module 91 is used to determine at least one historical detection frame about the vehicle in at least one historical frame image taken by the road monitoring device. The second determination module 92 is used to determine the current detection frame of the vehicle in the current frame image. The direction determination module 91 is used to determine the current driving direction of the vehicle based on the at least one historical detection frame and the current detection frame. The reference point determination module 92 is used to determine the first reference point on the current detection frame based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device. The benchmark point determination module 93 is used to determine the positioning benchmark point in the target coordinate system based on the first reference point. The positioning module 94 is used to determine the current position of the vehicle in the target coordinate system according to the positioning benchmark point, the current driving direction, and the size parameters of the target vehicle.
[0104] The execution process of the vehicle positioning device 90 includes: first, obtaining the current frame image according to the road monitoring device, using the target tracking technology to determine the current detection frame surrounding the vehicle in the current frame image, and determining the current driving direction of the vehicle according to the current detection frame combined with at least one stored historical detection frame. Then, according to the current driving direction and the relative position relationship between the vehicle and the road monitoring device, select the first reference point on the current detection frame to approximate the point on the vehicle, that is, the positioning reference point. Then, according to the positioning reference point, the current driving direction, and the size parameters of the vehicle, the current position of the vehicle in the target coordinate system can be determined, thereby realizing vehicle positioning.
[0105] Fig.12 This is a structural block diagram of a vehicle positioning device provided by another exemplary embodiment of the present application. Fig.12 As shown, in this embodiment, the direction determination module 93 in the vehicle positioning device 100 specifically includes: a third determination module 931 and a fourth determination module 932 .
[0106] Among them, the third determination module 931 is used to determine the current second reference point on the current detection frame according to the position of the current detection frame in the current frame image. Specifically, in one embodiment, the third determination module 931 is used to determine the number of pixels surrounded by the current detection frame; when the number is less than the first number threshold, the current detection frame is filtered out. When the number is greater than or equal to the first number threshold and less than the second number threshold, the current second reference point is determined based on two adjacent pixels whose horizontal and vertical coordinates are changed for determining the current detection frame. When the number is greater than or equal to the second number threshold, the current second reference point is determined based on the center point of the current detection frame.
[0107] The fourth determination module 932 is used to determine the current driving direction of the vehicle based on the current second reference point and at least one historical second reference point on the at least one historical detection frame. Specifically, in one embodiment, the rough driving direction of the vehicle is determined based on the current second reference point and a predetermined historical second reference point among the at least one historical second reference point; the weighted average of the direction vector of the rough driving direction and the direction vector of at least one historical driving direction of the vehicle in at least one historical frame image is determined to obtain the current driving direction.
[0108] In one embodiment, the direction determination module 93 also includes a trajectory smoothing module 933, which is used to determine the running trajectory of the center point based on the center point of the current detection frame in combination with the center point of at least one historical detection frame; smooth the running trajectory of the center point; and update the current detection frame based on the running trajectory of the center point after smoothing.
[0109] In one embodiment, Fig.12 As shown, the reference point determination module 94 includes: a calculation module 941 and a fifth determination module 942. The calculation module 941 is used to calculate the angle between the normal of the line connecting the third reference point on the current detection frame and the road monitoring device and the current driving direction in the target coordinate system. In one embodiment, the third reference point and the second reference point are the same. The fifth determination module 942 is used to determine the first reference point according to the correspondence between the angle combined with the preset angle interval and the corner point of the current detection frame, and the first reference point is the corner point of the current detection frame corresponding to the angle.
[0110] In this case, in one embodiment, the vehicle positioning device 90 also includes a position smoothing module 97, which is used to calculate the confidence of the current position of the vehicle based on the ratio of the difference between the included angle and the boundary angle of the preset angle interval and the angle interval when the difference between the included angle and the boundary angle of the preset angle interval is less than a preset threshold; and smooth the current position of the vehicle based on the confidence.
[0111] In one embodiment, the positioning module 96 specifically includes: a sixth determination module 961, a seventh determination module 962 and an eighth determination module 963. Among them, the sixth determination module 961 is used to determine the vehicle mapped to the corresponding rectangular frame in the target coordinate system according to the acquired length and width of the vehicle. The seventh determination module 962 is used to determine the position and posture of the rectangular frame in the target coordinate system according to the positioning reference point, the current driving direction, and the orientation of the road monitoring device relative to the road monitored by the road monitoring device. The eighth determination module 963 is used to determine the center point of the rectangular frame when it is in the position and posture as the current position of the vehicle in the target coordinate system.
[0112] The vehicle positioning device provided in any embodiment of the present application and the image-based vehicle positioning method provided in any of the above embodiments belong to the same inventive concept. Details not described in the vehicle positioning device embodiment can be referred to the image-based vehicle positioning method embodiment, and the same beneficial effects as the image-based vehicle positioning method can be achieved, which will not be repeated here.
[0113] Exemplary Electronic Devices
[0114] Below, reference Fig.13 To describe the electronic device according to the embodiment of the present application. The electronic device may be Figure 1 Any one or both of the vehicle-mounted device, road monitoring device or server.
[0115] Fig.13 A block diagram of an electronic device according to an embodiment of the present application is illustrated.
[0116] like Fig.13 As shown, the electronic device 10 includes one or more processors 11 and a memory 12 .
[0117] The processor 11 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 100 to perform desired functions.
[0118] The memory 12 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may run the program instructions to implement the image-based vehicle positioning method of each embodiment of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0119] In one example, the electronic device 10 may further include: an input device 13 and an output device 14, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0120] For example, when the electronic device is a road monitoring device, the input device 13 may be a camera for capturing image signals. When the electronic device is a vehicle-mounted device, the input device 13 may be a communication network connector for transmitting signals between the road monitoring device and a server.
[0121] The output device 14 can output various information to the outside, including determined distance information, direction information, etc. The output device 14 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0122] Of course, to simplify, Fig.13 Only some of the components related to the present application in the electronic device 10 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 10 may also include any other appropriate components.
[0123] Exemplary computer program products and computer-readable storage media
[0124] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the image-based vehicle positioning method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
[0125] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0126] In addition, an embodiment of the present application may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of the image-based vehicle positioning method according to various embodiments of the present application described in the above “Exemplary Method” section of this specification.
[0127] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0128] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.
[0129] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0130] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.
[0131] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0132] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A vehicle positioning method based on an image, comprising: Determine at least one historical detection frame about the vehicle in at least one historical frame image captured by the road monitoring device; Determining a current detection frame of the vehicle in a current frame image captured by the road monitoring device; Determining a current driving direction of the vehicle based on the at least one historical detection frame and the current detection frame; Based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device, determining a first reference point on the current detection frame; Based on the first reference point, determine a positioning reference point in a target coordinate system, where the positioning reference point is obtained by mapping the first reference point to the target coordinate system; Determine the current position of the vehicle in the target coordinate system according to the positioning reference point, the current driving direction, and the size parameters of the vehicle; Wherein, determining the first reference point on the current detection frame based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device includes: In the target coordinate system, calculating an angle between a normal line of a line connecting a third reference point on the current detection frame and the road monitoring device and the current driving direction, wherein, depending on the position of the current detection frame in the current frame image, the third reference point is a center point of the current detection frame, or a midpoint of two adjacent corner points of the current detection frame; Determine the first reference point according to the included angle combined with the correspondence between the preset angle interval and the corner point of the current detection frame, where the first reference point is the corner point of the current detection frame corresponding to the included angle. The correspondence between the preset angle interval and the corner point of the current detection frame includes: when the angle is [-90°, -30°] or [0°, 30°], the lower right corner point of the current detection frame is used as the first reference point; when the angle is [-30°, 0°] or [30°, 90°], the lower left corner point of the current detection frame is used as the first reference point.
2. The image-based vehicle positioning method according to claim 1, wherein: The determining the current driving direction of the vehicle based on the at least one historical detection frame and the current detection frame includes: Determine a current second reference point on the current detection frame according to the position of the current detection frame in the current frame image; The current driving direction of the vehicle is determined according to the current second reference point in combination with at least one historical second reference point on the at least one historical detection frame.
3. The image-based vehicle positioning method according to claim 2, wherein: The determining the current second reference point of the current detection frame according to the position of the current detection frame in the current frame image includes: Determine the number of pixels enclosed by the current detection frame; When the number is greater than or equal to a first number threshold and less than a second number threshold, determining the current second reference point based on two adjacent pixel points whose horizontal coordinates and vertical coordinates are changed and are used to determine the current detection frame; When the number is greater than or equal to a second number threshold, the current second reference point is determined based on the center point of the current detection frame.
4. The image-based vehicle positioning method according to claim 3, further comprising: When the number is less than the first number threshold, the current detection frame is filtered out.
5. The image-based vehicle positioning method according to claim 2, wherein: The determining the current driving direction of the vehicle according to the current second reference point in combination with at least one historical second reference point acquired on the at least one historical detection frame includes: Determining a rough driving direction of the vehicle based on the current second reference point and a predetermined historical second reference point among the at least one historical second reference point; A weighted average of a direction vector of the rough driving direction and a direction vector of at least one historical driving direction of the vehicle in the at least one historical frame image is determined to obtain the current driving direction.
6. The image-based vehicle positioning method according to claim 2, wherein: Before determining the current second reference point on the current detection frame according to the position of the current detection frame in the current frame image, the method further includes: Determine a running track of the center point according to the center point of the current detection frame and the center point of the at least one historical detection frame; Smoothing the running trajectory of the central point; The current detection frame is updated based on the moving trajectory of the center point after smoothing.
7. A vehicle positioning device, comprising: A first determination module is used to determine at least one historical detection frame about a vehicle in at least one historical frame image taken by a road monitoring device; A second determination module is used to determine a current detection frame of the vehicle in the current frame image; a direction determination module, configured to determine a current driving direction of the vehicle based on the at least one historical detection frame and the current detection frame; A reference point determination module, configured to determine a first reference point on the current detection frame based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device; A reference point determination module, configured to determine a positioning reference point in a target coordinate system based on the first reference point, wherein the positioning reference point is obtained by mapping the first reference point to the target coordinate system; A positioning module, used to determine the current position of the vehicle in the target coordinate system according to the positioning reference point, the current driving direction, and the size parameters of the vehicle; Wherein, determining the first reference point on the current detection frame based on the current driving direction and the relative position relationship between the vehicle and the road monitoring device includes: In the target coordinate system, calculating an angle between a normal line of a line connecting a third reference point on the current detection frame and the road monitoring device and the current driving direction, wherein, depending on the position of the current detection frame in the current frame image, the third reference point is a center point of the current detection frame, or a midpoint of two adjacent corner points of the current detection frame; Determine the first reference point according to the included angle combined with the correspondence between the preset angle interval and the corner point of the current detection frame, where the first reference point is the corner point of the current detection frame corresponding to the included angle. The correspondence between the preset angle interval and the corner point of the current detection frame includes: when the angle is [-90°, -30°] or [0°, 30°], the lower right corner point of the current detection frame is used as the first reference point; when the angle is [-30°, 0°] or [30°, 90°], the lower left corner point of the current detection frame is used as the first reference point.
8. A computer-readable storage medium storing a computer program for executing the image-based vehicle positioning method according to any one of claims 1 to 6.
9. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is used to execute the image-based vehicle positioning method described in any one of claims 1 to 6.
