Method and system for determining lane where vehicle is located, electronic equipment and storage medium
By determining the corner position coordinates of blanking points and rectangular identification boxes from the perspective of the highway roadside camera, and using deep learning models, the problem of difficulty in accurately determining the lane of the vehicle in the prior art is solved, and the effect of accurate judgment and low power consumption is achieved.
Patent Information
- Application Number
- CN202411887935.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-29
AI Technical Summary
When performing vehicle detection from the perspective of highway roadside cameras, it is difficult to accurately determine the lane where the vehicle is located, and more labeling data and large computing power are required, and power consumption is high.
By taking the image captured by the device, the corner point position coordinates of the blanking point and the rectangular recognition box are determined. Using the trained deep learning model, the ground projection point position coordinates of the two preset positions of the target vehicle are obtained, and the lane where the vehicle is located is determined.
Accurate judgment of the lane where the vehicle is located is achieved, reducing the demand for computing power and low power consumption.
Smart Images

Figure CN119904827A_ABST
Abstract
Description
Background Art
[0002] Under the camera perspective on the side of the highway, target detection algorithms such as YOLO and ViT are used to detect vehicles, and the output is the circumscribed rectangle of the vehicle. The related prior arts include: ① the invention patent with the publication number "CN115205654A" and the subject name "a new monocular vision 3D target detection method based on key point constraints"; ② the invention patent with the publication number "CN113129348A" and the subject name "a three-dimensional reconstruction method of vehicle targets in road scenes based on monocular vision"; ③ the invention patent with the publication number "CN112819711A" and the subject name "a vehicle reverse positioning method using road lane lines based on monocular vision". However, due to the camera perspective, the bottom edge of the circumscribed rectangle often covers multiple lanes, and the bottom edge of the vehicle is often a small part of the bottom edge of the circumscribed rectangle, so it is impossible to accurately determine which lane the vehicle is in. In addition, in the prior art, general 3D target detection is often used, and there is no separate bottom edge positioning algorithm, which requires more labeled data, and the model inference requires a large amount of computing power and high power consumption. Summary of the invention
[0003] The technical problem to be solved by the present invention is to address the deficiencies of the prior art and specifically provide a method, system, electronic device and storage medium for determining the lane where a vehicle is located, as follows:
[0004] 1) In a first aspect, the present invention provides a method for determining a lane in which a vehicle is located, and the specific technical solution is as follows:
[0005] Determine, based on an image of a preset road having multiple lanes captured by a camera, position coordinates of a vanishing point of the preset road in a two-dimensional coordinate system used by the camera;
[0006] Recognize the image of the preset road with the target vehicle captured by the shooting device to obtain a rectangular recognition frame corresponding to the target vehicle;
[0007] Obtaining the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device;
[0008] Based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground are obtained, wherein the position coordinates of the two projection points are both the position coordinates in the two-dimensional coordinate system used by the shooting device, and the two preset positions are relatively located on both sides of the left-right symmetric plane of the target vehicle;
[0009] According to the position coordinates of the two projection points, the lane where the target vehicle is located is determined.
[0010] The beneficial effects of the method for determining the lane where a vehicle is located provided by the present invention are as follows:
[0011] Based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular identification frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground can be obtained. According to the position coordinates of these two projection points, the lane where the target vehicle is located can be accurately determined without the need for high computing power and low power consumption.
[0012] Based on the above solution, a method for determining a lane where a vehicle is located in the present invention can also be improved as follows.
[0013] Furthermore, based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground are obtained, including:
[0014] The position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device are spliced to obtain a spliced array;
[0015] Preprocessing the spliced array to obtain a preprocessed spliced array;
[0016] The preprocessed spliced array is input into a pre-trained deep learning model to obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground.
[0017] Furthermore, based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground are obtained, including:
[0018] The position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device are spliced to obtain a spliced array;
[0019] Preprocessing the spliced array to obtain a preprocessed spliced array;
[0020] The preprocessed spliced array is input into a pre-trained deep learning model to obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground.
[0021] Further, the concatenated array is preprocessed to obtain a preprocessed concatenated array, including:
[0022] Normalize each element in the spliced array to obtain the preprocessed spliced array.
[0023] Furthermore, the two preset positions are both located on the outer contour of the target vehicle.
[0024] 2) In a second aspect, the present invention further provides a system for determining a lane in which a vehicle is located, and the specific technical solution is as follows:
[0025] It includes a module for determining the position coordinates of a vanishing point, an image recognition module, a module for determining the position coordinates of a corner point, a module for determining the position coordinates of a projection point, and a module for determining the lane where the vehicle is located;
[0026] The module for determining the position coordinates of the vanishing point is used to determine the position coordinates of the vanishing point of the preset road in the two-dimensional coordinate system used by the shooting device according to the image of the preset road with multiple lanes shot by the shooting device;
[0027] The image recognition module is used to: recognize the image of the preset road with the target vehicle captured by the shooting device, and obtain a rectangular recognition frame corresponding to the target vehicle;
[0028] The corner point position coordinate determination module is used to: obtain the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device;
[0029] The projection point position coordinate determination module is used to: obtain the position coordinates of the projection points of two preset positions of the target vehicle on the ground respectively based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and use the trained deep learning model, wherein the position coordinates of the two projection points are both the position coordinates in the two-dimensional coordinate system used by the shooting device, and the two preset positions are relatively located on both sides of the left and right symmetric plane of the target vehicle;
[0030] The vehicle lane determination module is used to determine the lane where the target vehicle is located based on the position coordinates of the two projection points.
[0031] Based on the above solution, the system for determining the lane where a vehicle is located in the present invention can also be improved as follows.
[0032] Further, the projection point position coordinate determination module is specifically used for:
[0033] The position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device are spliced to obtain a spliced array;
[0034] Preprocessing the spliced array to obtain a preprocessed spliced array;
[0035] The preprocessed spliced array is input into a pre-trained deep learning model to obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground.
[0036] Furthermore, the projection point position coordinate determination module is specifically used to: normalize each element in the spliced array to obtain a preprocessed spliced array.
[0037] Furthermore, the two preset positions are both located on the outer contour of the target vehicle.
[0038] 3) In a third aspect, the present invention further provides an electronic device, comprising a processor, the processor being coupled to a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor, so that the electronic device implements any of the above-mentioned methods for determining the lane in which a vehicle is located.
[0039] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, any of the above-mentioned methods for determining the lane in which a vehicle is located is implemented.
[0040] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments of the present invention:
[0042] Figure 1 A schematic flow chart of a method for determining a lane in which a vehicle is located according to an embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of two preset positions in a target vehicle;
[0044] Figure 3 A schematic diagram of the structure of a system for determining a lane in which a vehicle is located according to an embodiment of the present invention;
[0045] Figure 4 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0047] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0048] like Figure 1 As shown, a method for determining a lane in which a vehicle is located in an embodiment of the present invention includes the following steps:
[0049] S1. Determine, based on an image of a preset road having multiple lanes captured by a camera, position coordinates of a vanishing point of the preset road in a two-dimensional coordinate system used by the camera;
[0050] Among them, the shooting device can be a monocular camera or other cameras, etc., and can be set according to actual conditions.
[0051] The vanishing point of the preset road can be determined in the following ways, specifically:
[0052] 1) The first method: an image of a preset road with multiple lanes captured by a camera is recognized by using a YOLO algorithm or a ViD algorithm to obtain multiple targets, all of which can be vehicles. Each target is tracked by a camera to obtain a trajectory of each target, and a straight line is fitted to the trajectory of each target to obtain multiple straight lines, and the intersection of all the straight lines is obtained to determine the vanishing point.
[0053] 2) The second method includes the following steps:
[0054] S10, preprocessing the image of the preset road with multiple lanes captured by the camera, specifically grayscale conversion and noise removal, etc., specifically:
[0055] 1) Grayscale conversion: Able to convert color images into grayscale images to reduce the amount of data processed while retaining the texture and shape information of the image.
[0056] 2) Noise removal: Use filtering technology (such as Gaussian filtering) to remove noise from the image and improve image quality.
[0057] S11. Feature extraction, specifically:
[0058] An image texture analysis method, such as a texture analysis method based on a Gabor filter, is used to calculate the texture direction of each pixel in the pre-processed image.
[0059] S12. Evaluate confidence level:
[0060] The confidence level of each pixel is calculated based on the response value of the texture direction of each pixel. Pixels with high confidence levels are more likely to represent the true road texture direction.
[0061] Among them, each pixel includes response values in one or more directions. These response values represent the texture intensity of the pixel in different directions. Since the response values of different pixels may have different magnitudes, they need to be normalized. Normalization can ensure that all response values are within a comparable range. Normalization can be achieved by dividing each response value by the maximum response value in its direction, or by other methods, such as mapping the response value to a fixed range, and then calculating the confidence level of each pixel based on the response value intensity, based on the response value consistency and the color, brightness and gradient of the pixel. Specifically, different weights can be assigned to different response value intensities, different response value consistency and different colors, different brightness and different gradients of the pixel, and the total weight of the pixel calculated is used as the confidence level.
[0062] S13. Randomly generate some candidate vanishing points in the pre-processed image. These candidate vanishing points may be at any position in the pre-processed image, or may be generated based on artificial experience.
[0063] S14, using a voting algorithm to estimate the position of the vanishing point, specifically: each pixel votes for the candidate vanishing point according to its texture direction and confidence level. The voting process may involve the setting of a local voting area and an angle threshold to ensure the accuracy and efficiency of the voting, which can be specifically achieved through a fast local adaptive soft voting (FLASV) algorithm.
[0064] S15. According to the voting result, the candidate vanishing point with the most votes is selected as the final vanishing point, that is, the vanishing point of the preset road.
[0065] Among them, the user can select a section of road as a preset road according to actual conditions.
[0066] Among them, the two-dimensional coordinate system used by the shooting device can be specifically a rectangular coordinate system, the straight line where the bottom edge of the image shot by the shooting device is located is the x-axis, and the specified position on the image shot by the shooting device is the origin. The established rectangular coordinate system, the specified position can be the center point of the image, or it can be any position on the bottom edge of the image. That is to say, the origin position can be set according to actual conditions, the straight line where the bottom edge of the image is located can be the x-axis, or the x-axis and y-axis of the rectangular coordinate system can be set according to actual conditions.
[0067] S2, identifying the image of the preset road with the target vehicle captured by the shooting device to obtain a rectangular recognition frame corresponding to the target vehicle;
[0068] Among them, when the shooting device is in a fixed position and the shooting angle of the shooting device does not change, the vanishing point of the preset road determined thereby is unchanged. When it is necessary to obtain the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device, the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device can be directly used subsequently without repeated acquisition.
[0069] Among them, when the shooting device is in a fixed position and the shooting angle of the shooting device changes, the vanishing point of the preset road determined thereby is variable, and it is necessary to redetermine the vanishing point and determine the position coordinates in the two-dimensional coordinate system used by the shooting device without repeated acquisition.
[0070] It should be noted that, during the execution of S1 and S2, the position and shooting angle of the shooting device are the same.
[0071] S3, obtaining the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device;
[0072] S4. Based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground are obtained, wherein the position coordinates of the two projection points are both the position coordinates in the two-dimensional coordinate system used by the shooting device, and the two preset positions are relatively located on both sides of the left and right symmetry plane of the target vehicle.
[0073] Among them, Figure 2 As shown, the left-right symmetric plane of the target vehicle is: a symmetric plane that makes the two rearview mirrors or two front lights of the target vehicle mirror each other. It should be noted that the left-right symmetric plane of the target vehicle is a virtual plane specified for the convenience of explanation.
[0074] Among them, the two preset positions of the target vehicle can be the two end points of the rear bumper of the target vehicle, or the center position of the rotating shaft of the front left wheel and the center position of the rotating shaft of the front right wheel of the target vehicle, or the center position of the rotating shaft of the rear left wheel and the center position of the rotating shaft of the rear right wheel of the target vehicle, which can be set according to actual conditions. Moreover, both preset positions can be located on the outer contour of the target vehicle. For example, the two preset positions of the target vehicle can be the outer edges of two rearview mirrors, etc., which can also be set according to actual conditions.
[0075] S5. Determine the lane where the target vehicle is located according to the position coordinates of the two projection points.
[0076] Optionally, in S4, based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground are obtained, including:
[0077] S40, splicing the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device to obtain a spliced array;
[0078] For ease of description, the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device are marked as (xp, yp), and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device are marked as: (x0, y0), (x1, y0), (x0, y1) and (x1, y1), and the spliced array is recorded as X:
[0079] X=(xp,yp,x0,y0,x1,y0,x0,y1,x1,y1)
[0080] S41, preprocessing the spliced array to obtain a preprocessed spliced array. Specifically, normalizing each element in the spliced array to obtain a preprocessed spliced array. The preprocessed spliced array is recorded as X ′ :
[0081]
[0082] Wherein, w represents: the width of the real width of the image captured by the camera in the two-dimensional coordinate system used by the camera, and h represents: the height of the real height of the image captured by the camera in the two-dimensional coordinate system used by the camera.
[0083] S42. Input the preprocessed spliced array into a pre-trained deep learning model to obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground.
[0084] Among them, the trained deep learning model can be a trained multi-layer perceptron, or other trained convolutional neural networks, etc. According to the actual situation, one of the deep learning network models can be selected for training to obtain a trained deep learning model.
[0085] In this embodiment, the trained deep learning model is a trained multilayer perceptron, which includes an input layer, an output layer and multiple hidden layers. The input layer is used to receive the preprocessed spliced array in the sample, and process it through each hidden layer in turn, and finally output the position coordinates of the two projection points corresponding to the preprocessed spliced array in the sample through the output layer.
[0086] Among them, multiple groups of historical position coordinates based on the vanishing point in the two-dimensional coordinate system used by the shooting device and the historical position coordinates of the four corner points of the rectangular identification frame in the two-dimensional coordinate system used by the shooting device are obtained to construct multiple historical splicing arrays, and each historical splicing array is preprocessed to determine multiple preprocessed splicing arrays, and the historical position coordinates of the two projection points corresponding to each group of preprocessed splicing arrays are obtained, and the x value in the historical position coordinates of the two projection points corresponding to each group of preprocessed splicing arrays is divided by w, and the y value is divided by h, and spliced into a coefficient array, the coefficient array is: (the value obtained by dividing the x value in the historical position coordinates of the first projection point by w, the value obtained by dividing the y value in the historical position coordinates of the first projection point by h, the value obtained by dividing the x value in the historical position coordinates of the second projection point by w, and the value obtained by dividing the y value in the historical position coordinates of the second projection point by h), thereby obtaining multiple coefficient arrays.
[0087] Any preprocessed concatenated array and the coefficient array corresponding to the preprocessed concatenated array form a sample, thereby obtaining a plurality of samples, and the multilayer perceptron is trained based on the plurality of samples to obtain a trained multilayer perceptron.
[0088] When the trained multi-layer perceptron includes two hidden layers, the data processing process of the first hidden layer in the trained multi-layer perceptron is represented by the following expression:
[0089] H1=σ(X ′ W (1) +b (1) )
[0090] H1 represents the output of the first hidden layer in the trained multi-layer perceptron, W (1) and b (1) They all represent trained parameters, and σ represents the activation function.
[0091] The data processing process of the second hidden layer in the trained multi-layer perceptron is represented by the following expression:
[0092] H2=σ(H1W (2) +b (2) )
[0093] Among them, H2 represents: the output of the second hidden layer in the trained multi-layer perceptron, W (2) and b (2) Both represent trained parameters.
[0094] The output O of the trained multilayer perceptron is:
[0095] O=H2W (3) +b(3)
[0096] Among them, W (3) and b (3) Both represent trained parameters.
[0097] According to the output O, the position coordinates of the two projection points are calculated in the following manner. Specifically, the position coordinates of the first projection point are: (O[0]×w, O[1]×h), and the position coordinates of the second projection point are: (O[2]×w, O[3]×h), where O[0] represents the value obtained by dividing the x value in the position coordinates of the first projection point by w, O[1] represents the value obtained by dividing the y value in the position coordinates of the first projection point by h, O[2] represents the value obtained by dividing the x value in the position coordinates of the second projection point by w, and O[3] represents the value obtained by dividing the y value in the position coordinates of the second projection point by h.
[0098] Then, based on the position coordinates of the two projection points, the lane where the target vehicle is located can be determined.
[0099] In another embodiment, multiple groups of historical position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the historical position coordinates of the four corner points of the rectangular identification frame in the two-dimensional coordinate system used by the shooting device are obtained to construct multiple historical stitching arrays, and each historical stitching array is preprocessed to determine multiple preprocessed stitching arrays, and the historical position coordinates of two projection points corresponding to each group of preprocessed stitching arrays are obtained.
[0100] Any preprocessed spliced array and the historical position coordinates of the two projection points corresponding to the preprocessed spliced array constitute a sample, thereby obtaining multiple samples. The multilayer perceptron is trained based on the multiple samples to obtain a trained multilayer perceptron. The trained multilayer perceptron can directly output the position coordinates of the two projection points.
[0101] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0102] like Figure 3 As shown, a vehicle lane determination system 200 according to an embodiment of the present invention includes a vanishing point position coordinate determination module 201, an image recognition module 202, a corner point position coordinate determination module 203, a projection point position coordinate determination module 204, and a vehicle lane determination module 205;
[0103] The vanishing point position coordinate determination module 201 is used to: determine the position coordinates of the vanishing point of the preset road in the two-dimensional coordinate system used by the shooting device according to the image of the preset road with multiple lanes shot by the shooting device;
[0104] The image recognition module 202 is used to: recognize the image of the preset road with the target vehicle captured by the shooting device, and obtain a rectangular recognition frame corresponding to the target vehicle;
[0105] The corner point position coordinate determination module 203 is used to: obtain the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device;
[0106] The projection point position coordinate determination module 204 is used to: obtain the position coordinates of the projection points of two preset positions of the target vehicle on the ground respectively based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and use the trained deep learning model, wherein the position coordinates of the two projection points are both position coordinates in the two-dimensional coordinate system used by the shooting device, and the two preset positions are relatively located on both sides of the left-right symmetric plane of the target vehicle;
[0107] The vehicle lane determination module 205 is used to determine the lane where the target vehicle is located according to the position coordinates of the two projection points.
[0108] Optionally, in the above technical solution, the projection point position coordinate determination module 204 is specifically used for:
[0109] The position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device are spliced to obtain a spliced array;
[0110] Preprocessing the spliced array to obtain a preprocessed spliced array;
[0111] The preprocessed spliced array is input into a pre-trained deep learning model to obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground.
[0112] Optionally, in the above technical solution, the projection point position coordinate determining module 204 is specifically used to: normalize each element in the spliced array to obtain a preprocessed spliced array.
[0113] Optionally, in the above technical solution, the two preset positions are both located on the outer contour of the target vehicle.
[0114] It should be noted that the beneficial effects of the vehicle lane determination system 200 provided in the above embodiment are the same as the beneficial effects of the vehicle lane determination method provided in the above embodiment, which will not be described in detail here. In addition, when the system provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be described in detail here.
[0115] Among them, the system for determining the lane where the vehicle is located in the present invention can be a computer program (including program code) running in a computer device. For example, the system for determining the lane where the vehicle is located in the present invention is an application software that can be used to execute the corresponding steps in the method for determining the lane where the vehicle is located in the present invention.
[0116] In some embodiments, the system for determining the lane in which the vehicle of the present invention is located can be implemented by a combination of software and hardware. As an example, the system for determining the lane in which the vehicle of the present invention is located can be a processor in the form of a hardware decoding processor, which is programmed to execute the method for determining the lane in which the vehicle of the present invention is located. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.
[0117] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The name of a module does not limit the module itself in some cases.
[0118] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the above-mentioned methods for determining the lane in which a vehicle is located is implemented. That is to say, an electronic device according to an embodiment of the present invention may include but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the method for determining the lane in which a vehicle is located shown in any embodiment of the present invention by calling the computer program.
[0119] In an alternative embodiment, an electronic device is provided, such as Figure 4 As shown, Figure 4 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0120] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0121] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 In the figure, only one thick line is used to represent the bus 4002, but this does not mean that there is only one bus or one type of bus.
[0122] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0123] The memory 4003 is used to store the application code (computer program) for executing the solution of the present invention, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.
[0124] Among them, the electronic device can also be a terminal device, and the terminal device can be any device that can install applications, including at least one of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, and a smart car device.
[0125] It should be noted that Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0126] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, any of the above methods for determining a lane in which a vehicle is located is implemented.
[0127] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0128] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes any of the above-mentioned methods for determining the lane in which the vehicle is located.
[0129] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0130] It should be understood that the flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0131] The computer-readable storage medium provided by the embodiment of the present invention may be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or component.
[0132] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0133] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.
[0134] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.
[0135] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0136] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for determining a lane in which a vehicle is located, characterized in that: include: Determine, based on an image of a preset road having multiple lanes captured by a camera, position coordinates of a vanishing point of the preset road in a two-dimensional coordinate system used by the camera; Recognize the image of the preset road with the target vehicle captured by the shooting device to obtain a rectangular recognition frame corresponding to the target vehicle; Obtaining the position coordinates of the four corner points of the rectangular identification frame in the two-dimensional coordinate system used by the shooting device; Based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular identification frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground are obtained, wherein the position coordinates of the two projection points are both position coordinates in the two-dimensional coordinate system used by the shooting device, and the two preset positions are relatively located on both sides of the left-right symmetric plane of the target vehicle; The lane where the target vehicle is located is determined according to the position coordinates of the two projection points.
2. A method for determining a lane in which a vehicle is located according to claim 1, characterized in that: Based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, the position coordinates of the projection points of the two preset positions of the target vehicle on the ground are obtained, including: splicing the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular identification frame in the two-dimensional coordinate system used by the shooting device to obtain a spliced array; Preprocessing the spliced array to obtain a preprocessed spliced array; The preprocessed spliced array is input into a pre-trained deep learning model to obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground.
3. A method for determining a lane in which a vehicle is located according to claim 2, characterized in that: Preprocessing the spliced array to obtain a preprocessed spliced array includes: Each element in the spliced array is normalized to obtain the preprocessed spliced array.
4. A method for determining a lane in which a vehicle is located according to any one of claims 1 to 3, characterized in that: The two preset positions are both located on the outer contour of the target vehicle.
5. A system for determining a lane in which a vehicle is located, characterized in that: It includes a module for determining the position coordinates of a vanishing point, an image recognition module, a module for determining the position coordinates of a corner point, a module for determining the position coordinates of a projection point, and a module for determining the lane where the vehicle is located; The module for determining the position coordinates of the vanishing point is used to: determine the position coordinates of the vanishing point of the preset road in the two-dimensional coordinate system used by the shooting device according to the image of the preset road with multiple lanes shot by the shooting device; The image recognition module is used to: recognize the image of the preset road with the target vehicle captured by the shooting device to obtain a rectangular recognition frame corresponding to the target vehicle; The corner point position coordinate determination module is used to: obtain the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device; The projection point position coordinate determination module is used to: based on the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular recognition frame in the two-dimensional coordinate system used by the shooting device, and using the trained deep learning model, obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground, wherein the position coordinates of the two projection points are both position coordinates in the two-dimensional coordinate system used by the shooting device, and the two preset positions are relatively located on both sides of the left-right symmetric plane of the target vehicle; The vehicle lane determination module is used to determine the lane where the target vehicle is located according to the position coordinates of the two projection points.
6. A vehicle lane determination system according to claim 5, characterized in that: The projection point position coordinate determination module is specifically used for: splicing the position coordinates of the vanishing point in the two-dimensional coordinate system used by the shooting device and the position coordinates of the four corner points of the rectangular identification frame in the two-dimensional coordinate system used by the shooting device to obtain a spliced array; Preprocessing the spliced array to obtain a preprocessed spliced array; The preprocessed spliced array is input into a pre-trained deep learning model to obtain the position coordinates of the projection points of the two preset positions of the target vehicle on the ground.
7. A vehicle lane determination system according to claim 6, characterized in that: The projection point position coordinate determination module is specifically used to normalize each element in the spliced array to obtain the preprocessed spliced array.
8. A system for determining a lane in which a vehicle is located according to any one of claims 5 to 7, characterized in that: The two preset positions are both located on the outer contour of the target vehicle.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method for determining a lane in which a vehicle is located as described in any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for determining the lane in which a vehicle is located according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Vehicle reverse positioning method based on monocular vision and utilizing road lane lines
CN112819711A
Three-dimensional reconstruction method for vehicle target in road scene based on monocular vision
CN113129348A
Novel monocular vision 3D target detection method based on key point constraint
CN115205654A
Vehicle bottom boundary point determination method and device, roadside equipment and cloud control platform
CN113034484A
Vehicle visual perception method and device, electronic equipment and storage medium
CN115761678A