Vehicle positioning method, device, storage medium and vehicle
By identifying and fitting the mark line area by a monocular camera and calculating the vehicle distance based on the actual width, the problem of high AGV positioning hardware and computing costs is solved, efficient, low-cost and high-reliability vehicle positioning is achieved, and positioning accuracy and robustness are enhanced.
Patent Information
- Application Number
- CN202310062000.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-13
- Filing Date
- 2023-01-19
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2043-01-19
AI Technical Summary
The existing AGV positioning technology has problems with high hardware costs and high computing costs, especially binocular cameras and laser guidance methods, making it difficult to achieve high efficiency, low cost and high reliability vehicle positioning.
The monocular camera is used to obtain images, and by identifying the area of the mark line and fitting it into a rectangle, combining the actual width and image position of the mark line, the horizontal distance from the vehicle to the mark line is calculated, and processing is performed using an embedded system to reduce hardware costs and improve computing efficiency.
It realizes high efficiency, low cost and high reliability of vehicle positioning, small calculation volume, fast speed, high reliability of positioning results, and can be combined with lidar positioning methods to improve overall positioning accuracy and robustness.
Smart Images

Figure CN118196182B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the field of computer technology, and more particularly to a vehicle positioning method, apparatus, computer program product, non-transitory computer-readable storage medium, and vehicle. Background Art
[0002] An AGV (Automated Guided Vehicle) is a transport vehicle equipped with an automatic navigation device such as electromagnetic or optical, capable of traveling along a specified navigation path, and having safety protection and various transfer functions.
[0003] The navigation methods of AGVs usually include electromagnetic guidance, magnetic tape guidance, laser guidance, and visual guidance. Among them, electromagnetic guidance and magnetic tape guidance have relatively high requirements for the AGV application environment. The cost of laser guidance is relatively high. In visual guidance, the computing cost of image comparison is relatively high, and the hardware cost of binocular cameras is relatively high.
[0004] Therefore, it is necessary to propose a new vehicle positioning solution to solve at least one of the above technical problems. Summary of the Invention
[0005] The object of the present disclosure is to provide a vehicle positioning method, apparatus, computer program product, non-transitory computer-readable storage medium, and vehicle to achieve vehicle positioning with high efficiency, low cost, and high reliability.
[0006] According to a first aspect of the present disclosure, there is provided a vehicle positioning method for positioning a vehicle in a driving area, wherein the ground of the driving area is provided with marking lines, and the vehicle is provided with a monocular camera. The method includes: obtaining an image captured by the monocular camera to obtain a target image; determining a region corresponding to the marking lines from the target image to obtain a target region; fitting the target region into a rectangle to obtain a target rectangle; and determining a horizontal distance from the vehicle to the marking lines according to the actual width of the marking lines, the width of the target rectangle in the target image, and the position of the target rectangle in the target image.
[0007] According to a second aspect of the present disclosure, there is provided a vehicle positioning device for positioning a vehicle in a driving area. The ground of the driving area is provided with marking lines, and the vehicle is provided with a monocular camera. The device includes: an acquisition module for acquiring an image captured by the monocular camera to obtain a target image; an extraction module for determining an area corresponding to the marking lines from the target image to obtain a target area; a fitting module for fitting the target area into a rectangle to obtain a target rectangle; and a positioning module for determining a horizontal distance from the vehicle to the marking lines according to the actual width of the marking lines, the width of the target rectangle in the target image, and the position of the target rectangle in the target image.
[0008] According to a third aspect of the present disclosure, there is provided a computer program product including program code instructions. When the program product is executed by a computer, the program code instructions cause the computer to execute the method according to the first aspect of the present disclosure.
[0009] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to the first aspect of the present disclosure.
[0010] According to a fifth aspect of the present disclosure, there is provided a vehicle including: a processor, a memory in electronic communication with the processor; and instructions stored in the memory and executable by the processor to cause the vehicle to execute the method according to the first aspect of the present disclosure.
[0011] It should be understood that the content described in this part is not intended to identify the key or essential features of the claimed invention, nor is it intended to be used alone to determine the scope of the claimed invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. In all the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0013] Figure 1 FIG. shows a system architecture diagram of an embodiment of the vehicle positioning method according to the present disclosure;
[0014] Figure 2 FIG. shows a flowchart of an embodiment of the vehicle positioning method according to the present disclosure;
[0015] Figure 3A Shows a schematic diagram of an application scenario according to an embodiment of the present disclosure;
[0016] Figure 3B Shows a schematic diagram of a target image according to an embodiment of the present disclosure;
[0017] Figure 3C Shows a schematic diagram of an exemplary structure of an embedded system according to an embodiment of the present disclosure;
[0018] Figure 3D Shows a flowchart of a specific example of a vehicle positioning method according to the present disclosure;
[0019] Figure 3E Shows a schematic diagram of the effect of using the vehicle positioning method according to an embodiment of the present disclosure to assist lidar positioning;
[0020] Figure 4 Shows an exemplary block diagram of a vehicle positioning device according to an embodiment of the present disclosure;
[0021] Figure 5 Shows a schematic diagram of an electronic device in an example vehicle that can be used to implement an embodiment of the present disclosure.
[0022] Specific implementation manners
[0023] The present disclosure will be described more fully hereinafter with reference to the accompanying drawings. However, the present disclosure may be embodied in many alternative forms and should not be construed as limited to the embodiments described herein. Thus, although the present disclosure is amenable to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will be described in detail herein. It should be understood, however, that this is not intended to limit the present disclosure to the particular forms disclosed, but on the contrary, the present disclosure covers all modifications, equivalents, and alternatives falling within the spirit and scope of the present disclosure as defined by the claims.
[0024] It should be understood that although various elements herein may be described using the terms first, second, etc., these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element, without departing from the teachings of the present disclosure.
[0025] This document describes some examples in combination with block diagrams and / or flowcharts, where each block represents a part of a circuit element, a module in a die, or code that includes one or more executable instructions for implementing a specified logical function. It should also be noted that in other implementations, the functions described in the blocks may not occur in the order described. For example, depending on the functions involved, two consecutively shown blocks may actually be executed substantially simultaneously, or these blocks may sometimes be executed in the reverse order.
[0026] As used herein, the phrase "according to... example" or "in... example" means that a particular feature, structure, or characteristic described in combination with the example can be included in at least one implementation of the present disclosure. The phrases "according to... example" or "in... example" that appear in different places in this document do not necessarily refer to the same example, nor are they necessarily separate or alternative examples that are mutually exclusive of other examples.
[0027] Figure 1 An exemplary system architecture 100 is shown in which embodiments of the vehicle positioning method, device, terminal device, and storage medium to which the present disclosure can be applied can be implemented.
[0028] As Figure 1 shown, the system architecture 100 may include a vehicle 101, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the vehicle 101 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0029] A user can use the vehicle 101 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the vehicle 101, such as voice interaction applications, instant messaging tools, vehicle navigation software, etc.
[0030] The vehicle 101 may be a physical vehicle or software installed in the above physical vehicle. When the vehicle 101 is software, it may be implemented as multiple software or software modules, or it may be implemented as a single software or software module. No specific limitation is made here. The vehicle 101 may be a vehicle with autonomous driving or assisted driving functions. Optionally, the vehicle 101 may be an AGV.
[0031] The server 105 may be a server that provides various services, such as a background server that processes vehicle positioning requests sent by the vehicle 101.
[0032] In some cases, the vehicle positioning method provided by the present disclosure can be executed by vehicle 101. Correspondingly, the vehicle positioning device can also be disposed in vehicle 101. In this case, the system architecture 100 may not include server 105 either. For example, the vehicle positioning method provided by the present disclosure can be executed by an embedded system disposed in vehicle 101, which is beneficial to improving the positioning processing speed.
[0033] In some cases, the vehicle positioning method provided by the present disclosure can be executed by server 105. Correspondingly, the vehicle positioning device can also be disposed in server 105. In this case, the system architecture 100 may not include vehicle 101 either.
[0034] In some cases, the vehicle positioning method provided by the present disclosure can be executed jointly by vehicle 101 and server 105. Correspondingly, the vehicle positioning devices can also be respectively disposed in vehicle 101 and server 105.
[0035] It should be noted that server 105 can be hardware or software. When server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When server 105 is software, it can be implemented as multiple software or software modules (for example, used to provide distributed services), or as a single software or software module. No specific limitation is made here.
[0036] It should be understood that Figure 1 the numbers of vehicles, networks, and servers in
[0037] Figure 2 shows a flowchart of an embodiment of the vehicle positioning method according to the present disclosure. The method in this embodiment can be implemented by Figure 1 the vehicle in Figure 1 or by Figure 1 the server in
[0038] or jointly by the vehicle and the server in
[0039] When the method in this embodiment is implemented by the server or jointly by the vehicle and the server, the vehicle can collect a target image and send it to the server for processing.
[0040] The vehicle positioning method in this embodiment is used for vehicle positioning in a driving site. The ground of the driving site is provided with marking lines, and the vehicle is provided with a monocular camera. In an alternative embodiment, the vehicle can be an AGV. Exemplarily, an AGV can be used to move other objects (such as a vehicle to be parked) to a target position (such as a garage or a parking space).
[0041] Figure 3A Fig. shows a schematic diagram of an application scenario according to an embodiment of the present disclosure, corresponding to a top-down view. As Figure 3A shown, two monocular cameras are provided on both sides of the vehicle. The ground of the driving site is provided with calibration lines, including a first calibration line and a second calibration line. The colors of the first calibration line and the second calibration line can be different. For example, the first calibration line can be red, and the second calibration line can be yellow. The first calibration line and the second calibration line can correspond to different driving tasks. For example, the first calibration line is used to indicate the position of the passage, corresponding to the straight driving task of the vehicle, and the second calibration line is used to indicate the position of the garage, corresponding to the vehicle's warehousing task.
[0042] As Figure 2 shown, the vehicle positioning method 200 in this embodiment includes the following steps:
[0043] Step 210, obtain an image captured by the monocular camera to obtain a target image.
[0044] In this embodiment, the monocular camera is used to capture an image of the driving site. Optionally, the monocular camera can be set at a relatively low height or near the bottom of the vehicle to obtain a ground image in a larger range.
[0045] In this embodiment, the monocular camera can capture an image including marking lines. Refer to Figure 3A . The image captured by the right monocular camera includes the first marking line on the right and one second marking line on the right. The image captured by the left monocular camera includes the first marking line on the left and one second marking line on the left.
[0046] Step 220, determine the area corresponding to the marking line from the target image to obtain a target area.
[0047] In an alternative embodiment, the marking line has a set color. The area corresponding to the marking line can be determined from the target image according to the color of the marking line.
[0048] At this time, step 220 can further include: step 221, convert the target image from RGB color representation to HSV color representation. Step 222, determine the target area according to the HSV color representation of the target image and the set color of the marking line.
[0049] HSV (Hue, Saturation, Value) is a color space created based on the intuitive characteristics of colors, also known as the Hexcone Model. The parameters in the HSV color representation are hue (H), saturation (S), and value (V) respectively. The HSV color representation can be used to select the desired color.
[0050] Exemplarily, by comparing the HSV values of each pixel point in the target image with the HSV values of the set color, the pixel points in the target image that are the same as the set color can be selected, and the area formed by connecting these pixel points is the target area.
[0051] In an alternative embodiment, the target area can be determined based on the area of the region. At this time, step 222 can be further included: step 222a, based on the HSV color representation of the target image, determine at least one candidate region in the target image that is the same as the set color of the marking line. Step 222b, determine the target area from at least one candidate region according to the area of at least one candidate region.
[0052] In the driving area, there may be interfering objects with the same color as the calibration line. Generally speaking, the size of the interfering object in the target image is smaller than the size of the calibration line in the target image. Therefore, the candidate region with the largest area can be selected from at least one candidate region, and this candidate region is determined as the target area. The above method can exclude the influence of interfering objects and is beneficial to improving the effectiveness of the marking line recognition result.
[0053] In an alternative embodiment, the area of the candidate region with the largest area can be further compared with a preset area threshold, and when the area of the candidate region with the largest area exceeds the preset area threshold, the candidate region with the largest area is determined as the target area.
[0054] The above method can exclude the situation where the marking line is small or not captured, which is beneficial to further improving the effectiveness of the marking line recognition result.
[0055] In an alternative embodiment, there are at least two sets of marking lines with set colors on the ground of the driving area, and at least two set colors correspond to different driving tasks. At this time, step 222 can be further included: determine the set color corresponding to the current driving task to obtain the target color; determine the target area according to the HSV color representation of the target image and the target color.
[0056] The above method can exclude the marking lines that are irrelevant to the current driving task and ensure that the marking line recognition result is consistent with the current driving task.
[0057] Step 230, fit the target area into a rectangle to obtain the target rectangle.
[0058] In this embodiment, when the target area is an irregular rectangle, the target area is approximated to a rectangle.
[0059] In this embodiment, the method of approximating the rectangle is not limited. For example, the smallest rectangle enclosing the target area can be found and used as the target rectangle for approximation. Another example is to remove the redundant pixels at the boundary of the target area, and the remaining pixels form the target rectangle for approximation.
[0060] Step 240: Determine the horizontal distance from the vehicle to the marking line according to the actual width of the marking line, the width of the target rectangle in the target image, and the position of the target rectangle in the target image.
[0061] In this embodiment, since the actual width of the marking line is known, the actual width of the marking line can be mapped into the target image, and then the horizontal distance from the vehicle to the marking line can be determined.
[0062] In an alternative embodiment, the marking line extends along the vertical axis of the pixel coordinate system, and the left side of the target image corresponds to the edge of the vehicle. The horizontal distance from the vehicle to the marking line can be determined according to Equation (1):
[0063]
[0064] In the formula, distance represents the horizontal distance from the vehicle to the marking line, x represents the abscissa of the upper right vertex of the target rectangle in the pixel coordinate system of the target image, w represents the pixel width of the target rectangle in the target image, and linewide represents the actual width of the marking line.
[0065] Figure 3B FIG. shows a schematic diagram of a target image according to an embodiment of the present disclosure. As Figure 3B shown, the origin of the pixel coordinate system is at the upper left corner of the target image, and the left side of the target image corresponds to the edge of the vehicle. As can be understood, x - 0.5w corresponds to the distance between the vehicle and the marking line in the target image. At the same time, both the actual width linewide of the marking line and the width of the marking line in the target image (i.e., the pixel width of the target rectangle in the target image) w are known. Based on this, the actual distance between the vehicle and the marking line can be obtained through proportional mapping.
[0066] When the left side of the original image captured by the monocular camera does not correspond to the edge of the vehicle, the original image can be cropped or padded so that its left side corresponds to the edge of the vehicle. Alternatively, the corresponding distance can be added or subtracted based on the calculation result of Equation (1) to obtain the actual distance between the vehicle and the marking line.
[0067] By determining the horizontal distance from the vehicle to the marking line in the above manner, the amount of computation is small, the computation speed is fast, and the result is highly reliable.
[0068] In this embodiment, based on the actual width of the marking line, the horizontal distance from the vehicle to the marking line is obtained by processing the target image captured by the monocular camera, which can achieve vehicle positioning with high efficiency, low cost, and high reliability.
[0069] In an alternative embodiment, after determining the area corresponding to the marking line in the target image and before fitting the target area into a rectangle, Gaussian smoothing processing can be performed on the target image. Gaussian smoothing is a method of smoothing the image using the idea of neighborhood averaging. By performing Gaussian smoothing processing, the target image can have a uniform and smooth transition, removing details and filtering out noise, which is beneficial to further improving the accuracy of the positioning result.
[0070] In an alternative embodiment, after obtaining the target area, the deviation angle of the vehicle can be further determined. Specifically, it can include: First, fit the target area into a straight line (the fitting method is not limited, for example, using the least squares method) to obtain the target straight line. Second, according to the position of the target straight line in the target image, determine the angle between the projection of the axis of the monocular camera on the ground and the perpendicular line of the marking line to obtain the deviation angle of the vehicle.
[0071] By determining the deviation angle of the vehicle and combining the horizontal distance from the vehicle to the marking line, more complete vehicle positioning information can be obtained.
[0072] In some cases, due to the low installation position of the monocular camera and the large viewing angle of the marking line, image distortion is likely to occur. For this reason, orthodontic calibration can be performed based on the positioning results of two monocular cameras to further improve the accuracy of the positioning result.
[0073] To address the above problems, in an alternative embodiment, two monocular cameras are provided on both sides of the vehicle, and at least one set of marking lines is provided on the bottom surface of the driving area. Each set of marking lines includes two marking lines that are parallel to each other and spaced a set distance apart. The process of orthodontic calibration can include: First, according to the first target image captured by the first monocular camera among the two monocular cameras, determine the first distance between the vehicle and one of the marking lines in a set of marking lines; Second, according to the second target image captured by the second monocular camera among the two monocular cameras, determine the second distance between the vehicle and the other marking line in a set of marking lines; Finally, according to the first distance, the second distance, the set distance between the two marking lines, and the body size of the vehicle, determine the calibration position of the vehicle between the two marking lines.
[0074] In an alternative embodiment, the calibration position of the vehicle between the two marking lines can be determined according to equations (2), (3), and (4):
[0075]
[0076]
[0077] plot = distance1' - distance2' Equation (4)
[0078] In the formula, distance1 represents the first distance, distance2 represents the second distance, D represents the set distance between two marking lines, L represents the vehicle body size in the direction perpendicular to the two marking lines, distance1' represents the first calibration distance, distance2' represents the second calibration distance, and plot represents the calibration position.
[0079] Since the distance between the two marking lines and the vehicle body length are fixed, through proportional calculation, a more accurate calibration position can be obtained.
[0080] As can be understood, when plot is zero, it represents that the vehicle is located at the central position between the two marking lines. When plot is non-zero, it represents that the vehicle deviates from the central position between the two marking lines.
[0081] The fusion adopted in the above embodiment is at the decision-making level, that is, based on the two calculation results of the first distance and the second distance, the two are fused to obtain the final calibration result. The above method can obtain higher positioning accuracy.
[0082] Similarly, the deviation angle of the vehicle can be fused. Specifically, it can include: First, according to the first target image, determine the first deviation angle of the vehicle relative to one of the marking lines in a set of marking lines. Second, according to the second target image, determine the second deviation angle of the vehicle relative to the other marking line in a set of marking lines. Finally, according to the first deviation angle and the second deviation angle, determine the calibration deviation angle of the vehicle between the two marking lines.
[0083] In an alternative embodiment, the method in this embodiment is implemented by an embedded system provided on the vehicle. By adopting an embedded system, it is beneficial to improve the positioning processing speed.
[0084] Optionally, the embedded system includes a host computer, a switch, and two computing units. The switch is respectively connected to two monocular cameras, the two computing units, and the switch. The above computing units are, for example, Raspberry Pi. The two computing units are used to calculate the first distance and the second distance according to the target images captured by the two monocular cameras. The host computer is used to determine the calibration position of the vehicle between the two marking lines according to the first distance, the second distance, the set distance between the two marking lines, and the vehicle body size.
[0085] Figure 3CA schematic diagram showing an exemplary structure of an embedded system according to an embodiment of the present disclosure. Since each Raspberry Pi has only one network port and network port expanders are costly, the computing structure in this embodiment can be adopted. As Figure 3C shown, two Raspberry Pis and two cameras are uniformly connected to a switch, and the data is allocated in the switch. The switch is then connected to the host computer via a network cable. After the cameras collect information, they send it to the switch, and then it is transferred to the Raspberry Pi for calculation. Subsequently, the Raspberry Pi sends the collected data to the host computer for decision fusion.
[0086] Adopting the above composition structure of the embedded system is beneficial to reducing the hardware cost.
[0087] Figure 3D A flowchart showing a specific example of a vehicle positioning method according to the present disclosure. As Figure 3D shown, in this example, first, the target image is converted to the HSV space. Secondly, the calibration line is extracted from the target image and fitted into a rectangle. After that, the fixed size of the calibration object is mapped to obtain the calculation result. Next, the calculation results on each embedded card are sent to the host computer. Finally, the host computer fuses the two calculation results to obtain the calibration result.
[0088] In an alternative embodiment, the vehicle positioning method in this embodiment can be combined with other positioning methods (such as lidar positioning method). Exemplarily, the lidar positioning method can be used as the main positioning method, and the positioning method based on dual monocular cameras in this embodiment can be used as the auxiliary positioning method. When the lidar positioning result is abnormal, the positioning result based on dual monocular cameras in this embodiment is used as a reference to correct the lidar positioning result.
[0089] Figure 3E A schematic diagram showing the effect of using the vehicle positioning method according to an embodiment of the present disclosure to assist lidar positioning. As Figure 3E shown, the time delay of the vehicle positioning method in this embodiment is 500 ms, which is consistent with that of the lidar. The trends of the two curves are the same, proving the correctness of the output result of the vehicle positioning method in this embodiment. When there are abnormal points in the lidar, the vehicle positioning method in this embodiment shows stable results, effectively improving the accuracy and robustness of the vehicle positioning result.
[0090] Figure 4 A block diagram showing an exemplary vehicle positioning device according to an embodiment of the present disclosure. As Figure 4As shown, the vehicle positioning device 400 includes: an acquisition module 410, configured to acquire the image captured by the above-mentioned monocular camera to obtain a target image; an extraction module 420, configured to determine the area corresponding to the above-mentioned marking line from the above-mentioned target image to obtain a target area; a fitting module 430, configured to fit the above-mentioned target area into a rectangle to obtain a target rectangle; a positioning module 440, configured to determine the horizontal distance from the above-mentioned vehicle to the above-mentioned marking line according to the actual width of the above-mentioned marking line, the width of the above-mentioned target rectangle in the above-mentioned target image, and the position of the above-mentioned target rectangle in the above-mentioned target image.
[0091] It should be understood that Figure 4 each module of the device 400 shown in Figure 2 can correspond to each step in the method 200 described with reference to
[0092] In an alternative embodiment, the positioning module 440 is further configured to: determine the horizontal distance from the above-mentioned vehicle to the above-mentioned marking line according to Equation (1):
[0093]
[0094] In the formula, distance represents the horizontal distance from the above-mentioned vehicle to the above-mentioned marking line, x represents the abscissa of the upper right vertex of the above-mentioned target rectangle in the pixel coordinate system of the above-mentioned target image, where the above-mentioned marking line extends along the vertical axis of the above-mentioned pixel coordinate system, the left side of the above-mentioned target image corresponds to the edge of the above-mentioned vehicle, w represents the pixel width of the above-mentioned target rectangle in the above-mentioned target image, and linewide represents the actual width of the above-mentioned marking line.
[0095] In an alternative embodiment, the above-mentioned marking line has a set color. The extraction module 420 is further configured to: convert the above-mentioned target image from RGB color representation to HSV color representation; determine the above-mentioned target area according to the HSV color representation of the above-mentioned target image and the set color of the above-mentioned marking line.
[0096] In an alternative embodiment, the extraction module 420 is further configured to: determine at least one candidate area consistent with the set color of the above-mentioned marking line from the above-mentioned target image based on the HSV color representation of the above-mentioned target image; determine the above-mentioned target area from the above-mentioned at least one candidate area according to the area of the above-mentioned at least one candidate area.
[0097] In an alternative embodiment, the extraction module 420 is further configured to: select the candidate region with the largest area from the at least one candidate region; and in the case where the area of the candidate region with the largest area exceeds a preset area threshold, determine the candidate region with the largest area as the target region.
[0098] In an alternative embodiment, the ground of the driving site is provided with marking lines of at least two set colors, and the at least two set colors correspond to different driving tasks. The extraction module 420 is further configured to: determine the set color corresponding to the current driving task to obtain a target color; and determine the target region according to the HSV color representation of the target image and the target color.
[0099] In an alternative embodiment, the extraction module 420 is further configured to perform Gaussian smoothing processing on the target image.
[0100] In an alternative embodiment, the fitting module 430 is further configured to fit the target region into a straight line to obtain a target straight line. The positioning module 440 is further configured to: determine an angle between a perpendicular line of the axis of the monocular camera on the ground with respect to the marking line according to the position of the target straight line in the target image, so as to obtain a deviation angle of the vehicle.
[0101] In an alternative embodiment, two monocular cameras are disposed on two sides of the vehicle, and the bottom surface of the driving site is provided with at least one set of marking lines, and each set of marking lines includes two marking lines that are parallel to each other and spaced apart by a set distance. The apparatus 400 further includes a fusion module (not shown), and the fusion module is configured to: determine a first distance between the vehicle and one of the marking lines in the set of marking lines according to a first target image captured by a first monocular camera among the two monocular cameras; determine a second distance between the vehicle and the other marking line in the set of marking lines according to a second target image captured by a second monocular camera among the two monocular cameras; and determine a calibration position of the vehicle between the two marking lines according to the first distance, the second distance, the set distance between the two marking lines, and the body size of the vehicle.
[0102] In an alternative embodiment, the fusion module is further configured to determine the calibration position of the vehicle between the two marking lines according to equations (2), (3), and (4):
[0103]
[0104]
[0105] plot = distance1' - distance2' Equation (4)
[0106] Wherein, distance1 represents the first distance described above, distance2 represents the second distance described above, D represents the set distance between the two marking lines described above, L represents the body size of the vehicle in the direction perpendicular to the two marking lines described above, and plot represents the calibration position described above.
[0107] In an alternative embodiment, the fusion module is further configured to: determine a first deviation angle of the vehicle relative to one of the set of marking lines according to the first target image; determine a second deviation angle of the vehicle relative to the other of the set of marking lines according to the second target image; and determine a calibration deviation angle of the vehicle between the two marking lines according to the first deviation angle and the second deviation angle.
[0108] In an alternative embodiment, the device 400 is implemented by an embedded system disposed on the vehicle. The embedded system includes a host computer, a switch, and two computing units. The switch is respectively connected to the two monocular cameras, the two computing units, and the switch; the two computing units are configured to calculate the first distance and the second distance according to the target images captured by the two monocular cameras; and the host computer is configured to determine the calibration position of the vehicle between the two marking lines according to the first distance, the second distance, the set distance between the two marking lines, and the body size of the vehicle.
[0109] Figure 5 FIG. shows a schematic block diagram of an electronic device 500 in an example vehicle that can be used to implement the embodiments of the present disclosure. The electronic device 500 is an example of a hardware device that can be applied to various aspects of the present disclosure. As Figure 5 shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504. A plurality of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, a touch device, a voice control device, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disc, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0110] The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 executes the various methods and processes described above, such as the vehicle positioning method. For example, in some embodiments, the vehicle positioning method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the vehicle positioning method described above can be executed. Alternatively, in other embodiments, the computing unit 501 can be configured to execute the vehicle positioning method by any other suitable means (e.g., by means of firmware).
[0111] The various illustrative logical, logical block, module, circuit, and algorithmic processes described in connection with the aspects disclosed herein can be implemented as electronic hardware, computer software, or a combination of both. The interchangeability of hardware and software has been generally described in terms of functionality and illustrated in the various illustrative components, blocks, modules, circuits, and processes above. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system.
[0112] The hardware and data processing apparatus for implementing the various illustrative logical, logical block, module, and circuit described in connection with the aspects disclosed herein can be implemented or executed using a general-purpose single-chip or multi-chip processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor can be a microprocessor or any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. In some aspects, particular processes and methods can be performed by circuitry specific to a given function.
[0113] In one or more aspects, the described functionality may be implemented in hardware, digital electronic circuitry, computer software, firmware (including the structures disclosed in this specification and their structural equivalents), or any combination thereof. Aspects of the subject matter described in this specification may also be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a computer storage medium for execution by, or to control the operation of, a data processing apparatus.
[0114] If implemented in software, the functionality may be stored or transmitted as one or more instructions or code on a computer-readable medium. The processes of the methods or algorithms disclosed herein may be implemented in a processor-executable software module, which may reside on a computer-readable medium. A computer-readable medium includes both computer storage media and communication media including any medium that can transfer a computer program from one place to another. The storage media may be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired program code in the form of instructions or data structures and that can be accessed by a computer. Additionally, any connection may be properly termed a computer-readable medium. Disk and disc as used herein include high density discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs where disks typically reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media. Additionally, operations of a method or algorithm may be implemented as code and instructions on or in a machine-readable medium and computer-readable medium, which may be incorporated into a computer program product.
[0115] The various embodiments in this disclosure are described in a related manner. For parts that are the same or similar among the various embodiments, reference may be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the apparatus embodiments, device embodiments, computer-readable storage medium embodiments, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference may be made to the partial description of the method embodiments for the relevant parts.
Claims
1. A vehicle positioning method for positioning a vehicle in a driving area, where the ground of the driving area is provided with marking lines, and the vehicle is provided with a monocular camera. The method includes: Obtain an image captured by the monocular camera to get a target image; Determine the area corresponding to the marking line from the target image to get a target area, including: converting the target image from RGB color representation to HSV color representation; according to the HSV color representation of the target image and the set color of the marking line, by comparing the HSV values of each pixel point in the target image with the HSV value of the set color, select the pixel points in the target image that are consistent with the set color to determine the target area; Fit the target area into a rectangle to get a target rectangle; Determine the horizontal distance from the vehicle to the marking line according to the actual width of the marking line, the width of the target rectangle in the target image, and the position of the target rectangle in the target image, including: determining the horizontal distance from the vehicle to the marking line according to formula (1): In the formula, distance represents the horizontal distance from the vehicle to the marking line, x represents the abscissa of the upper right vertex of the target rectangle in the pixel coordinate system of the target image, where the marking line extends along the vertical axis of the pixel coordinate system, the left side of the target image corresponds to the edge of the vehicle, w represents the pixel width of the target rectangle in the target image, and linewide represents the actual width of the marking line.
2. The method according to claim 1, wherein, The determining the target area according to the HSV color representation of the target image and the set color of the marking line includes: Based on the HSV color representation of the target image, determine at least one candidate area that is consistent with the set color of the marking line from the target image; Determine the target area from the at least one candidate area according to the area of the at least one candidate area.
3. The method according to claim 2, wherein The determining the target area from the at least one candidate area according to the area of the at least one candidate area includes: Select the candidate area with the largest area from the at least one candidate area; In the case that the area of the candidate area with the largest area exceeds a preset area threshold, determine the candidate area with the largest area as the target area.
4. The method according to claim 1, wherein The ground of the driving area is provided with marking lines of at least two set colors, and the at least two set colors correspond to different driving tasks; And The determining the target area according to the HSV color representation of the target image and the set color of the marking line includes: Determine the set color corresponding to the current driving task to get a target color; Determine the target area according to the HSV color representation of the target image and the target color.
5. The method according to claim 1, wherein Before fitting the target area into a rectangle after determining the area corresponding to the marking line from the target image, the method further includes: Perform Gaussian smoothing processing on the target image.
6. The method according to claim 1, wherein After obtaining the target area, the method further includes: Fit the target area into a straight line to get a target straight line; Determine an angle between a projection of an axis of the monocular camera on the ground and a perpendicular line to the marking line according to a position of the target line in the target image, so as to obtain a deviation angle of the vehicle.
7. The method according to claim 1, wherein Two monocular cameras are arranged on two sides of the vehicle, and at least one group of marking lines is arranged on a bottom surface of the driving site. Each group of marking lines includes two marking lines that are parallel to each other and spaced apart by a set distance. The method further includes: Determine a first distance between the vehicle and one of the marking lines in the group of marking lines according to a first target image captured by a first monocular camera among the two monocular cameras. Determine a second distance between the vehicle and the other marking line in the group of marking lines according to a second target image captured by a second monocular camera among the two monocular cameras. Determine a calibration position of the vehicle between the two marking lines according to the first distance, the second distance, the set distance between the two marking lines, and a body size of the vehicle.
8. The method according to claim 7, wherein The determining the calibration position of the vehicle between the two marking lines according to the first distance, the second distance, the set distance between the two marking lines, and the body size of the vehicle includes: Determine the calibration position of the vehicle between the two marking lines according to formula (2), formula (3), and formula (4): plot = distance1′ - distance2′ formula (4) In the formula, distannce1 represents the first distance, distance2 represents the second distance, D represents the set distance between the two marking lines, L represents a body size of the vehicle in a direction perpendicular to the two marking lines, distance1′ represents a first calibration distance, distance2′ represents a second calibration distance, and plot represents the calibration position.
9. The method according to claim 7, wherein, The method further includes: Determine a first deviation angle of the vehicle relative to one of the marking lines in the group of marking lines according to the first target image. Determine a second deviation angle of the vehicle relative to the other marking line in the group of marking lines according to the second target image. Determine a calibration deviation angle of the vehicle between the two marking lines according to the first deviation angle and the second deviation angle.
10. The method according to any one of claims 7-9, wherein The method is implemented by an embedded system provided on the vehicle. The embedded system includes a host computer, a switch, and two computing units. The switch is respectively connected to the two monocular cameras, the two computing units, and the switch. The two computing units are configured to calculate the first distance and the second distance according to target images captured by the two monocular cameras. The host computer is configured to determine the calibration position of the vehicle between the two marking lines according to the first distance, the second distance, the set distance between the two marking lines, and the body size of the vehicle.
11. A vehicle positioning device for positioning a vehicle in a driving site. Marking lines are arranged on a ground of the driving site, and a monocular camera is arranged on the vehicle. The device includes: An acquisition module, configured to acquire an image captured by the monocular camera to obtain a target image; An extraction module, configured to determine a region corresponding to the marking line from the target image to obtain a target region, including: converting the target image from being represented in RGB color to being represented in HSV color; according to the HSV color representation of the target image and the set color of the marking line, by comparing the HSV value of each pixel point in the target image with the HSV value of the set color, selecting the pixel points in the target image that are consistent with the set color to determine the target region; A fitting module, configured to fit the target region into a rectangle to obtain a target rectangle; A positioning module, configured to determine the horizontal distance from the vehicle to the marking line according to the actual width of the marking line, the width of the target rectangle in the target image, and the position of the target rectangle in the target image, including: determining the horizontal distance from the vehicle to the marking line according to Equation (1): In the formula, distance represents the horizontal distance from the vehicle to the marking line, x represents the abscissa of the upper right vertex of the target rectangle in the pixel coordinate system of the target image, where the marking line extends along the vertical axis of the pixel coordinate system, the left side of the target image corresponds to the edge of the vehicle, w represents the pixel width of the target rectangle in the target image, and linewide represents the actual width of the marking line.
12. A computer program product, including program code instructions, when the program product is executed by a computer, the program code instructions cause the computer to execute the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 10.
14. A vehicle, including: A processor, A memory in electronic communication with the processor; And Instructions, the instructions are stored in the memory and can be executed by the processor to cause the vehicle to execute the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Vehicle-mounted camera ranging method and device, storage medium and electronic equipment
CN109141347A
Vehicle locating method, vehicle locating devices and vehicle
CN110657812A