Ranging method and device, computer equipment, storage medium and program product
By generating a line of sight angle encoding feature map and combining it with a neural network model, the problem of inaccurate lateral distance measurement between obstacles and the vehicle in traditional ranging methods is solved, significantly improving the ranging accuracy and safety of the intelligent driving system.
Patent Information
- Application Number
- CN202410296337.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2025-09-23
AI Technical Summary
Traditional ranging technology based on deep learning methods cannot accurately predict the lateral distance between obstacles and the vehicle, resulting in large ranging errors and affecting the safety of intelligent driving systems.
By acquiring the obstacle image, using the predetermined correspondence between pixel coordinates and image acquisition device coordinates and image resolution, a sight angle coding feature map is generated to characterize the sight angle information of each pixel point, and combined with the neural network model to determine the target distance between the target vehicle and the obstacle.
The accuracy of distance measurement between obstacles and the vehicle has been significantly improved, especially the mean absolute error of lateral distance has been increased by more than 50%, thus improving driving safety in intelligent driving scenarios.
Smart Images

Figure CN120689834A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of measurement technology, and in particular to a distance measurement method, apparatus, computer equipment, storage medium, and program product. Background Art
[0002] With the rapid development of in-vehicle intelligence, the use of intelligent driving systems is becoming increasingly widespread in the automotive field. Intelligent driving systems can acquire images of the vehicle's surroundings to accurately predict the horizontal and vertical positions of dynamic and static traffic obstacles within the vehicle's travel area in the vehicle's coordinate system. This is the visual obstacle ranging task in intelligent driving systems.
[0003] In traditional technology, deep learning methods are usually used to extract features from images around the vehicle to obtain the distance between obstacles and the vehicle.
[0004] However, the distance between the obstacle and the ego vehicle obtained using traditional techniques is inaccurate. Summary of the Invention
[0005] Based on this, it is necessary to provide a distance measurement method, device, computer equipment, storage medium and program product that can improve the accuracy of the distance between the obstacle and the vehicle to address the above technical problems.
[0006] In a first aspect, the present application provides a ranging method, the method comprising:
[0007] Acquire an image to be processed; the image to be processed includes obstacles;
[0008] Determining a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is used to represent sight angle information corresponding to each pixel point in the image to be processed;
[0009] A target distance between a target vehicle and an obstacle is determined according to the sight angle coding feature map and the image to be processed.
[0010] In a second aspect, the present application further provides a distance measuring device, comprising:
[0011] An acquisition module is used to acquire an image to be processed, wherein the image to be processed includes obstacles;
[0012] A determination module is configured to determine a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is configured to represent sight angle information corresponding to each pixel point in the image to be processed;
[0013] The determination module is further used to determine the target distance between the target vehicle and the obstacle based on the sight angle encoding feature map and the image to be processed.
[0014] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in the first aspect.
[0015] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is used to implement the steps of the method provided in the first aspect above.
[0016] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, is used to implement the steps of the method provided in the first aspect above.
[0017] The aforementioned distance measurement method, apparatus, computer device, storage medium, and program product obtain an image to be processed, the image including an obstacle; determine a sight angle encoding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and the image resolution of the image to be processed. The sight angle encoding feature map is used to represent the sight angle information corresponding to each pixel in the image to be processed; and determine the target distance between the target vehicle and the obstacle based on the sight angle encoding feature map and the image to be processed. In this embodiment, the sight angle encoding feature map is obtained based on the first correspondence and the image resolution of the image to be processed. The sight angle encoding feature map carries the sight angle information and the position information of each pixel. Such a sight angle encoding feature map can represent three-dimensional position information. Using this sight angle encoding feature map and the image to be processed to determine the target distance between the target vehicle and the obstacle can significantly improve the accuracy of the determined target distance, particularly by increasing the mean absolute error (MAE) of the lateral distance between the target vehicle and the obstacle by more than 50%. This effectively addresses the problem of obstacles mistakenly intruding into the vehicle where the target vehicle is located due to abnormal lateral distance in intelligent driving scenarios, thereby improving driving safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A bird's-eye view of the distance between an obstacle and a driving vehicle in one embodiment;
[0019] Figure 2 A schematic diagram of an application environment of a distance measurement method according to an embodiment;
[0020] Figure 3 1. A schematic flow chart of steps of a distance measurement method according to an embodiment;
[0021] Figure 4 A schematic flow chart of steps of a distance measurement method according to another embodiment;
[0022] Figure 5 A schematic flow chart of steps of a distance measurement method according to another embodiment;
[0023] Figure 6 is a schematic diagram of the relationship between the sight angle and the horizontal and vertical positions in one embodiment;
[0024] Figure 7 A schematic flow chart of steps of a distance measurement method according to another embodiment;
[0025] Figure 8 A schematic flow chart of steps of a distance measurement method according to another embodiment;
[0026] Figure 9 A schematic flow chart of steps of a distance measurement method according to another embodiment;
[0027] Figure 10 Schematic diagram of the structure of a distance measuring device in one embodiment;
[0028] Figure 11 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0030] The serial numbers assigned to the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.
[0031] First of all, before specifically introducing the technical solutions of the disclosed embodiments of the present application, the background technology or technical evolution context on which the embodiments of the present application are based is introduced. With the rapid development of vehicle-mounted intelligence, the use of intelligent driving systems in the automotive field is becoming more and more widespread. The intelligent driving system can obtain images around the vehicle to accurately predict the horizontal and vertical positions of dynamic and static traffic obstacles in the vehicle's driving area in the vehicle's coordinate system, that is, the visual obstacle ranging task in the intelligent driving system, which belongs to the field of intelligent driving visual obstacle perception algorithms. The current industry generally adopts a ranging solution based on deep learning, that is, first extracting the deep neural network features of the image around the vehicle, and then directly regressing the target distance. However, this can only effectively capture the two-dimensional appearance information such as the edge and texture of the obstacle, and cannot well represent the three-dimensional position information, so it is impossible to accurately predict the lateral position of the obstacle in the edge area of the image. A bird's-eye view of the distance between the obstacle and the driving vehicle is shown in the figure below. Figure 1 As shown, there is an obstacle B in front of the vehicle, and an obstacle A at the edge of the image. Through the camera imaging principle that objects appear larger when near and smaller when far away, a relatively accurate radial distance between the vehicle and the obstacle can be obtained. For obstacle B, which is almost in the middle of the image, the radial distance between the vehicle and obstacle B is equal to the longitudinal distance between the vehicle and obstacle B. The lateral distance between the vehicle and obstacle B can be obtained through post-processing. However, for obstacle A, due to a certain line of sight angle, the radial distance between the vehicle and obstacle A is not equal to the longitudinal distance between the vehicle and obstacle A. There is no way to obtain the lateral distance between the vehicle and obstacle A by decomposing the radial distance, which leads to a large ranging error. In this regard, the present application provides a ranging method that can improve ranging accuracy.
[0032] The following describes in detail the technical solution of the present application and how the technical solution of the present application solves the technical problem with specific embodiments.
[0033] The distance measurement method provided by this application can be applied as follows: Figure 2 In the system architecture shown, the system architecture includes an on-board terminal 101 and an external terminal 102. The on-board terminal 101 can be an automatic driving system of the driving vehicle or an electronic device installed on the driving vehicle. The external terminal 102 can be a computer device, a tablet computer, a server, etc. The on-board terminal 101 is provided with a communication component and can communicate with the external terminal 102 in a wireless manner. The ranging method provided in this application can be executed using the on-board terminal 101, the ranging method provided in this application can be executed using the external terminal 102, and the ranging method provided in this application can also be executed through the interaction between the on-board terminal 101 and the external terminal 102.
[0034] In one embodiment, Figure 3 As shown, a distance measurement method is provided. This embodiment uses the method applied to a vehicle-mounted terminal as an example. In this embodiment, the method includes the following steps:
[0035] Step 300: Acquire an image to be processed; the image to be processed includes obstacles.
[0036] The image to be processed refers to the image surrounding the target vehicle. This can be images in front of the target vehicle, behind the target vehicle, to the left of the target vehicle, or to the right of the target vehicle. The image to be processed includes obstacles, such as pedestrians, other motor vehicles, non-motor vehicles, and cones around the target vehicle.
[0037] The target vehicle is equipped with multiple image acquisition devices, which can capture images of the target vehicle's surroundings, i.e., the images to be processed. After acquiring the images to be processed, the image acquisition devices transmit them to the vehicle-mounted terminal. The image acquisition devices in the target vehicle can be cameras. The image acquisition device located in front of the target vehicle can capture images in front of the target vehicle; the image acquisition device located behind the target vehicle can capture images behind the target vehicle; the image acquisition device located to the left of the target vehicle can capture images on the left side of the target vehicle; and the image acquisition device located to the right of the target vehicle can capture images on the right side of the target vehicle.
[0038] In an optional embodiment, the image to be processed may also include a partial area of the target vehicle, that is, the image acquisition device set in the target vehicle can capture a partial image of the target vehicle within the acquisition range of the image acquisition device, as well as images of obstacles within the acquisition range of the image acquisition device.
[0039] Step 310: Determine a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is used to characterize sight angle information corresponding to each pixel point in the image to be processed.
[0040] The image resolution of the image to be processed can be determined by an image acquisition device that acquires the image to be processed. That is, after the various configuration information of the image acquisition device is determined, the resolution of the image captured by the image acquisition device, i.e., the resolution of the image to be processed, can be determined. The image resolution of the image to be processed can also be determined based on the acquired image to be processed. That is, after acquiring the image to be processed captured by the image acquisition device, the vehicle-mounted terminal analyzes and processes the image to be processed to determine the image resolution of the image to be processed. This embodiment does not limit the method for acquiring the image resolution of the image to be processed, as long as its function can be achieved.
[0041] Pixel coordinates refer to the coordinates of each pixel in an image within a pixel coordinate system. Image acquisition device coordinates refer to the three-dimensional coordinates within the image acquisition device coordinate system, i.e., the three-dimensional coordinates within a coordinate system with the optical center of the image acquisition device as the coordinate origin and the optical axis as the Z axis. The first correspondence between pixel coordinates and image acquisition device coordinates may be pre-stored in the vehicle-mounted terminal.
[0042] Based on the predetermined first correspondence between pixel coordinates and image acquisition device coordinates, as well as the image resolution of the image to be processed, the vehicle-mounted terminal can obtain a line-of-sight angle encoding feature map representing the line-of-sight angle information corresponding to each pixel in the image to be processed. In other words, each pixel in the line-of-sight angle encoding feature map carries line-of-sight angle information.
[0043] Step 320: Determine the target distance between the target vehicle and the obstacle based on the sight angle coding feature map and the image to be processed.
[0044] After obtaining the sight angle coding feature map, the vehicle-mounted terminal determines the target distance between the target vehicle and the obstacle based on the sight angle coding feature map and the image to be processed. The target distance between the target vehicle and the obstacle includes the lateral distance between the target vehicle and the obstacle, that is, the distance between the target vehicle and the obstacle in the first direction, and the longitudinal distance between the target vehicle and the obstacle, that is, the distance between the target vehicle and the obstacle in the second direction. The first and second directions are perpendicular to each other.
[0045] In an optional embodiment, a pre-trained neural network model is pre-stored in the vehicle terminal. After obtaining the sight angle coding feature map and the image to be processed, the vehicle terminal inputs the sight angle coding feature map and the image to be processed into the neural network model. The sight angle coding feature map and the image to be processed are detected by the neural network model, and the target distance between the target vehicle and the obstacle can be obtained.
[0046] The distance measurement method provided in an embodiment of the present application obtains a to-be-processed image, which includes an obstacle; determines a sight angle encoding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and the image resolution of the to-be-processed image; the sight angle encoding feature map is used to represent the sight angle information corresponding to each pixel in the to-be-processed image; and determines the target distance between a target vehicle and the obstacle based on the sight angle encoding feature map and the to-be-processed image. In this embodiment, the sight angle encoding feature map is obtained based on the first correspondence and the image resolution of the to-be-processed image. The sight angle encoding feature map carries the sight angle information and the position information of each pixel. Such a sight angle encoding feature map can represent three-dimensional position information. Using this sight angle encoding feature map and the to-be-processed image to determine the target distance between the target vehicle and the obstacle can significantly improve the accuracy of the determined target distance, particularly by increasing the mean absolute error (MAE) of the lateral distance between the target vehicle and the obstacle by more than 50%. This effectively solves the problem of obstacles mistakenly intruding into the vehicle where the target vehicle is located due to abnormal lateral distance in intelligent driving scenarios, thereby improving driving safety. Furthermore, the ranging method provided by this embodiment has low computational overhead, is easy to deploy, is scalable, and has high practicality.
[0047] In one embodiment, Figure 4As shown, an implementation method of determining a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and the image resolution of the image to be processed is provided, and the steps of the implementation method include:
[0048] Step 400: Determine the target pixel coordinates of each pixel in the image to be processed based on the image resolution of the image to be processed.
[0049] After determining the image resolution of the image to be processed, the vehicle terminal can determine each pixel in the image to be processed and the target pixel coordinates of each pixel based on the image resolution. The target pixel coordinates of each pixel refer to the coordinate value of each pixel in the pixel coordinate system.
[0050] The origin of the pixel coordinate system is the point in the upper left corner of the image to be processed. The horizontal coordinate u of the pixel represents the column number in the image array of the image to be processed, and the vertical coordinate v of the pixel represents the row number in the pixel group of the image to be processed.
[0051] Step 410: Determine the target image acquisition device coordinates corresponding to each target pixel coordinate based on the first corresponding relationship.
[0052] After determining the target pixel coordinates for each pixel in the image to be processed, the vehicle-mounted terminal can determine the target image acquisition device coordinates corresponding to each target pixel coordinate based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates. For each target pixel coordinate, the vehicle-mounted terminal searches the first correspondence for the pixel coordinate closest to the target pixel coordinate and determines the image acquisition device coordinate corresponding to the closest pixel coordinate as the target image acquisition device coordinate.
[0053] Step 420: Determine the sight angle coding feature map according to the target pixel coordinates and the target image acquisition device coordinates.
[0054] After determining the target pixel coordinates and target image acquisition device coordinates of the image to be processed, the on-board terminal can determine the sight angle coding feature map corresponding to the image to be processed based on the target pixel coordinates and target image acquisition device coordinates. The target image acquisition device coordinates are the position coordinates corresponding to each sight direction corresponding to the image to be processed, that is, the sight angle coding information. In other words, the on-board terminal adds sight angle coding information to each pixel point in the image to be processed based on the target pixel coordinates and target image acquisition device coordinates, that is, the image acquisition device coordinates corresponding to the target pixel coordinates of the pixel point, to obtain the sight angle coding feature. The image to be processed is a two-dimensional image, and after adding the sight angle coding information to each pixel point in the image to be processed, the sight angle coding feature map obtained is a three-dimensional image.
[0055] In this embodiment, the vehicle-mounted terminal determines the target image acquisition device coordinates corresponding to the target pixel coordinates of each pixel in the image to be processed based on a first correspondence between pixel coordinates and image acquisition device coordinates. Based on the target pixel coordinates and the target image acquisition device coordinates, the vehicle-mounted terminal can add sight angle coding information to each pixel in the image to be processed, thereby generating a sight angle coding feature map containing three-dimensional position information. This method for determining the sight angle coding feature map is quick and easy to implement, and can improve the practicality of the ranging method.
[0056] The first correspondence between the pixel coordinates and the image acquisition device coordinates may be predetermined and stored in the vehicle-mounted terminal, or may be determined by the vehicle-mounted terminal during the execution of the distance measurement method. Figure 5 As shown, an implementation method for determining a first correspondence between pixel coordinates and image acquisition device coordinates includes the following steps:
[0057] Step 500: Obtain configuration information of the image acquisition device; the configuration information includes the field of view angle and the line of sight angle sampling interval.
[0058] The configuration information of the image acquisition device can be pre-set by the user based on the actual application scenario. The configuration information may include the field of view (FOV) and the line of sight sampling interval. The field of view refers to the field of view of the image acquisition device, and the line of sight sampling interval refers to the pre-set sampling interval when sampling the line of sight within the field of view. The field of view and line of sight sampling interval can be flexibly set according to the actual application scenario. This embodiment does not impose any restrictions on the field of view and line of sight sampling interval, as long as its function can be achieved.
[0059] The vehicle-mounted terminal obtains configuration information for an already configured image acquisition device, or obtains configuration information for an image acquisition device after an update. In other words, the configuration information for the image acquisition device obtained by the vehicle-mounted terminal is the configuration information for the image acquisition device when it was capturing the image to be processed. This embodiment does not limit the specific method for obtaining the configuration information for the image acquisition device; as long as the method can achieve the desired function, the method will be sufficient.
[0060] In an optional embodiment, the method for the vehicle-mounted terminal to obtain the configuration information of the image acquisition device includes: the vehicle-mounted terminal directly obtains the configuration information from the image acquisition device when needed.
[0061] In another optional embodiment, the method for the vehicle-mounted terminal to obtain the configuration information of the image acquisition device also includes: after the configuration information of the image acquisition device is set, the image acquisition device sends the set configuration information to the vehicle-mounted terminal and stores it in the storage device of the vehicle-mounted terminal; the vehicle-mounted terminal directly obtains the configuration information from the storage device when needed.
[0062] Step 510: Sampling is performed within the field of view angle according to the viewing angle sampling interval to obtain a set of horizontal and vertical viewing angles.
[0063] The field of view of an image acquisition device includes a horizontal field of view angle and a vertical field of view angle. After obtaining the configuration information of the image acquisition device, namely the field of view angle and the sight angle acquisition interval, the vehicle terminal samples within the field of view according to the sight angle acquisition interval to obtain multiple sight angles, namely the horizontal sight angle and the vertical sight angle, thereby forming a set of horizontal and vertical sight angles.
[0064] Assume that the image acquisition device has a field of view of 120 degrees, with both the horizontal and vertical field of view angles ranging from -60 degrees to 60 degrees, and a sight angle sampling interval of 0.1. The vehicle terminal samples the horizontal and vertical field of view angles according to the sight angle sampling interval, obtaining multiple horizontal and vertical sight angles, thereby forming a set of horizontal and vertical sight angles.
[0065] Step 520: Determine the image acquisition device coordinates corresponding to each viewing direction based on the set of horizontal and vertical viewing angles and the second correspondence between the viewing angles and the horizontal and vertical positions.
[0066] The second correspondence between the sight angle and the horizontal and vertical positions may be pre-stored in the vehicle-mounted terminal. The sight angle includes a horizontal sight angle and a vertical sight angle. The second correspondence between the sight angle and the horizontal and vertical positions includes a horizontal correspondence between the horizontal sight angle and the horizontal position, and a vertical correspondence between the vertical sight angle and the vertical position. A horizontal sight angle and a vertical sight angle form a sight direction.
[0067] After obtaining the set of horizontal and vertical viewing angles, the vehicle-mounted terminal can obtain multiple viewing directions based on the set of horizontal and vertical viewing angles. According to the second correspondence between the viewing angles and the horizontal and vertical positions, the horizontal and vertical positions corresponding to each viewing direction can be determined, that is, the coordinates of the image acquisition device.
[0068] In one embodiment, an implementation method for determining the image acquisition device coordinates corresponding to each viewing direction based on a set of horizontal and vertical viewing angles and a second correspondence between the viewing angles and the horizontal and vertical positions includes:
[0069] Traverse the set of horizontal and vertical sight angles, and determine the image acquisition device coordinates corresponding to each sight direction based on the horizontal correspondence between the horizontal sight angle and the horizontal position, and the vertical correspondence between the vertical sight angle and the vertical position.
[0070] The vehicle-mounted terminal device sets the coordinate value of the Z axis in the image acquisition device coordinates to a preset value, traverses the lateral sight angle and the longitudinal sight angle in the lateral and longitudinal sight angle sets, and determines the lateral position corresponding to the lateral sight angle according to the lateral correspondence in the lateral sight angle and the second correspondence, that is, the coordinate value of the X axis in the image acquisition device coordinates; and determines the longitudinal position corresponding to the longitudinal sight angle according to the longitudinal correspondence in the second correspondence, that is, the coordinate value of the Y axis in the image acquisition device coordinates, thereby obtaining the image acquisition device coordinates corresponding to the sight direction formed by the lateral sight angle and the longitudinal sight angle.
[0071] In an optional embodiment, the relationship between the sight angle and the horizontal and vertical positions is shown as follows: Figure 6 As shown, Figure 6 The quadrilateral surrounded by the dotted line is the image to be processed acquired by the image acquisition device, and A is the obstacle in the image to be processed. Assume that the coordinate value of the Z axis in the image acquisition device coordinate is z=1, and the horizontal viewing angle is The coordinate value of the X axis in the image acquisition device coordinate can be expressed as x=z*tan =1*tan =tan Similarly, the vertical sight angle is , the Y-axis coordinate value in the image acquisition device coordinate can be expressed as y=z*tan =1*tan =tan .
[0072] In this embodiment, by directly traversing the set of horizontal and vertical sight angles, based on the second correspondence between the sight angles and the horizontal and vertical positions, the horizontal and vertical positions corresponding to the sight direction formed by the horizontal sight angles and the vertical sight angles in the set of horizontal and vertical sight angles, i.e., the coordinates of the image acquisition device, can be determined. This method of determining the coordinates of the image acquisition device is quick and easy to implement.
[0073] Step 530: Project the image acquisition device coordinates onto a two-dimensional plane to obtain a first corresponding relationship between the pixel coordinates and the image acquisition device coordinates.
[0074] After obtaining the image acquisition device coordinates, the vehicle-mounted terminal projects the image acquisition device onto a two-dimensional plane. The two-dimensional plane includes pixel coordinates, thereby obtaining a first correspondence between the pixel coordinates and the image acquisition device coordinates. The two-dimensional plane may be the plane where the image to be processed is located.
[0075] In this embodiment, by obtaining the field of view angle and the line of sight angle sampling interval of the image acquisition device, sampling is performed within the field of view angle according to the line of sight angle sampling interval to obtain a set of horizontal and vertical line of sight angles; based on the set of horizontal and vertical line of sight angles and the second correspondence between the preset line of sight angles and the horizontal and vertical positions, the image acquisition device coordinates corresponding to each line of sight direction are determined; the image acquisition device coordinates are projected into a two-dimensional plane to obtain a first correspondence between the pixel coordinates and the image acquisition device coordinates; this method of determining the first correspondence is quick and easy to implement, and the obtained first correspondence between the pixel coordinates and the image acquisition device coordinates is more accurate.
[0076] In one embodiment, the configuration information of the image acquisition device obtained by the vehicle-mounted terminal also includes: the internal parameters and distortion parameters of the image acquisition device. The internal parameters of the image acquisition device may include fx, fy, u0, and v0. fx=f / dx, fy=f / dy; f is the focal length of the image acquisition device, dx and dy represent the length units occupied by a pixel in the x-direction and y-direction respectively, that is, the size of the actual physical value represented by a pixel; u0 and v0 represent the horizontal and vertical pixel numbers and the vertical pixel numbers that differ between the pixel coordinates of the image center and the pixel coordinates of the image origin respectively. The distortion parameters of the image acquisition device include radial distortion parameters and tangential distortion parameters. The radial distortion parameters include k1, k2, and k3, and the tangential distortion parameters include p1 and p2.
[0077] In the case where the configuration information includes the intrinsic parameters and distortion parameters of the image acquisition device, such as Figure 7 As shown, an implementation method involves projecting the image acquisition device coordinates into a two-dimensional plane to obtain a first correspondence between the pixel coordinates and the image acquisition device coordinates, and the steps of the implementation method include:
[0078] Step 700: Dedistort the image acquisition device coordinates according to the distortion parameters to obtain processed image acquisition device coordinates.
[0079] After obtaining the distortion parameters of the image acquisition device, the vehicle-mounted terminal performs dedistortion processing on the coordinates of the image acquisition device according to the distortion parameters to obtain processed coordinates of the image acquisition device.
[0080] Assuming that the coordinates of the image acquisition device are (x, y, z), when the vehicle terminal performs dedistortion processing on the coordinates of the image acquisition device, it first calculates the distortion amount based on the distortion parameters and the coordinates of the image acquisition device. and . Distortion It can be expressed as: , distortion It can be expressed as: ; Where r is the preset de-distortion parameter. The coordinate value on the X axis of the image acquisition device coordinate after de-distortion processing , the coordinate value on the Y axis in the image acquisition device coordinate after dedistortion processing , then the coordinates of the image acquisition device after dedistortion processing are ( , , z).
[0081] Step 710: Project the processed image acquisition device coordinates onto a two-dimensional plane according to the internal reference to obtain a first corresponding relationship.
[0082] After obtaining the processed image acquisition device coordinates, the vehicle-mounted terminal projects the processed image acquisition device coordinates into a two-dimensional plane according to the internal parameters of the image acquisition device, that is, converts the processed image acquisition device coordinates into a pixel coordinate system, and thus obtains the correspondence between the pixel coordinates and the image acquisition device.
[0083] The processed image acquisition device coordinates are converted into the pixel coordinate system and can be expressed as: , .
[0084] In this embodiment, before determining the first correspondence between the image acquisition device coordinates and the pixel coordinates, the image acquisition device coordinates are first dedistorted according to the distortion parameters of the image acquisition device to obtain processed image acquisition device coordinates. This allows for more accurate image acquisition device coordinates. The processed image acquisition device coordinates are then projected onto a two-dimensional plane to obtain the first correspondence, which provides a more accurate first correspondence.
[0085] In one embodiment, Figure 8 As shown, an implementation method for determining the target distance between a target vehicle and an obstacle based on a sight angle coding feature map and an image to be processed includes the following steps:
[0086] Step 800: Fusing the sight angle coding feature map and the image to be processed to obtain fusion information.
[0087] After obtaining the sight angle coding feature map, the vehicle-mounted terminal fuses the sight angle coding feature map with the image to be processed to obtain fused information. Different fusion processes for fusing the sight angle coding feature map and the image to be processed result in different fused information. This embodiment does not limit the specific method for fusing the sight angle coding feature map and the image to be processed; as long as the function is achieved, it can be used.
[0088] In an optional embodiment, a fusion model is pre-stored in the vehicle terminal. After obtaining the sight angle coding feature map and the image to be processed, the vehicle terminal inputs the sight angle coding feature map and the image to be processed into the fusion model. The sight angle coding feature map and the image to be processed are fused by the fusion model to obtain fusion information.
[0089] Step 810: Determine the target distance based on the fused information.
[0090] After obtaining the fused information, the vehicle terminal determines the target distance based on the fused information. The fused information includes three-dimensional position information that can represent the obstacle in the image to be processed, and two-dimensional position information that can represent the obstacle in the image to be processed.
[0091] In one embodiment, a method for determining a target distance based on fused information includes:
[0092] The fused information is input into the distance determination model to obtain the target distance.
[0093] The distance determination model can be pre-trained and stored in the vehicle terminal. After obtaining the fused information, the vehicle terminal inputs it into the distance determination model. The distance determination model then detects the fused information to determine the target distance between the target vehicle and the obstacle. This direct determination of the target distance based on the distance determination model improves the efficiency of determining the target distance.
[0094] In this embodiment, the vehicle-mounted terminal obtains fusion information by fusing the line of sight angle coding feature map that can represent the three-dimensional position information of the image to be processed and the image to be processed that can represent the two-dimensional position information of the image to be processed; and determines the target distance based on the fusion information, which can improve the accuracy of the determined target distance.
[0095] In one embodiment, the fusion information includes fusion features, such as Figure 9 As shown, a method for fusing the sight angle coding feature map and the image to be processed to obtain fusion information involves the following steps:
[0096] Step 900: extract features from the sight angle coding feature map and the image to be processed respectively to obtain sight angle features and image features.
[0097] After acquiring the image to be processed, the vehicle-mounted terminal performs feature extraction on the image to obtain image features. After acquiring the sight angle coding feature map, the vehicle-mounted terminal performs feature extraction on the sight angle coding feature map to obtain sight angle features. The feature extraction methods for the sight angle coding feature map and the image to be processed can be the same or different, and this embodiment does not impose any restrictions on this method; as long as the functions are achieved, the method can be used.
[0098] In an optional embodiment, a first feature extraction model and a second feature extraction model are pre-stored in the vehicle terminal. The vehicle terminal inputs the sight angle encoding feature map into the first feature extraction model, and uses the first feature extraction model to extract features from the sight angle encoding feature map to obtain sight angle features. The vehicle terminal inputs the image to be processed into the second feature extraction model, and uses the second feature extraction model to extract features from the image to obtain image features.
[0099] Step 910: Perform feature fusion processing on the image features and the sight angle features to obtain fused features.
[0100] After obtaining the image features corresponding to the image to be processed and the sight angle features corresponding to the sight angle coding feature map, the on-board terminal performs feature fusion processing on the image features and the sight angle coding features to obtain fused features.
[0101] In one optional embodiment, a feature fusion model is pre-stored in the vehicle terminal. After obtaining image features and sight angle features, the vehicle terminal inputs the image features and sight angle features into the feature fusion model, which then concatenates or adds the image features and sight angle features to obtain fused features. Optionally, several convolutional neural network (CNN) layers can be added after the feature fusion model to perform adaptive feature fusion through the CNN layers, making the resulting fused features more accurate, thereby improving the accuracy of target distance determined based on the fused features. Furthermore, structures such as a channel attention mechanism can be incorporated into the feature fusion model to further improve the fusion performance of the feature fusion model and enhance the accuracy of the resulting fused features.
[0102] In this embodiment, feature extraction is performed on the gaze angle encoding feature map and the image to be processed to obtain gaze angle features and image features. The image features and gaze angle features are then fused to obtain fused features. The target distance is then determined based on the fused features. This fused feature is more accurate, thereby improving the accuracy of the determined target distance.
[0103] In one embodiment, the fusion information includes a fusion image, which involves fusing the sight angle encoding feature map and the image to be processed to obtain an implementation method of the fusion information, the implementation method including:
[0104] The sight angle encoding feature map and the image to be processed are channel-joined to obtain a fused image.
[0105] After obtaining the sight angle coding feature map and the image to be processed, the vehicle terminal directly performs image-level fusion processing on the sight angle coding feature map and the image to be processed, that is, performs channel splicing processing on the two images to obtain a fused image.
[0106] In an optional embodiment, an image fusion model is pre-stored in the vehicle terminal. After obtaining the sight angle coding feature image and the image to be processed, the vehicle terminal inputs the sight angle coding feature image and the image to be processed into the image fusion model. The image fusion model then performs channel splicing on the sight angle coding feature image and the image to be processed to obtain a fused image. In other words, the sight angle coding feature image is a 3-channel image, and the image to be processed is a 2-channel image. After performing channel splicing on the sight angle coding feature image and the image to be processed, a 5-channel fused image is obtained.
[0107] In this embodiment, channel splicing processing is directly performed on the sight angle encoding feature map and the image to be processed to obtain fusion information. This method of obtaining fusion information is fast and easy to implement, thereby improving the efficiency of determining the target distance.
[0108] When the fusion information includes a fused image, one implementation of determining the target distance based on the fusion information includes:
[0109] The fused image is subjected to feature extraction to obtain fused features; the fused features are detected to obtain the target distance.
[0110] The vehicle terminal extracts features from the fused image using a pre-stored feature extraction model, fuses the features, and detects the fused image using a pre-stored detection model to obtain the target distance.
[0111] In an optional embodiment, the vehicle-mounted terminal can also identify obstacles in the image to be processed and determine the category of the obstacle by detecting the fused information; the detection of the fused information can also obtain the two-dimensional position information of the obstacle, the three-dimensional position information of the obstacle, the orientation angle of the obstacle, the size of the obstacle, etc.
[0112] In one embodiment, the present application provides a ranging method, the steps of which include:
[0113] S1. Acquire an image to be processed, where the image to be processed includes obstacles;
[0114] S2. Obtain configuration information of the image acquisition device; the configuration information includes the field of view angle, line of sight angle sampling interval, internal parameters of the image acquisition device, and distortion parameters;
[0115] S3. Sampling is performed within the field of view according to the sight angle sampling interval to obtain a set of horizontal and vertical sight angles;
[0116] S4. Fix the coordinate value on the Z axis in the image acquisition device coordinates to 1, traverse the set of horizontal and vertical sight angles, and determine the image acquisition device coordinates corresponding to each sight direction based on the horizontal correspondence between the horizontal sight angle and the horizontal position, and the vertical correspondence between the vertical sight angle and the vertical position;
[0117] S5. Dedistorting the image acquisition device coordinates according to the distortion parameters to obtain processed image acquisition device coordinates;
[0118] S6. Projecting the processed image acquisition device coordinates onto a two-dimensional plane according to the internal reference to obtain a first correspondence between the pixel coordinates and the image acquisition device coordinates;
[0119] S7. Determine the target pixel coordinates of each pixel in the image to be processed based on the image resolution of the image to be processed; and determine the target image acquisition device coordinates corresponding to each target pixel coordinate based on the first corresponding relationship;
[0120] S8. Determine a sight angle coding feature map based on the target pixel coordinates and the target image acquisition device coordinates; the sight angle coding feature map is used to represent the sight angle information corresponding to each pixel in the image to be processed;
[0121] S9, performing feature extraction on the sight angle coding feature map and the image to be processed respectively to obtain sight angle features and image features; performing feature fusion processing on the image features and the sight angle features to obtain fusion features;
[0122] S10: Detect the fused features to obtain the target distance between the target vehicle and the obstacle.
[0123] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0124] Based on the same inventive concept, embodiments of the present application further provide a distance measuring device for implementing the aforementioned distance measuring method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more distance measuring device embodiments provided below can be found in the limitations of the distance measuring method described above and will not be further elaborated here.
[0125] In one embodiment, Figure 10 As shown, a distance measuring device 10 is provided, comprising: an acquisition module 11 and a determination module 12, wherein:
[0126] The acquisition module 11 is used to acquire the image to be processed; the image to be processed includes obstacles.
[0127] The determination module 12 is used to determine a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and the image resolution of the image to be processed; the sight angle coding feature map is used to characterize the sight angle information corresponding to each pixel point in the image to be processed.
[0128] The determination module 12 is further configured to determine a target distance between the target vehicle and the obstacle based on the sight angle coding feature map and the image to be processed.
[0129] In one embodiment, the determination module 12 includes a first coordinate determination unit, a second coordinate determination unit, and a sight angle coding feature map determination unit. The first coordinate determination unit is configured to determine the target pixel coordinates of each pixel point in the image to be processed based on the image resolution of the image to be processed; the second coordinate determination unit is configured to determine the target image acquisition device coordinates corresponding to each target pixel coordinate based on the first correspondence; and the sight angle coding feature map determination unit is configured to determine the sight angle coding feature map based on the target pixel coordinates and the target image acquisition device coordinates.
[0130] In one embodiment, the acquisition module 11 is also used to obtain configuration information of the image acquisition device; the configuration information includes the field of view angle and the line of sight angle sampling interval; sampling is performed within the field of view angle according to the line of sight angle sampling interval to obtain a set of horizontal and vertical line of sight angles; the determination module 12 is also used to determine the image acquisition device coordinates corresponding to each line of sight direction based on the set of horizontal and vertical line of sight angles and the second correspondence between the line of sight angle and the horizontal and vertical position; the image acquisition device coordinates are projected into a two-dimensional plane to obtain a first correspondence between the pixel coordinates and the image acquisition device coordinates.
[0131] In one embodiment, the determination module 12 includes a processing unit and a projection unit. The processing unit is configured to perform dedistortion processing on the image acquisition device coordinates according to the distortion parameters to obtain processed image acquisition device coordinates; and the projection unit is configured to project the processed image acquisition device coordinates onto a two-dimensional plane according to the intrinsic parameters to obtain the first correspondence.
[0132] In one embodiment, the determination module 12 is specifically used to traverse the set of horizontal and vertical viewing angles, and determine the image acquisition device coordinates corresponding to each viewing direction based on the horizontal correspondence between the horizontal viewing angle and the horizontal position, and the vertical correspondence between the vertical viewing angle and the vertical position.
[0133] In one embodiment, the determination module 12 further includes a fusion unit and a determination unit. The fusion unit is used to fuse the sight angle coding feature map and the image to be processed to obtain fusion information; and the determination unit is used to determine the target distance based on the fusion information.
[0134] In one embodiment, the fusion unit is specifically used to extract features from the sight angle coding feature map and the image to be processed respectively to obtain sight angle features and image features; and perform feature fusion processing on the image features and the sight angle features to obtain fusion features.
[0135] In one embodiment, the fusion unit is further configured to perform channel splicing processing on the sight angle encoding feature map and the image to be processed to obtain a fused image.
[0136] In one embodiment, the determination unit is further configured to input the fusion information into a distance determination model to obtain the target distance.
[0137] Each module in the above-mentioned distance measuring device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0138] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 11As shown. The computer device includes a processor, memory, a communication interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal via wired or wireless communication. The wireless communication method can be achieved through Wi-Fi, a mobile cellular network, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements a distance measurement method. The display screen of the computer device can be a liquid crystal display or an electronic ink display. The input device of the computer device can be a touch layer covering the display screen, or keys, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse.
[0139] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0140] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0141] Acquire an image to be processed; the image to be processed includes obstacles;
[0142] Determining a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is used to represent sight angle information corresponding to each pixel point in the image to be processed;
[0143] The target distance between the target vehicle and the obstacle is determined based on the line of sight angle encoding feature map and the image to be processed.
[0144] In one embodiment, when the processor executes the computer program, it also implements the following steps: based on the image resolution of the image to be processed, determining the target pixel coordinates of each pixel point in the image to be processed; according to the first corresponding relationship, determining the target image acquisition device coordinates corresponding to each target pixel coordinate; and determining the sight angle coding feature map according to the target pixel coordinates and the target image acquisition device coordinates.
[0145] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining configuration information of the image acquisition device; the configuration information includes the field of view angle and the line of sight angle sampling interval; sampling within the field of view angle according to the line of sight angle sampling interval to obtain a set of horizontal and vertical line of sight angles; determining the image acquisition device coordinates corresponding to each line of sight direction based on the set of horizontal and vertical line of sight angles and the second correspondence between the line of sight angle and the horizontal and vertical position; projecting the image acquisition device coordinates into a two-dimensional plane to obtain a first correspondence between the pixel coordinates and the image acquisition device coordinates.
[0146] In one embodiment, when the processor executes the computer program, it also implements the following steps: dedistorting the image acquisition device coordinates according to the distortion parameters to obtain processed image acquisition device coordinates; projecting the processed image acquisition device coordinates into a two-dimensional plane according to the internal parameters to obtain a first corresponding relationship.
[0147] In one embodiment, when the processor executes the computer program, it also implements the following steps: traverse the set of horizontal and vertical sight angles, and determine the image acquisition device coordinates corresponding to each sight direction based on the horizontal correspondence between the horizontal sight angle and the horizontal position, and the vertical correspondence between the vertical sight angle and the vertical position.
[0148] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: fusing the sight angle coding feature map and the image to be processed to obtain fusion information; and determining the target distance based on the fusion information.
[0149] In one embodiment, when the processor executes the computer program, it also implements the following steps: performing feature extraction on the sight angle coding feature map and the image to be processed respectively to obtain sight angle features and image features; performing feature fusion processing on the image features and the sight angle features to obtain fusion features.
[0150] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: performing channel splicing processing on the sight angle encoding feature map and the image to be processed to obtain a fused image.
[0151] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: inputting the fusion information into a distance determination model to obtain the target distance.
[0152] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0153] Acquire an image to be processed; the image to be processed includes obstacles;
[0154] Determining a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is used to represent sight angle information corresponding to each pixel point in the image to be processed;
[0155] The target distance between the target vehicle and the obstacle is determined based on the line of sight angle encoding feature map and the image to be processed.
[0156] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the image resolution of the image to be processed, the target pixel coordinates of each pixel point in the image to be processed are determined; based on the first corresponding relationship, the target image acquisition device coordinates corresponding to each target pixel coordinate are determined; based on the target pixel coordinates and the target image acquisition device coordinates, the line of sight angle coding feature map is determined.
[0157] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining configuration information of the image acquisition device; the configuration information includes the field of view angle and the line of sight angle sampling interval; sampling within the field of view angle according to the line of sight angle sampling interval to obtain a set of horizontal and vertical line of sight angles; determining the image acquisition device coordinates corresponding to each line of sight direction based on the set of horizontal and vertical line of sight angles and the second correspondence between the line of sight angle and the horizontal and vertical position; projecting the image acquisition device coordinates into a two-dimensional plane to obtain a first correspondence between the pixel coordinates and the image acquisition device coordinates.
[0158] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: dedistorting the image acquisition device coordinates according to the distortion parameters to obtain processed image acquisition device coordinates; projecting the processed image acquisition device coordinates into a two-dimensional plane according to the internal parameters to obtain a first corresponding relationship.
[0159] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: traversing the set of horizontal and vertical sight angles, and determining the image acquisition device coordinates corresponding to each sight direction based on the horizontal correspondence between the horizontal sight angle and the horizontal position, and the vertical correspondence between the vertical sight angle and the vertical position.
[0160] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: fusing the sight angle coding feature map and the image to be processed to obtain fusion information; and determining the target distance based on the fusion information.
[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: feature extraction is performed on the sight angle coding feature map and the image to be processed respectively to obtain sight angle features and image features; and feature fusion processing is performed on the image features and the sight angle features to obtain fusion features.
[0162] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: performing channel splicing processing on the sight angle encoding feature map and the image to be processed to obtain a fused image.
[0163] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: inputting the fusion information into a distance determination model to obtain the target distance.
[0164] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0165] Acquire an image to be processed; the image to be processed includes obstacles;
[0166] Determining a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is used to represent sight angle information corresponding to each pixel point in the image to be processed;
[0167] The target distance between the target vehicle and the obstacle is determined based on the line of sight angle encoding feature map and the image to be processed.
[0168] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the image resolution of the image to be processed, the target pixel coordinates of each pixel point in the image to be processed are determined; based on the first corresponding relationship, the target image acquisition device coordinates corresponding to each target pixel coordinate are determined; based on the target pixel coordinates and the target image acquisition device coordinates, the line of sight angle coding feature map is determined.
[0169] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining configuration information of the image acquisition device; the configuration information includes the field of view angle and the line of sight angle sampling interval; sampling within the field of view angle according to the line of sight angle sampling interval to obtain a set of horizontal and vertical line of sight angles; determining the image acquisition device coordinates corresponding to each line of sight direction based on the set of horizontal and vertical line of sight angles and the second correspondence between the line of sight angle and the horizontal and vertical position; projecting the image acquisition device coordinates into a two-dimensional plane to obtain a first correspondence between the pixel coordinates and the image acquisition device coordinates.
[0170] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: dedistorting the image acquisition device coordinates according to the distortion parameters to obtain processed image acquisition device coordinates; projecting the processed image acquisition device coordinates into a two-dimensional plane according to the internal parameters to obtain a first corresponding relationship.
[0171] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: traversing the set of horizontal and vertical sight angles, and determining the image acquisition device coordinates corresponding to each sight direction based on the horizontal correspondence between the horizontal sight angle and the horizontal position, and the vertical correspondence between the vertical sight angle and the vertical position.
[0172] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: fusing the sight angle coding feature map and the image to be processed to obtain fusion information; and determining the target distance based on the fusion information.
[0173] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: feature extraction is performed on the sight angle coding feature map and the image to be processed respectively to obtain sight angle features and image features; and feature fusion processing is performed on the image features and the sight angle features to obtain fusion features.
[0174] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: performing channel splicing processing on the sight angle encoding feature map and the image to be processed to obtain a fused image.
[0175] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: inputting the fusion information into a distance determination model to obtain the target distance.
[0176] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0177] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0178] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A distance measurement method, characterized in that: The method comprises: Acquire an image to be processed; the image to be processed includes an obstacle; Determining a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is used to represent sight angle information corresponding to each pixel point in the image to be processed; A target distance between a target vehicle and the obstacle is determined according to the sight angle coding feature map and the image to be processed.
2. The method according to claim 1, characterized in that The determining of the sight angle coding feature map according to a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and the image resolution of the image to be processed includes: Determining target pixel coordinates of each pixel in the image to be processed based on the image resolution of the image to be processed; Determining the target image acquisition device coordinates corresponding to each of the target pixel coordinates according to the first corresponding relationship; The sight angle coding feature map is determined according to the target pixel coordinates and the target image acquisition device coordinates.
3. The method according to claim 1, characterized in that The method further comprises: Obtaining configuration information of an image acquisition device; the configuration information includes a field of view angle and a line of sight angle sampling interval; Sampling within the field of view angle according to the line of sight angle sampling interval to obtain a set of horizontal and vertical line of sight angles; Determining the image acquisition device coordinates corresponding to each viewing direction based on the set of horizontal and vertical viewing angles and a second correspondence between the viewing angles and the horizontal and vertical positions; The image acquisition device coordinates are projected onto a two-dimensional plane to obtain the first corresponding relationship between the pixel coordinates and the image acquisition device coordinates.
4. The method according to claim 3, characterized in that The configuration information further includes: intrinsic parameters and distortion parameters of the image acquisition device; and projecting the image acquisition device coordinates onto a two-dimensional plane to obtain the first corresponding relationship between the pixel coordinates and the image acquisition device coordinates includes: performing dedistortion processing on the image acquisition device coordinates according to the distortion parameters to obtain processed image acquisition device coordinates; The processed image acquisition device coordinates are projected onto the two-dimensional plane according to the internal reference to obtain the first corresponding relationship.
5. The method according to claim 3, characterized in that The sight angle includes a horizontal sight angle and a vertical sight angle, the horizontal and vertical positions include a horizontal position and a vertical position, the second correspondence includes a horizontal correspondence and a vertical correspondence, and determining the image acquisition device coordinates corresponding to each sight direction based on the set of horizontal and vertical sight angles and the second correspondence between the sight angles and the horizontal and vertical positions includes: The set of horizontal and vertical sight angles is traversed, and the image acquisition device coordinates corresponding to each sight direction are determined according to the horizontal correspondence between the horizontal sight angle and the horizontal position, and the vertical correspondence between the vertical sight angle and the vertical position.
6. The method according to any one of claims 1 to 4, characterized in that The determining the target distance between the target vehicle and the obstacle according to the sight angle coding feature map and the image to be processed includes: Fusing the sight angle coding feature map and the image to be processed to obtain fusion information; The target distance is determined according to the fusion information.
7. The method according to claim 6, characterized in that The fusion information includes fusion features, and the fusion processing of the sight angle encoding feature map and the image to be processed to obtain the fusion information includes: Performing feature extraction on the sight angle coding feature map and the image to be processed respectively to obtain sight angle features and image features; The image features and the sight angle features are subjected to feature fusion processing to obtain the fusion features.
8. The method according to claim 6, characterized in that The fusion information includes a fusion image, and the fusing process of the sight angle encoding feature map and the image to be processed to obtain the fusion information includes: Channel splicing processing is performed on the sight angle encoding feature map and the image to be processed to obtain the fused image.
9. The method according to claim 6, characterized in that Determining the target distance according to the fusion information includes: The fusion information is input into a distance determination model to obtain the target distance.
10. A distance measuring device, characterized in that: The device comprises: An acquisition module, configured to acquire an image to be processed, wherein the image to be processed includes obstacles; a determination module, configured to determine a sight angle coding feature map based on a predetermined first correspondence between pixel coordinates and image acquisition device coordinates and an image resolution of the image to be processed; the sight angle coding feature map is configured to represent sight angle information corresponding to each pixel point in the image to be processed; The determination module is further used to determine the target distance between the target vehicle and the obstacle based on the sight angle coding feature map and the image to be processed.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.