A position determination method and device in virtual simulation, electronic equipment and medium
Patent Information
- Application Number
- CN202310383791.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-04-11
AI Technical Summary
[0004]有鉴于此,本申请的目的在于提供一种虚拟仿真中的位置确定方法、装置、电子设备及介质,以解决现有相机传感器模型,无法同时满足体现相机传感器特性及低运算资源占用的问题
[0026]本申请实施例提供的一种虚拟仿真中的位置确定方法、装置、电子设备及介质,能够将目标点的第一坐标转换到相机传感器下的第二坐标,并利用相机参数来获得目标点的第三坐标,以此模拟相机传感器的特性,并利用镜头畸变参数及误差概率分布函数对第三坐标进行调整,进一步还原相机参数对成像的影响。最后将调整后的第四坐标转换回虚拟仿真场景中的三维坐标,得到转换后第一坐标,利用转换后第一坐标确定待识别物的位置,在确定待识别物位置时,无需进行物体成像以及图像识别处理,与现有技术中的虚拟仿真中的位置确定方法相比,解决了现有相机传感器模型,无法同时满足体现相机传感器特性及低运算资源占用的问题。
Smart Images

Figure CN116384134B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology, and more specifically, to a method, apparatus, electronic device, and medium for determining position in virtual simulation. Background Technology
[0002] In autonomous driving technology, onboard sensors are widely used for target, environmental, and obstacle detection. Compared to millimeter-wave radar and lidar, camera sensors among these sensors can utilize computer vision algorithms to detect lane lines and traffic signs. Autonomous driving simulations require the identification of lane lines and traffic signs while simulating the characteristics of camera sensors. Current technologies typically use ground truth sensor models and physical-level sensor models to simulate the characteristics of camera sensors.
[0003] However, ground truth sensor models directly output the true values of lane lines. They are idealized sensor models, offering fast simulation speeds but failing to reflect the characteristics of camera sensors, such as distortion and Gaussian blur. Physical-level sensor models, on the other hand, require some camera parameters for imaging. When using image recognition methods to output lane lines and traffic signs, the data processing flow is the same as that of real camera sensors. Because object imaging and image recognition processing are necessary, this method consumes significant computational resources in virtual simulations. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method, device, electronic device and medium for determining position in virtual simulation, so as to solve the problem that existing camera sensor models cannot simultaneously satisfy the requirements of reflecting the characteristics of camera sensors and low computational resource consumption.
[0005] In a first aspect, embodiments of this application provide a method for determining position in a virtual simulation, including:
[0006] Obtain the first coordinates of the target point in the virtual simulation scene, and transform the first coordinates of the target point to the second coordinates in the camera sensor coordinate system through coordinate transformation;
[0007] By using camera parameters, the second coordinates corresponding to the target point are projected onto the image plane to obtain the third coordinates corresponding to the target point under the image plane.
[0008] By adjusting the third coordinate using lens distortion parameters and error probability distribution function, the fourth coordinate corresponding to the target point under the image plane is obtained;
[0009] Transform the fourth coordinates corresponding to the target point into three-dimensional coordinates in the virtual simulation scene to obtain the first coordinates corresponding to the target point after transformation.
[0010] Based on the transformed first coordinates corresponding to the target point, the position of the object to be identified in the virtual simulation scene is determined.
[0011] Optionally, the third coordinate is adjusted using lens distortion parameters and an error probability distribution function to obtain the fourth coordinate corresponding to the target point in the image plane. This includes: determining the values of the first lens distortion parameters and the second lens distortion parameters, both of which are radial distortion parameters; adjusting the third coordinate using the first and second lens distortion parameters to obtain the distorted third coordinate in the image plane; and applying Gaussian blur error processing to the distorted third coordinate using the error probability distribution function to obtain the fourth coordinate corresponding to the target point.
[0012] Optionally, the third coordinate is adjusted using the first lens distortion parameters and the second lens distortion parameters to obtain the distorted third coordinate under the image plane, including: determining the distance between the target point in the image plane and the origin of the image plane; taking the product of the square of the distance and the first lens distortion parameter as the first product, and taking the product of the fourth power of the distance and the second lens distortion parameter as the second product; taking the sum of the value 1, the first product, and the second product as the axis coordinate coefficient; taking the product of the axis coordinate coefficient and the X-axis coordinate in the third coordinate as the X-axis coordinate of the distorted third coordinate, and taking the product of the axis coordinate coefficient and the Y-axis coordinate in the third coordinate as the Y-axis coordinate of the distorted third coordinate.
[0013] Optionally, the third coordinate after distortion is processed by Gaussian blur error using the error probability distribution function to obtain the fourth coordinate corresponding to the target point. This includes: determining the target value of the root of variance under the target weather; adjusting the error range of the error probability distribution function under the target weather using the target value of the root of variance; and processing the third coordinate after distortion by Gaussian blur error based on the adjusted error range to obtain the fourth coordinate corresponding to the target point under the target weather.
[0014] Optionally, the second coordinates corresponding to the target point are projected onto the image plane using camera parameters to obtain the third coordinates corresponding to the target point under the image plane, including: using the camera focal length as the camera parameter; using the product of the camera focal length and the Y-axis coordinate of the second coordinate as the third product; using the product of the camera focal length and the Z-axis coordinate of the second coordinate as the fourth product; using the quotient of the third product and the X-axis coordinate of the second coordinate as the X-axis coordinate of the third coordinate; and using the quotient of the fourth product and the X-axis coordinate of the second coordinate as the Y-axis coordinate of the third coordinate.
[0015] Optionally, the fourth coordinates corresponding to the target point are transformed into three-dimensional coordinates in the virtual simulation scene to obtain the transformed first coordinates corresponding to the target point, including: taking the product of the camera parameters and the Z-axis coordinate in the first coordinate as the fifth product, taking the product of the X-axis coordinate in the fourth coordinate and the Z-axis coordinate in the first coordinate as the sixth product; taking the quotient of the fifth product and the Y-axis coordinate in the fourth coordinate as the X-axis coordinate of the transformed first coordinate, taking the quotient of the sixth product and the Y-axis coordinate in the fourth coordinate as the Y-axis coordinate of the transformed first coordinate, and taking the Z-axis coordinate in the first coordinate as the Z-axis coordinate of the transformed first coordinate.
[0016] Optionally, before obtaining the first coordinates of the target point in the virtual simulation scene, the method further includes: determining the type of the object to be identified; if the object to be identified is a curved object, multiple target points are selected; if the object to be identified is a point-type object, one target point is selected; and determining the position of the object to be identified in the virtual simulation scene based on the transformed first coordinates corresponding to the target point, including: if the object to be identified is a curved object, performing polynomial fitting on the multiple transformed first coordinates corresponding to all target points to obtain a fitted curve, and taking the position of the fitted curve as the position of the curved object to be identified; if the object to be identified is a point-type object, taking the position of the transformed first coordinates corresponding to the target point as the position of the point-type object to be identified in the virtual simulation scene.
[0017] Secondly, embodiments of this application also provide a location determination device in virtual simulation, the device comprising:
[0018] The first coordinate transformation module is used to obtain the first coordinates of the target point in the virtual simulation scene of the object to be identified, and transform the first coordinates of the target point to the second coordinates in the camera sensor coordinate system through coordinate transformation.
[0019] The second coordinate transformation module is used to project the second coordinates corresponding to the target point onto the image plane using camera parameters, so as to obtain the third coordinates corresponding to the target point under the image plane.
[0020] The coordinate adjustment module is used to adjust the third coordinate using lens distortion parameters and error probability distribution function to obtain the fourth coordinate corresponding to the target point under the image plane;
[0021] The third coordinate transformation module is used to transform the fourth coordinate corresponding to the target point to the three-dimensional coordinate in the virtual simulation scene, so as to obtain the first coordinate corresponding to the target point after transformation.
[0022] The position determination module is used to determine the position of the object to be identified in the virtual simulation scene based on the transformed first coordinates corresponding to the target point.
[0023] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the position determination method in the virtual simulation described above.
[0024] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the location determination method in the virtual simulation described above.
[0025] The embodiments of this application bring the following beneficial effects:
[0026] This application provides a method, apparatus, electronic device, and medium for determining position in virtual simulation. It can transform the first coordinates of a target point to a second coordinate under a camera sensor, and use camera parameters to obtain the third coordinate of the target point, thereby simulating the characteristics of the camera sensor. The third coordinate is then adjusted using lens distortion parameters and an error probability distribution function to further restore the influence of camera parameters on imaging. Finally, the adjusted fourth coordinate is transformed back to the three-dimensional coordinates in the virtual simulation scene to obtain the transformed first coordinate. The position of the object to be identified is determined using the transformed first coordinate. When determining the position of the object, there is no need for object imaging and image recognition processing. Compared with existing position determination methods in virtual simulation, this solves the problem that existing camera sensor models cannot simultaneously satisfy the requirements of reflecting camera sensor characteristics and low computational resource consumption.
[0027] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A flowchart of the position determination method in virtual simulation provided in the embodiments of this application is shown;
[0030] Figure 2 This paper shows a schematic diagram of the structure of the position determination device in the virtual simulation provided in the embodiments of this application;
[0031] Figure 3 A schematic diagram of the structure of the electronic device provided in the embodiments of this application is shown. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0033] It is worth noting that prior to this application, in autonomous driving technology, vehicle-mounted sensors were widely used for target, environment, and obstacle detection. Compared to millimeter-wave radar and lidar, camera sensors among vehicle-mounted sensors can utilize computer vision algorithms to detect lane lines and traffic signs. Autonomous driving simulations require the identification of lane lines and traffic signs while simulating the characteristics of camera sensors. Existing technologies typically use ground truth sensor models and physical sensor models to simulate camera sensor characteristics. However, ground truth sensor models are too simplistic, directly obtaining the coordinates and labels of lane lines and traffic signs from the simulation environment. While this method offers fast simulation speed, it fails to reflect the distortion in the camera lens and the measurement errors caused by focal length parameters. Physical sensor models are too slow and require an image recognition algorithm. Autonomous driving simulations require outputting one image per frame and performing image recognition, which cannot meet the real-time requirements of autonomous driving simulations.
[0034] Based on this, the embodiments of this application provide a method for determining position in virtual simulation, so as to reduce the computational resource consumption while reflecting the characteristics of the camera sensor.
[0035] Please see Figure 1 , Figure 1 This is a flowchart illustrating a position determination method in virtual simulation provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the method for determining position in virtual simulation includes:
[0036] Step S101: Obtain the first coordinates of the target point in the virtual simulation scene, and transform the first coordinates of the target point to the second coordinates in the camera sensor coordinate system through coordinate transformation.
[0037] In this step, the object to be identified can refer to an object in a virtual simulation scene. For example, the object to be identified can be a lane line or a traffic sign.
[0038] A virtual simulation scenario refers to a virtual environment used to simulate the autonomous driving capabilities of a vehicle. A virtual simulation scenario can include simulated vehicles, simulated traffic signs, and simulated lane markings.
[0039] Camera sensor can refer to a camera sensor model, which is used to simulate a real vehicle camera.
[0040] In this embodiment, a target point is first selected from the objects to be identified. If the object is a lane line, the target point is a point on the lane line; if the object is a traffic sign, the target point is the intersection of the traffic sign and the ground of the virtual simulation scene. After selecting the target point, its three-dimensional coordinates in the virtual simulation scene are obtained. These three-dimensional coordinates are the first coordinates. Then, a predetermined transformation matrix is used to convert the first coordinates into second coordinates in the camera sensor coordinate system. The camera sensor coordinate system has its origin at the position of the camera sensor in the virtual simulation scene, its X-axis is the shooting direction of the camera sensor, its Z-axis is the direction perpendicular to the horizontal ground in the virtual simulation scene, and its Y-axis is the direction parallel to the horizontal ground in the virtual simulation scene.
[0041] Step S102: Project the second coordinates corresponding to the target point onto the image plane using camera parameters to obtain the third coordinates corresponding to the target point under the image plane.
[0042] In this step, camera parameters refer to the device parameters when the camera sensor simulates a real camera. Camera parameters are used to reflect the characteristics of the camera sensor.
[0043] For example, camera parameters can be the camera's focal length.
[0044] The image plane can refer to the virtual imaging plane corresponding to the camera sensor. The image plane is a two-dimensional plane corresponding to the three-dimensional coordinate system of the camera sensor. The physical meaning of the image plane is the imaging plane in the camera, such as the CCD photosensitive element in the camera.
[0045] The third coordinate can refer to the coordinates of the target point in the image plane after the first coordinate is affected by the camera parameters.
[0046] In this embodiment, since different camera parameters will have different effects on the coordinates of the target point in the image plane, it is necessary to add the camera parameters to the calculation of the target point coordinates in the image plane, and obtain the third coordinates of the target point in the image plane according to the principle of similar triangles.
[0047] In one optional embodiment, the second coordinates corresponding to the target point are projected onto the image plane using camera parameters to obtain the third coordinates corresponding to the target point under the image plane, including: using the camera focal length as the camera parameter; using the product of the camera focal length and the Y-axis coordinate of the second coordinate as the third product; using the product of the camera focal length and the Z-axis coordinate of the second coordinate as the fourth product; using the quotient of the third product and the X-axis coordinate of the second coordinate as the X-axis coordinate of the third coordinate; and using the quotient of the fourth product and the X-axis coordinate of the second coordinate as the Y-axis coordinate of the third coordinate.
[0048] Specifically, let the camera focal length be denoted as f, and let the second coordinates of the target point in the camera sensor coordinate system be denoted as (X, Y, Z). Then f×Y is the third product, f×Z is the fourth product, f×Y / X is the X-axis coordinate of the third coordinate, and f×Z / X is the Y-axis coordinate of the third coordinate. Thus, the third coordinate can be expressed as (f×Y / X, f×Z / X).
[0049] Step S103: Adjust the third coordinate using lens distortion parameters and error probability distribution function to obtain the fourth coordinate corresponding to the target point under the image plane.
[0050] In this step, the lens distortion parameter is used to characterize the distortion parameters of the camera sensor when simulating the imaging of a real camera lens.
[0051] The error probability distribution function is used to add the positional error caused by Gaussian blur, and the third coordinate of the target point is modified using the error probability distribution function.
[0052] In this embodiment, for camera imaging, the largest imaging error comes from the distortion caused by the camera lens. The distortion of the camera lens causes the image to be warped, that is, the displacement of the target point coordinates in the image plane. Therefore, it is necessary to adjust the third coordinate using lens distortion parameters to simulate the imaging effect caused by camera lens distortion.
[0053] In addition to lens distortion, the error caused by Gaussian blur also needs to be considered. This error can be adjusted by using the error probability distribution function to adjust the coordinates of the target point on the image plane.
[0054] In one optional embodiment, adjusting the third coordinate using lens distortion parameters and an error probability distribution function to obtain the fourth coordinate corresponding to the target point in the image plane includes: determining the values of a first lens distortion parameter and a second lens distortion parameter, both of which are radial distortion parameters; adjusting the third coordinate using the first and second lens distortion parameters to obtain the distorted third coordinate in the image plane; and performing Gaussian blur error processing on the distorted third coordinate using the error probability distribution function to obtain the fourth coordinate corresponding to the target point.
[0055] Specifically, based on the type and parameters of the actual camera, the values of the first and second lens distortion parameters in the radial distortion parameters can be determined. The third coordinate is then adjusted based on these values to obtain the distorted third coordinate in the image plane. Next, a positional error is added to the distorted third coordinate using an error probability distribution function to obtain the fourth coordinate corresponding to the target point. The magnitude of the added positional error can be controlled by adjusting the value of the root variance in the error probability distribution function.
[0056] The error probability distribution function can refer to the probability density function that follows a normal distribution.
[0057] In one optional embodiment, the third coordinate is adjusted using the first lens distortion parameters and the second lens distortion parameters to obtain the distorted third coordinate under the image plane, including: determining the distance between the target point in the image plane and the origin of the image plane; taking the product of the square of the distance and the first lens distortion parameter as the first product, and taking the product of the fourth power of the distance and the second lens distortion parameter as the second product; taking the sum of the value 1, the first product, and the second product as the axis coordinate coefficient; taking the product of the axis coordinate coefficient and the X-axis coordinate in the third coordinate as the X-axis coordinate of the distorted third coordinate, and taking the product of the axis coordinate coefficient and the Y-axis coordinate in the third coordinate as the Y-axis coordinate of the distorted third coordinate.
[0058] Specifically, the image plane is a two-dimensional plane. The third coordinates of the target point on the image plane are denoted as (x, y). The distortion parameters of the first lens are denoted as K1, and the distortion parameters of the second lens are denoted as K2. The third coordinates after distortion are denoted as (x, y). ′ ,y ′ ).
[0059] Let r be the distance between the target point in the image plane and the origin of the image plane. x ′ =x×(1+K1×r) 2 +K2×r 4 ), y ′ =y×(1+K1×r) 2 +K2×r 4 The first product is K1×r. 2 The second product is K2×r 4 The axis coordinate coefficient is 1 + K1 × r 2 +K2×r 4 The origin of the image plane can refer to the projection of the camera center onto the image plane.
[0060] In one optional embodiment, Gaussian blur error processing is performed on the distorted third coordinate using the error probability distribution function to obtain the fourth coordinate corresponding to the target point. This includes: determining the target value of the root of variance under the target weather; adjusting the error range of the error probability distribution function under the target weather using the target value of the root of variance; and performing Gaussian blur error processing on the distorted third coordinate based on the adjusted error range to obtain the fourth coordinate corresponding to the target point under the target weather.
[0061] Specifically, considering the interference of rain, snow, and sandstorms on images, as well as the detection capabilities of different image recognition algorithms, the error impact under different weather conditions and different algorithms can be calibrated through experimental methods. The value of the variance root of the error probability distribution function corresponding to different weather conditions and different image recognition algorithms can be determined. Different variance root values correspond to different error ranges. In this way, the same Gaussian distribution function can be used to perform Gaussian blur error processing on the fourth coordinate of the target point in the image plane.
[0062] Step S104: Transform the fourth coordinates corresponding to the target point into three-dimensional coordinates in the virtual simulation scene to obtain the transformed first coordinates corresponding to the target point.
[0063] In this step, the fourth coordinate under the image plane is projected inversely onto the three-dimensional coordinates in the virtual simulation scene. This allows for the simulation of the camera sensor's recognition result of the object's position in autonomous driving, reconstructing the impact of camera parameters on the camera sensor during the localization process. It should be noted that here, assuming the Z-axis coordinate is fixed, the transformed first coordinate can be calculated using the principle of similar triangles.
[0064] In one optional embodiment, transforming the fourth coordinates corresponding to the target point into three-dimensional coordinates in the virtual simulation scene to obtain the transformed first coordinates corresponding to the target point includes: multiplying the camera parameters by the Z-axis coordinate in the first coordinate as a fifth product; multiplying the X-axis coordinate in the fourth coordinate by the Z-axis coordinate in the first coordinate as a sixth product; using the quotient of the fifth product and the Y-axis coordinate in the fourth coordinate as the X-axis coordinate of the transformed first coordinate; using the quotient of the sixth product and the Y-axis coordinate in the fourth coordinate as the Y-axis coordinate of the transformed first coordinate; and using the Z-axis coordinate in the first coordinate as the Z-axis coordinate of the transformed first coordinate.
[0065] Specifically, the fourth coordinate is denoted as (x", y"), and the first coordinate after transformation is denoted as (X). ′ Y ′ Z ′ ), we can obtain X ′ =f×Z" / y",Y ′ = x"×Z" / y", Z ′=Z". Where the fifth product is f×Z", and the sixth product is x"×Z". Where Z" represents the Z-axis coordinate in the first coordinate system.
[0066] It should be noted that the above calculation formula assumes that the Z-value of the first coordinate and the transformed first coordinate remains unchanged. However, the Z-value may change during the actual calculation process, for example, on sloping or rough, uneven ground. For sloping ground, the Z-value is equivalent to the Z-value of the original point; for rough ground with varying undulations, a small error can be added to the Z-value to reproduce the influence of the ground on the detection. That is, an error is added to the Z-value using the error probability distribution function. For example, the Z-value is 100 before adding the error, and 100.4 after adding the error.
[0067] Step S105: Based on the transformed first coordinates corresponding to the target point, determine the position of the object to be identified in the virtual simulation scene.
[0068] In this step, the method for determining the location of the object to be identified differs depending on the type of object to be identified. Here, the objects to be identified are mainly divided into curved and point types. If the object to be identified is a point type, the first coordinate of the target point is directly used as the coordinate of the object to be identified. If the object to be identified is a curved type, multiple target points need to be selected, and the location of the object to be identified is determined based on the transformed first coordinates of each of the multiple target points.
[0069] In one optional embodiment, before obtaining the first coordinates of the target point in the virtual simulation scene, the method further includes: determining the type of the object to be identified; if the object to be identified is a curved object, multiple target points are selected; if the object to be identified is a point-type object, one target point is selected; and determining the position of the object to be identified in the virtual simulation scene based on the transformed first coordinates corresponding to the target point, including: if the object to be identified is a curved object, performing polynomial fitting on the multiple transformed first coordinates corresponding to all target points to obtain a fitted curve, and taking the position of the fitted curve as the position of the curved object; if the object to be identified is a point-type object, taking the position of the transformed first coordinates corresponding to the target point as the position of the point-type object in the virtual simulation scene.
[0070] Specifically, objects to be identified can be divided into curved objects and point-type objects, such as lane lines and traffic signs. Lane lines are curved objects to be identified, while traffic signs are point-type objects to be identified.
[0071] If the object to be identified is curved, such as a traffic line, multiple target points are selected along the lane line. The number of selected target points needs to match the number of points used for fitting in the recognition algorithm. The transformed first coordinates of each target point are determined, and a polynomial fitting is performed on these multiple transformed first coordinates according to the required lane line length to obtain the fitted curve corresponding to the lane line. The location of this fitted curve is taken as the lane line position. The fitting accuracy and computational complexity will vary depending on the number of target points.
[0072] If the object to be identified is a point-type object, such as various traffic signs, then the contact point between the traffic sign and the ground in the virtual simulation scene is selected as the target point. In this case, only one target point is selected, and the position of the first coordinate after transformation of the target point is the position of the traffic sign in the virtual simulation scene.
[0073] Compared to existing methods for determining location in virtual simulations, this application transforms the first coordinate of a target point into a second coordinate under the camera sensor, and uses camera parameters to obtain the third coordinate of the target point, thereby simulating the characteristics of the camera sensor. The third coordinate is then adjusted using lens distortion parameters and an error probability distribution function to further reflect the influence of camera parameters on imaging. Finally, the adjusted fourth coordinate is transformed back into three-dimensional coordinates in the virtual simulation scene to obtain the transformed first coordinate. The position of the object to be identified is then determined using this transformed first coordinate. In determining the position of the object, no object imaging or image recognition processing is required, thus solving the problem that existing camera sensor models cannot simultaneously satisfy the requirements of representing camera sensor characteristics and low computational resource consumption.
[0074] Based on the same inventive concept, this application also provides a virtual simulation position determination device corresponding to the position determination method in virtual simulation. Since the principle of the device in this application is similar to the position determination method in virtual simulation described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0075] Please see Figure 2 , Figure 2 This is a schematic diagram of a position determination device in a virtual simulation provided in an embodiment of this application. Figure 2 As shown, the location determination device 200 in the virtual simulation includes:
[0076] The first coordinate transformation module 201 is used to obtain the first coordinates of the target point in the virtual simulation scene of the object to be identified, and transform the first coordinates of the target point to the second coordinates in the camera sensor coordinate system through coordinate transformation.
[0077] The second coordinate transformation module 202 is used to project the second coordinates corresponding to the target point onto the image plane using camera parameters, so as to obtain the third coordinates corresponding to the target point under the image plane.
[0078] The coordinate adjustment module 203 is used to adjust the third coordinate using lens distortion parameters and error probability distribution function to obtain the fourth coordinate corresponding to the target point under the image plane.
[0079] The third coordinate transformation module 204 is used to transform the fourth coordinate corresponding to the target point to the three-dimensional coordinate in the virtual simulation scene, so as to obtain the first coordinate corresponding to the target point after transformation.
[0080] The position determination module 205 is used to determine the position of the object to be identified in the virtual simulation scene based on the transformed first coordinates corresponding to the target point.
[0081] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.
[0082] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 and the memory 320 communicate via the bus 330. When the machine-readable instructions are executed by the processor 310, they can perform the operations described above. Figure 1 The steps of the position determination method in the virtual simulation shown in the method embodiment can be found in the method embodiment for specific implementation, and will not be repeated here.
[0083] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the position determination method in the virtual simulation shown in the method embodiment can be found in the method embodiment for specific implementation, and will not be repeated here.
[0084] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0085] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0086] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0087] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0088] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0089] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for determining position in virtual simulation, characterized in that, include: The first coordinates of the target point in the object to be identified in the virtual simulation scene are obtained, and the first coordinates of the target point are transformed to the second coordinates in the camera sensor coordinate system through coordinate transformation. By using camera parameters, the second coordinates corresponding to the target point are projected onto the image plane to obtain the third coordinates corresponding to the target point under the image plane. The third coordinate is adjusted using lens distortion parameters and error probability distribution function to obtain the fourth coordinate corresponding to the target point in the image plane. The error probability distribution function is used to add the positional error caused by Gaussian blur. The error probability distribution function is a probability density function that follows a normal distribution and is used to modify the third coordinate of the target point. Transform the fourth coordinates corresponding to the target point into three-dimensional coordinates in the virtual simulation scene to obtain the first coordinates corresponding to the target point after transformation. Based on the transformed first coordinates corresponding to the target point, the position of the object to be identified in the virtual simulation scene is determined; The step of adjusting the third coordinate using lens distortion parameters and error probability distribution function to obtain the fourth coordinate corresponding to the target point in the image plane includes: The values of the first lens distortion parameter and the second lens distortion parameter are determined, and both the first lens distortion parameter and the second lens distortion parameter are radial distortion parameters. The third coordinate is adjusted using the first lens distortion parameters and the second lens distortion parameters to obtain the distorted third coordinate in the image plane; Determine the target value of the root of difference for the target weather; The target value of the variance root is used to adjust the error range of the error probability distribution function under the target weather conditions; Based on the adjusted error range, Gaussian blur error processing is applied to the distorted third coordinate to obtain the fourth coordinate corresponding to the target point under the target weather conditions.
2. The method according to claim 1, characterized in that, The step of adjusting the third coordinate using the first lens distortion parameters and the second lens distortion parameters to obtain the distorted third coordinate in the image plane includes: Determine the distance between the target point in the image plane and the origin of the image plane; The product of the square of the distance and the first lens distortion parameter is taken as the first product, and the product of the fourth power of the distance and the second lens distortion parameter is taken as the second product. The sum of the value 1, the first product, and the second product is used as the axis coordinate coefficient; The product of the axis coordinate coefficient and the X-axis coordinate in the third coordinate system is used as the X-axis coordinate of the distorted third coordinate system, and the product of the axis coordinate coefficient and the Y-axis coordinate in the third coordinate system is used as the Y-axis coordinate of the distorted third coordinate system.
3. The method according to claim 1, characterized in that, The step of projecting the second coordinates corresponding to the target point onto the image plane using camera parameters to obtain the third coordinates corresponding to the target point under the image plane includes: Use the camera focal length as a camera parameter; The product of the camera focal length and the Y-axis coordinate of the second coordinate is taken as the third product, and the product of the camera focal length and the Z-axis coordinate of the second coordinate is taken as the fourth product. The quotient of the third product and the X-axis coordinate of the second coordinate is taken as the X-axis coordinate of the third coordinate, and the quotient of the fourth product and the X-axis coordinate of the second coordinate is taken as the Y-axis coordinate of the third coordinate.
4. The method according to claim 1, characterized in that, The step of transforming the fourth coordinates corresponding to the target point to three-dimensional coordinates in the virtual simulation scene to obtain the transformed first coordinates corresponding to the target point includes: The product of the camera parameters and the Z-axis coordinate in the first coordinate system is taken as the fifth product, and the product of the X-axis coordinate in the fourth coordinate system and the Z-axis coordinate in the first coordinate system is taken as the sixth product. The quotient of the fifth product and the Y-axis coordinate of the fourth coordinate is used as the X-axis coordinate of the transformed first coordinate. The quotient of the sixth product and the Y-axis coordinate of the fourth coordinate is used as the Y-axis coordinate of the transformed first coordinate. The Z-axis coordinate of the first coordinate is used as the Z-axis coordinate of the transformed first coordinate.
5. The method according to claim 1, characterized in that, Before obtaining the first coordinates of the target point in the virtual simulation scene of the object to be identified, the method further includes: Determine the type of the object to be identified; If the object to be identified is a curved object, multiple target points are selected; If the object to be identified is a point-type object, then one target point is selected; Determining the position of the object to be identified in the virtual simulation scene based on the transformed first coordinates corresponding to the target point includes: If the object to be identified is a curved object, a polynomial fitting is performed on the first coordinates of all target points after multiple transformations to obtain a fitted curve, and the position of the fitted curve is taken as the position of the curved object to be identified. If the object to be identified is a point-type object, the position of the transformed first coordinate corresponding to the target point is taken as the position of the point-type object in the virtual simulation scene.
6. A position determination device in virtual simulation, characterized in that, include: The first coordinate transformation module is used to obtain the first coordinates of the target point in the virtual simulation scene of the object to be identified, and transform the first coordinates of the target point to the second coordinates in the camera sensor coordinate system through coordinate transformation. The second coordinate transformation module is used to project the second coordinates corresponding to the target point onto the image plane using camera parameters, so as to obtain the third coordinates corresponding to the target point under the image plane. The coordinate adjustment module is used to adjust the third coordinate using lens distortion parameters and error probability distribution function to obtain the fourth coordinate corresponding to the target point under the image plane. The error probability distribution function is used to add the position error caused by Gaussian blur. The error probability distribution function is a probability density function that follows a normal distribution and is used to modify the third coordinate of the target point. The third coordinate transformation module is used to transform the fourth coordinate corresponding to the target point to the three-dimensional coordinate in the virtual simulation scene, so as to obtain the first coordinate corresponding to the target point after transformation. The position determination module is used to determine the position of the object to be identified in the virtual simulation scene based on the transformed first coordinates corresponding to the target point; The coordinate adjustment module is specifically used for: The values of the first lens distortion parameter and the second lens distortion parameter are determined, and both the first lens distortion parameter and the second lens distortion parameter are radial distortion parameters. The third coordinate is adjusted using the first lens distortion parameters and the second lens distortion parameters to obtain the distorted third coordinate in the image plane; Determine the target value of the root of difference for the target weather; The target value of the variance root is used to adjust the error range of the error probability distribution function under the target weather conditions; Based on the adjusted error range, Gaussian blur error processing is applied to the distorted third coordinate to obtain the fourth coordinate corresponding to the target point under the target weather conditions.
7. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the position determination method in the virtual simulation as claimed in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the position determination method in the virtual simulation as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Camera imaging model construction method, device and automobile automatic driving system
CN109242779A
