Data generation method, device, electronic device and storage medium

High-accuracy, low-cost autonomous driving data is generated through three-dimensional reconstruction and projection technology, which solves the problems of high cost and low accuracy of autonomous driving model data annotation, and achieves efficient annotation of autonomous driving data.

CN114299230BActive Publication Date: 2024-09-10CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111570104.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2024-09-10
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

The data annotation cost of autonomous driving models is high and the accuracy is low, especially when processing difficult examples. Manual annotation is costly, while the annotation accuracy of deep learning models is not as accurate as manual annotation, and edge scenes are difficult to appear in the data collection.

Method used

By obtaining the image of the driving scene for 3D reconstruction, we determine the target objects, such as vehicles and people, and generate a 3D model with contour lines, replace the objects in the original 3D image, and finally project the updated 3D image into a 2D image. Generate data with high graphical clarity and annotation accuracy.

Benefits of technology

It achieves two-dimensional images with low generation cost and high annotation accuracy, reduces the cost of data annotation, and improves the clarity of the image and the accuracy of annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114299230B
    Figure CN114299230B
Patent Text Reader

Abstract

The present invention relates to the field of visual reconstruction technology, and discloses a data generation method, device, electronic device and storage medium. The data generation method can generate a two-dimensional image by directly constructing a three-dimensional model of a target object with contour lines, and replacing the object in a three-dimensional image generated based on a collected image with the three-dimensional model, and then projecting the updated three-dimensional image, and the two-dimensional image includes an object identifier. The data generation method provided by the present application has the characteristics of high annotation accuracy and low generation cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual reconstruction technology, and in particular to a data generation method, device, electronic device and storage medium. Background Art

[0002] Usually, when training an autonomous driving model, the data is divided into a training set and a test set. The training set is used to fit the model and train the model by setting parameters. The test set is used to predict the validation set data using each model after multiple models are trained through the training set, and the model accuracy is recorded in order to find the best model; the parameters corresponding to the best model are selected, that is, used to adjust the model parameters.

[0003] At present, the data sets of autonomous driving models are mainly formed by manual annotation based on collected pictures or videos; however, the cost of annotating data is very high. Generally, if an autonomous driving model needs to be trained sufficiently, it will cost tens of millions of dollars for manual annotation.

[0004] Another solution is to use very deep neural network models to replace manual labeling. However, this solution has two disadvantages: 1) The accuracy of labeling using deep learning models is still not as good as manual labeling, especially in the processing of difficult examples; 2) The data comes from the real world, and some edge scenarios (i.e. rare scenarios) are difficult to appear in the data set. Summary of the invention

[0005] The present invention aims to solve the technical problems of high labeling cost and low accuracy in the above-mentioned prior art.

[0006] In order to solve the above technical problems, the present application discloses, on one hand, a data generation method, which comprises:

[0007] Acquire an image of a driving scene;

[0008] Performing a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; the position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image;

[0009] Determine a first target object in the three-dimensional image; the first target object includes a vehicle and / or a person;

[0010] Generate a second target object based on the first target object, where the second target object is a three-dimensional model with a contour line;

[0011] replacing the first target object in the three-dimensional image with the second target object based on the position coordinate set to generate an updated three-dimensional image;

[0012] The updated three-dimensional image is projected into a two-dimensional image, which contains the object identification.

[0013] Optionally, generating the second target object based on the first target object includes:

[0014] Determining identification information of the first target object;

[0015] Determine a target three-dimensional model from a gallery based on the identification information;

[0016] A contour frame adding operation is performed on the target three-dimensional model to obtain the second target object.

[0017] Optionally, replacing the first target object in the three-dimensional image with the second target object based on the position coordinate set to generate an updated three-dimensional image includes:

[0018] Determining the position coordinates of the first target object from the three-dimensional image based on the position coordinate set;

[0019] removing the first target object in the three-dimensional image to generate a target three-dimensional image;

[0020] Determining the position coordinates of the first target object as the position coordinates of the second target object;

[0021] The second target object is added to the target three-dimensional image based on the position coordinates of the second target object to obtain the updated three-dimensional image.

[0022] Optionally, acquiring an image of a driving scene includes:

[0023] Using a binocular camera to collect an image of the driving scene; the binocular camera includes a first camera and a second camera;

[0024] The image includes a first image captured by the first camera and a second image captured by the second camera; the first image and the second image are captured at the same time.

[0025] Optionally, the image is subjected to a three-dimensional reconstruction operation to obtain a three-dimensional image and a position coordinate set, including:

[0026] Determine a first data set based on the first image; the first data set includes pixel coordinates of each first feature point in a plurality of first feature points, and the first feature point belongs to the first image;

[0027] Determine a second data set based on the second image, the second data set including pixel coordinates of each second feature point in a plurality of second feature points, the second feature point belonging to the second image;

[0028] Determine the internal and external parameters of the first camera and the internal and external parameters of the second camera; the internal parameters of the first camera are equal to the internal parameters of the second camera;

[0029] Determine the position coordinate set based on the internal and external parameters of the first camera, the internal and external parameters of the second camera, the first data set, and the second data set;

[0030] A three-dimensional reconstruction operation is performed on the image based on the position coordinate set to obtain the three-dimensional image.

[0031] Optionally, determining the position coordinate set based on the internal and external parameters of the first camera, the internal and external parameters of the second camera, the first data set, and the second data set includes:

[0032] Determining epipolar constraints according to the intrinsic and extrinsic parameters of the first camera, the intrinsic and extrinsic parameters of the second camera, the first data set, and the second data set;

[0033] Performing feature matching on the first data set and the second data set to obtain a feature point pair set; the feature point pair set includes a plurality of feature point pairs; each feature point pair in the plurality of feature point pairs includes the corresponding first feature point and the second feature point;

[0034] Filtering a target feature point pair set from the feature point pair set based on the epipolar constraint condition;

[0035] Determine a target feature point set from the first data set based on the target feature point pair set; the target feature point set includes pixel coordinates of each target first feature point in a plurality of target first feature points;

[0036] Determine the target three-dimensional coordinate set according to the target feature point set and the internal and external parameters of the first camera, the target three-dimensional coordinate set including the three-dimensional coordinates of the first feature point of each target;

[0037] The target three-dimensional coordinate set is determined as the position coordinate set.

[0038] Optionally, acquiring an image of a driving scene includes:

[0039] Using acquisition equipment to acquire images of driving scenes;

[0040] The image is subjected to a three-dimensional reconstruction operation to obtain a three-dimensional image and a position coordinate set, including:

[0041] Obtaining location information of the acquisition device;

[0042] Determine a point cloud data set corresponding to the image from a high-precision map based on the location information of the acquisition device and the image;

[0043] The three-dimensional image and the position coordinate set are generated based on the point cloud data set.

[0044] In another aspect, the present application further discloses a data generating device, comprising:

[0045] An acquisition module, used for acquiring images of driving scenes;

[0046] A reconstruction module, used for performing a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; the position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image;

[0047] A determination module, configured to determine a first target object in the three-dimensional image; the first target object includes a vehicle and / or a person;

[0048] A target object generating module, used to generate a second target object based on the first target object, wherein the second target object is a three-dimensional model having a contour line;

[0049] A three-dimensional image generation module, configured to replace the first target object in the three-dimensional image with the second target object based on the position coordinate set to generate an updated three-dimensional image;

[0050] The projection module is used to project the updated three-dimensional image into a two-dimensional image, where the two-dimensional image contains the object identifier.

[0051] On the other hand, the present application also discloses an electronic device, which includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above-mentioned data generation method.

[0052] On the other hand, the present application further discloses a computer storage medium, in which at least one instruction or at least one program is stored. The at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned data generation method.

[0053] By adopting the above technical solution, the data generation method provided by this application has the following beneficial effects:

[0054] The present application obtains an image of a driving scene and performs a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; the position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image; a first target object in the three-dimensional image is determined; the first target object includes a vehicle and / or a person; a second target object is subsequently generated based on the first target object, and the second target object is a three-dimensional model with a contour line; the first target object in the three-dimensional image is replaced with the second target object based on the position coordinate set to generate an updated three-dimensional image; the updated three-dimensional image is projected into a two-dimensional image, and the two-dimensional image contains an object identifier. That is, the data generation method provided by the present application can generate a two-dimensional image by directly constructing a three-dimensional model of a target object with a contour line, replacing the object in the original three-dimensional image with the three-dimensional model, and then projecting it, so that the generated two-dimensional image has the advantages of high graphic clarity, high annotation accuracy and low generation cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0056] Figure 1 An optional application scenario diagram for this application;

[0057] Figure 2 This is a flowchart of the first optional data generation method of the present application;

[0058] Figure 3 A schematic diagram of an optional three-dimensional image provided for this application;

[0059] Figure 4 This is a flowchart of the second optional data generation method of this application;

[0060] Figure 5 This is a flowchart of the third optional data generation method of this application;

[0061] Figure 6 An optional binocular camera model provided for this application;

[0062] Figure 7 A schematic diagram of an optional updated three-dimensional image provided for the present application;

[0063] Figure 8 It is a two-dimensional image after annotation in the prior art;

[0064] Fig. 9 An optional model of a three-dimensional image projected into a two-dimensional image for this application;

[0065] Fig.10 A schematic diagram of an optional process of converting three-dimensional coordinates into pixel coordinates provided by the present application;

[0066] Fig.11 This is a schematic diagram of the structure of an optional data generating device of the present application;

[0067] Fig.12 This is a hardware structure block diagram of a server for an optional data generation method of the present application.

[0068] The following is a supplementary description of the attached drawings:

[0069] 10-terminal; 20-data generation module. DETAILED DESCRIPTION

[0070] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0071] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0072] like Figure 1 As shown, Figure 1This is an optional application scenario diagram of the present application. The scenario includes a terminal 10 and a data generation module 20 located on the terminal 10, the data generation module 20 is used to obtain an image of a driving scene, and perform a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; the position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image; by determining a first target object in the three-dimensional image; the first target object includes a vehicle and / or a person; subsequently generating a second target object based on the first target object, the second target object being a three-dimensional model with a contour line; replacing the first target object in the three-dimensional image with the second target object based on the position coordinate set to generate an updated three-dimensional image; projecting the updated three-dimensional image into a two-dimensional image, the two-dimensional image containing an object identifier. Thus, the generated two-dimensional image has the advantages of high graphic clarity, high annotation accuracy and low generation cost.

[0073] Optionally, the terminal may be a physical device of the type of a desktop computer, a laptop computer, a mobile phone, a tablet computer, a digital assistant, a smart wearable device, etc.; among which, the smart wearable device may include a smart bracelet, a smart watch, smart glasses, a smart helmet, etc.

[0074] The terminal may include a display screen, a storage device and a processor connected via a data bus. The display screen is used for displaying the virtual image of the device to be monitored and the connection relationship between the various sub-devices in the device to be monitored. The display screen may be a touch screen of a mobile phone or a tablet computer. The storage device is used to store the program code and data of the shooting device. The storage device may be a memory of the terminal, or a storage device such as a smart media card, a secure digital card, or a flash card. The processor may be a single-core or multi-core processor.

[0075] The following describes a specific embodiment of a data generation method of the present application. Figure 2 This is a flowchart of the first optional data generation method of the present application. This specification provides method operation steps such as the embodiments or flowcharts, but may include more or fewer operation steps based on conventional or non-creative work. The order of steps listed in the embodiments is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in the order shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2 As shown, the method may include:

[0076] S201: Acquire an image of a driving scene.

[0077] In a possible implementation, step S201 may be specifically described as: acquiring an image of the driving scene by using a collection device.

[0078] Optionally, the acquisition equipment includes a high-definition camera, a global positioning system (GPS), an inertial measurement unit (IMU), a camera, a lidar, an ultrasonic radar, and a millimeter-wave radar.

[0079] The collection equipment is installed on the collection vehicle, which also needs to be equipped with industrial computers, video cards, Ethernet and other data collection devices. Some collection vehicles with real-time uploading functions will also be equipped with a telematics box (T-box).

[0080] Optionally, the camera includes a monocular camera and a binocular camera.

[0081] It should be noted that, in the embodiment of the present application, corresponding collection equipment can be set on the collection vehicle according to the subsequent data type.

[0082] In a possible implementation, step S201 can be specifically described as: using a binocular camera to capture an image of the driving scene; the binocular camera includes a first camera and a second camera, and the image includes a first image captured by the first camera and a second image captured by the second camera; the first image and the second image are captured at the same time, so that three-dimensional reconstruction can be achieved later based on the first image and the second image.

[0083] S202: Perform a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; the position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image.

[0084] Optional, see Figure 3 , Figure 3 A schematic diagram of an optional three-dimensional image provided for this application.

[0085] There are multiple ways to perform 3D reconstruction based on images in the above step S202, such as binocular reconstruction, monocular reconstruction, and 3D reconstruction based on high-precision maps; among them, monocular reconstruction is a 3D reconstruction completed using a series of images in the time domain, also known as dynamic stereo vision. According to the real-time nature of the reconstruction, monocular reconstruction can be divided into offline reconstruction and online reconstruction; offline reproduction includes the Structure from Motion (SFM) technology, which reconstructs a 3D environment based on continuous images obtained over a period of time.

[0086] Online reconstruction can be divided into progressive reconstruction and direct reconstruction. Progressive reconstruction uses the image of the next moment to continuously fuse the previous three-dimensional information, which is similar to the idea of ​​Kalman filtering. In fact, three-dimensional reconstruction is also deep reconstruction. Therefore, progressive reconstruction is also called deep filtering. Direct reconstruction uses images of several moments (generally a few to dozens of frames) to complete the three-dimensional reconstruction of the same scene at one time. Direct reconstruction is also called deep fusion, which is somewhat similar to the above-mentioned SFM. Unlike SFM, it involves fewer images in the calculation and has higher real-time performance.

[0087] Optionally, the present application embodiment is mainly based on binocular reconstruction and three-dimensional reconstruction of high-precision maps. In a possible implementation, refer to Figure 4 , Figure 4 This is a flow chart of the second optional data generation method of the present application. Step S202 can be specifically described as follows:

[0088] S401: Determine a first data set based on the first image; the first data set includes pixel coordinates of each first feature point in a plurality of first feature points, and the first feature point belongs to the first image.

[0089] S402: Determine a second data set based on the second image, where the second data set includes pixel coordinates of each second feature point in a plurality of second feature points, and the second feature point belongs to the second image.

[0090] S403: Determine the internal and external parameters of the first camera and the internal and external parameters of the second camera; the internal parameters of the first camera are equal to the internal parameters of the second camera.

[0091] Optionally, in an embodiment of the present application, when using the first camera and the second camera to acquire images, the first camera and the second camera can be calibrated first. The calibration method can adopt Zhang Zhengyou's camera calibration method to obtain the intrinsic parameters and extrinsic parameters of the first camera, as well as the intrinsic parameters and extrinsic parameters of the second camera.

[0092] S404: Determine the position coordinate set based on the intrinsic and extrinsic parameters of the first camera, the intrinsic and extrinsic parameters of the second camera, the first data set, and the second data set.

[0093] In a possible implementation, see Figure 5 , Figure 5 This is a flowchart of the third optional data generation method of this application. Step S304 can be specifically described as follows:

[0094] S501: Determine epipolar constraints according to the intrinsic and extrinsic parameters of the first camera, the intrinsic and extrinsic parameters of the second camera, the first data set, and the second data set;

[0095] Optionally, the epipolar constraint can be:

[0096]

[0097] Where x'1 = K -1 x1, x'2 = K -1 x2, x1 are the pixel coordinates of the first feature point in the first data set; x2 are the pixel coordinates of the second feature point in the second data set; is a three-dimensional vector obtained by taking the outer product of x'2 and T2, and the three-dimensional vector is perpendicular to x'2 and T2; R2 is the rotation parameter in the external parameters of the second camera; T2 is the translation parameter in the external parameters of the second camera.

[0098] The following is a description of the determination process of obtaining the above formula (1):

[0099] See also Figure 6 , Figure 6 An optional binocular camera model provided for this application. Wherein, O1 and O2 are the center of the first camera and the center of the second camera respectively; the gray area in the figure is the imaging plane of the first camera and the imaging plane of the second camera; where x1 is the pixel point corresponding to a spatial object point P in the imaging plane of the first camera; the three-dimensional coordinates of P are (X, Y, Z); similarly, x1 is the pixel point corresponding to a spatial object point P in the imaging plane of the first camera; let the vertical distances from X to the image planes of the two cameras be s1 and s2 respectively; let the internal parameters of the two cameras be K, the external parameter matrix of the first camera be [R1 T1], and the external parameter matrix of the second camera be [R2 T2], then the following formulas (2) and (3) can be obtained:

[0100] s1x1=K(R1X+T1)……Formula (2)

[0101] s2x2=K(R2X+T2)……Formula (3)

[0102] Since K is a reversible matrix, by multiplying formula (2) and formula (3) by the inverse of K, we can obtain formula (4) and formula (5):

[0103] s1K -1 x1=R1X+T1……Formula (4)

[0104] s2K -1 x2=R2X+T2……Formula (5)

[0105] Let x'1=K -1 x1, x'2 = K -1 x2, then formula (4) and formula (5) can be converted to formula (6) and formula (7) respectively:

[0106] s1x1'=R1X+T1...Formula (6)

[0107] s2x2'=R2X+T2...Formula (7)

[0108] Since the world coordinate system can be selected arbitrarily, the world coordinate system can be selected as the camera coordinate system of the first camera, then R1 = 1, T1 = 0. Based on formula (6), the following formula is obtained:

[0109] s1x1'=X...Formula (8)

[0110] Substituting formula (8) into formula (7), we can obtain:

[0111] s2x2'=s1R2x1'+T2...Formula (9)

[0112] Since x'2 and T2 are both three-dimensional vectors, we can get another three-dimensional vector by doing the outer product (cross product) This three-dimensional vector is perpendicular to x'2 and T2, and then Taking the inner product of both sides of formula (9), we can get the above formula (1).

[0113] S502: Perform feature matching on the first data set and the second data set to obtain a feature point pair set; the feature point pair set includes a plurality of feature point pairs; each feature point pair in the plurality of feature point pairs includes the corresponding first feature point and the second feature point.

[0114] S503: Filtering out a target feature point pair set from the feature point pair set based on the epipolar constraint condition.

[0115] That is to say, by substituting the pixel coordinates of the first feature point in the feature point pair into the above formula (1), the pixel coordinates of the corresponding target second feature point can be determined. If the deviation between the pixel coordinates of the target second feature point and the second feature point in the feature point pair is less than or equal to a preset threshold, it can be determined that the match is successful and the feature point pair is the target feature point pair. Otherwise, the feature point pair is a non-target feature point pair.

[0116] S504: Determine a target feature point set from the first data set based on the target feature point pair set. The target feature point set includes the pixel coordinates of each target first feature point in the plurality of target first feature points.

[0117] S505: Determine the target three-dimensional coordinate set according to the target feature point set and the internal and external parameters of the first camera, where the target three-dimensional coordinate set includes the three-dimensional coordinates of the first feature point of each target.

[0118] It should be noted that, in the embodiment of the present application, the three-dimensional coordinates involved may be the three-dimensional coordinates in the world coordinate system of the acquisition device, and step S505 may be specifically expressed as: a first coordinate conversion rule may be determined based on the internal and external parameters of the first camera, and based on the first conversion rule, the pixel coordinates of each target first feature point in the target feature point set may be converted into the three-dimensional coordinates of the target first feature point.

[0119] Optionally, the three-dimensional coordinates may also be three-dimensional coordinates in the earth coordinate system, and step S505 may be specifically expressed as follows: a first coordinate conversion rule is determined based on the internal and external parameters of the first camera, and based on the first conversion rule, the pixel coordinates of each target first feature point in the target feature point set may be converted into the three-dimensional coordinates of the target first feature point in the world coordinate system of the acquisition device, and the relative position information of the target first feature point and the acquisition device is determined based on the three-dimensional coordinates of the target first feature point in the world coordinate system of the acquisition device, and the three-dimensional coordinates of the acquisition device in the earth coordinate system (for example, GPS) are obtained, and the three-dimensional coordinates of the target first feature point in the earth coordinate system are determined based on the three-dimensional coordinates of the acquisition device in the earth coordinate system and the relative position information of the target first feature point and the acquisition device, to obtain the target three-dimensional coordinate set.

[0120] Optionally, the GPS information of the above-mentioned collection device can be based on first obtaining the three-dimensional coordinates of the collection vehicle in the earth coordinate system and the relative position information between the center of the collection vehicle and the collection device, and determining the three-dimensional coordinates of the collection device in the earth coordinate system based on the three-dimensional coordinate information of the collection vehicle in the earth coordinate system and the relative position information between the two, that is, the GPS information of the collection device, which can also be referred to as the position information of the collection device hereinafter.

[0121] S506: Determine the target three-dimensional coordinate set as the position coordinate set.

[0122] S405: Perform a three-dimensional reconstruction operation on the image based on the position coordinate set to obtain the three-dimensional image.

[0123] It should be noted that if the three-dimensional coordinates of each feature point in the position coordinate set in step S405 are the coordinates in the world coordinate system of the acquisition device, then step S405 can be specifically explained as: based on the three-dimensional coordinates of each feature point in the world coordinate system of the acquisition device, determine the relative position information of the first feature point of the target and the acquisition device, obtain the three-dimensional coordinates of the acquisition device in the earth coordinate system (such as GPS), determine the three-dimensional coordinates of each feature point in the earth coordinate system based on the three-dimensional coordinates of the acquisition device in the earth coordinate system and the relative position information of each feature point and the acquisition device, and obtain the target position coordinate set; perform a three-dimensional reconstruction operation on the image based on the target position coordinate set to obtain the three-dimensional image.

[0124] By further analyzing the above formula (1), it can be seen that formula (1) is the relationship satisfied by the images of the same point P in the two cameras. It has nothing to do with the spatial coordinates of point P and the distance from the point to the camera. That is, formula (1) is called the epipolar constraint condition, and the matrix therein is called the eigenmatrix about the two cameras. It can be seen from this that if we know multiple corresponding points in the two images (for example, at least 5 pairs), the matrix can be solved by the above formula. The matrix is ​​composed of R2 and T2, and then R2 and T2 can be solved. Subsequently, the feature point pairs can be screened based on the above formula (1), and the pixel coordinates of the target feature point can be converted into the three-dimensional coordinates of the target first feature point based on K, R2 and T2 to obtain a position coordinate set; that is, in another optional implementation, the above steps S303-S304 can be specifically described as: determining the epipolar constraint condition based on the first data set and the second data set; determining the external parameters of the second camera based on the epipolar constraint condition; performing feature matching on the first data set and the second data set to obtain a feature point pair set; the feature point pair set includes multiple feature point pairs; each feature point pair in the multiple feature point pairs includes the corresponding first feature point and the second feature point; based on the epipolar constraint condition, a target feature point pair set is screened from the feature point pair set; based on the target feature point pair set, a target feature point pair set is determined from the second data set. The target feature point set includes the pixel coordinates of each target second feature point among multiple target second feature points; the internal parameters of the second camera are obtained; the target three-dimensional coordinate set is determined according to the target feature point set and the internal and external parameters of the second camera, and the target three-dimensional coordinate set includes the three-dimensional coordinates of each target second feature point; the target three-dimensional coordinate set is determined as the position coordinate set. Since the external parameters of the second camera can be directly solved based on the known second data set and multiple feature point pairs in the first data set, the pixel coordinates of the target second feature point can be converted into three-dimensional coordinates in the world coordinate system as long as the internal parameters of the second camera are determined; the steps of three-dimensional coordinate conversion are simplified, and data processing efficiency is improved.

[0125] Optionally, OpenCV technology may be used to obtain a coordinate set corresponding to the position coordinate set in a 3D environment; and then three-dimensional reconstruction may be performed.

[0126] Optionally, when the feature points of the first image and the second image are matched to form a feature point pair set, when the first image and the second image are quite different, a scale-invariant feature transform (SIFT) method can be used to ensure that the accuracy of the matched feature point pair is high, but it has the disadvantage of low processing efficiency. Therefore, when the difference between the first image and the second image is small, other faster features can be used, such as Speeded Up Robust Features (SURF), Oriented Fast and Rotated Brief (ORB) algorithm, etc.

[0127] In order to further improve data processing efficiency, in another possible implementation, step S202 can be specifically explained as: obtaining the location information of the acquisition device, determining the point cloud data set corresponding to the image from the high-precision map based on the location information of the acquisition device and the image, and generating the three-dimensional image and the location coordinate set based on the point cloud data set.

[0128] Optionally, by determining the acquisition time, a point cloud data set containing vehicles, people and road scenes can be directly determined from the high-precision map, so that a three-dimensional image and a position coordinate set can be directly generated.

[0129] In order to improve the application flexibility of the data generation method, in another possible implementation, steps S202-S203 can be specifically explained as: obtaining the position information of the acquisition device, determining a point cloud dataset of a second target object in the image from a high-precision map based on the position information of the acquisition device and the image, determining a first target object in the image and pixel coordinates of the first target object, obtaining a first coordinate conversion rule, converting the pixel coordinates of the first target object into three-dimensional coordinates of the first target object in a world coordinate system of the acquisition device based on the first coordinate conversion rule, determining relative position information of the first target object and the acquisition device based on the three-dimensional coordinates of the first target object in the world coordinate system of the acquisition device, determining the three-dimensional coordinates of the first target object in the earth coordinate system based on the relative position information of the first target object and the acquisition device and the position information of the acquisition device, and generating a three-dimensional image and a position coordinate set based on the three-dimensional coordinates of the first target object in the earth coordinate system and the point cloud dataset.

[0130] Optionally, the acquisition device is a camera, and the first coordinate transformation rule is determined based on internal and external parameters of the camera.

[0131] Optionally, the second target object includes a road scene, such as a road surface, road surface markings, street lights, etc.

[0132] S203: Determine a first target object in the three-dimensional image; the first target object includes a vehicle and / or a person.

[0133] Optionally, step S203 may be specifically described as: determining the first target object from the three-dimensional image using a target detection algorithm, wherein the target detection algorithm includes Faster R-CNN, SSD, and YOLO.

[0134] S204: Generate a second target object based on the first target object, where the second target object is a three-dimensional model with a contour line.

[0135] In a possible implementation, step S204 may be specifically described as: determining the identification information of the first target object, determining a target three-dimensional model from the image library based on the identification information, performing a contour frame adding operation on the target three-dimensional model to obtain the second target object, referring to Figure 6 , Figure 6 A schematic diagram of an optional target three-dimensional model provided for this application.

[0136] It should be noted that after adding a contour box to the target three-dimensional module, the coordinates of each point on the contour box can be obtained; if needed, the scene of the three-dimensional image can also be adjusted, such as trees, road signs, and corresponding shadows, so as to improve the diversity of the data; the first target object also includes obstacles, cyclists; such as railings, road cones, etc.; at the same time, we can add non-naturally generated target points according to special needs, such as a large number of pedestrians, random traffic flows, certain buildings, etc.

[0137] S205: replacing the first target object in the three-dimensional image with the second target object based on the position coordinate set to generate an updated three-dimensional image.

[0138] In a possible implementation manner, step S205 can be specifically represented as: determining the position coordinates of the first target object from the three-dimensional image based on the position coordinate set, removing the first target object from the three-dimensional image, generating a target three-dimensional image, determining the position coordinates of the first target object as the position coordinates of the second target object, adding the second target object to the target three-dimensional image based on the position coordinates of the second target object, and obtaining the updated three-dimensional image, see Figure 7 , Figure 7 A schematic diagram of an optional updated three-dimensional image provided for the present application.

[0139] S206: Project the updated three-dimensional image into a two-dimensional image, where the two-dimensional image contains the object identifier. Figure 8 , Figure 8 It is a two-dimensional image after annotation in the prior art.

[0140] Optional, see Fig. 9 , Fig. 9 An optional model for projecting a three-dimensional image into a two-dimensional image is provided for this application. Fig. 9 It can be seen that according to the theory of similar triangles, the coordinates of (x, y, z) on the projection plane are (x', y', -d), x' = -dx / z, y' = -dy / z. Since z is a variable, this is not a linear transformation. By adding a homogeneous term, we can complete the projection through linear operations of the matrix in the homogeneous coordinate system. The process can be seen in Fig.10 , Fig.10 A schematic diagram of an optional process of converting three-dimensional coordinates into pixel coordinates provided in this application. Among them, the first matrix is:

[0141]

[0142] The 1 in the first matrix is ​​the homogeneous term, (x, y, z) is the three-dimensional coordinate of the first feature point of the target, (u, v) is the coordinate of the first feature point of the target on the image, and f is the focal length of the camera.

[0143] See also Fig.11 , Fig.11 The present application also discloses a data generating device, including:

[0144] An acquisition module 1101 is used to acquire an image of a driving scene;

[0145] A reconstruction module 1102 is used to perform a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; the position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image;

[0146] The determination module 1103 is used to determine a first target object in the three-dimensional image; the first target object includes a vehicle and / or a person;

[0147] A target object generating module 1104 is used to generate a second target object based on the first target object, where the second target object is a three-dimensional model with a contour line;

[0148] A three-dimensional image generating module 1105, configured to replace the first target object in the three-dimensional image with the second target object based on the position coordinate set, to generate an updated three-dimensional image;

[0149] The projection module 1106 is configured to project the updated three-dimensional image into a two-dimensional image, where the two-dimensional image includes the object identifier.

[0150] In a possible implementation, the target object generation module is used to determine the identification information of the first target object; determine the target three-dimensional model from the gallery based on the identification information; and perform a contour frame adding operation on the target three-dimensional model to obtain the second target object.

[0151] In a possible implementation, the three-dimensional image generation module is used to determine the position coordinates of the first target object from the three-dimensional image based on the position coordinate set; remove the first target object from the three-dimensional image to generate a target three-dimensional image; determine the position coordinates of the first target object as the position coordinates of the second target object; and add the second target object to the target three-dimensional image based on the position coordinates of the second target object to obtain the updated three-dimensional image.

[0152] In a possible implementation, an acquisition module is used to capture an image of the driving scene using a binocular camera; the binocular camera includes a first camera and a second camera; the image includes a first image captured by the first camera and a second image captured by the second camera; and the time of capturing the first image and the second image is the same.

[0153] In a possible implementation, a reconstruction module is used to determine a first data set based on the first image; the first data set includes the pixel coordinates of each first feature point among a plurality of first feature points, and the first feature point belongs to the first image; determine a second data set based on the second image, and the second data set includes the pixel coordinates of each second feature point among a plurality of second feature points, and the second feature point belongs to the second image; determine the internal and external parameters of the first camera and the internal and external parameters of the second camera; the internal parameter of the first camera is equal to the internal parameter of the second camera; determine the position coordinate set based on the internal and external parameters of the first camera, the internal and external parameters of the second camera, the first data set, and the second data set; perform a three-dimensional reconstruction operation on the image based on the position coordinate set to obtain the three-dimensional image.

[0154] In a possible implementation, a reconstruction module is used to determine an epipolar constraint condition based on the internal and external parameters of the first camera, the internal and external parameters of the second camera, the first data set, and the second data set; perform feature matching on the first data set and the second data set to obtain a feature point pair set; the feature point pair set includes multiple feature point pairs; each feature point pair in the multiple feature point pairs includes the corresponding first feature point and the second feature point; based on the epipolar constraint condition, a target feature point pair set is screened out from the feature point pair set; based on the target feature point pair set, a target feature point set is determined from the first data set; the target feature point set includes the pixel coordinates of each target first feature point in multiple target first feature points; the target three-dimensional coordinate set is determined based on the target feature point set and the internal and external parameters of the first camera, the target three-dimensional coordinate set includes the three-dimensional coordinates of each target first feature point; the target three-dimensional coordinate set is determined as the position coordinate set.

[0155] In a possible implementation, the acquisition module is used to acquire an image of the driving scene using an acquisition device;

[0156] A reconstruction module is used to obtain the location information of the acquisition device; determine the point cloud data set corresponding to the image from the high-precision map based on the location information of the acquisition device and the image; and generate the three-dimensional image and the location coordinate set based on the point cloud data set.

[0157] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig.12 This is a hardware structure diagram of a server of an optional data generation method of the present application. Fig.12As shown, the server 1200 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1210 (the central processing unit 1210 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1230 for storing data, and one or more storage media 1220 (such as one or more mass storage devices) for storing application programs 1223 or data 1222. Among them, the memory 1230 and the storage medium 1220 can be short-term storage or permanent storage. The program stored in the storage medium 1220 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1210 can be configured to communicate with the storage medium 1220 and execute a series of instruction operations in the storage medium 1220 on the server 1200. The server 1200 may also include one or more power supplies 1260, one or more wired or wireless network interfaces 1250, one or more input and output interfaces 1240, and / or one or more operating systems 1221, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0158] The input / output interface 1240 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 1200. In one example, the input / output interface 1240 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 1240 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0159] It can be understood by those skilled in the art that Fig.12 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.12 More or fewer components as shown, or with Fig.12 Different configurations are shown.

[0160] An embodiment of the present application also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the data generation method as described above.

[0161] An embodiment of the present application also provides a computer storage medium, which can be set in a server to store at least one instruction, at least one program, code set or instruction set related to a data generation method in an implementation method embodiment. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the above-mentioned data generation method.

[0162] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0163] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0164] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0165] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0166] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A data generation method, characterized in that: include: Acquire an image of a driving scene; Performing a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; The position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image; Determine a first target object in the three-dimensional image; the first target object includes a vehicle and / or a person; generating a second target object based on the first target object, wherein the second target object is a three-dimensional model having a contour line; replacing the first target object in the three-dimensional image with the second target object based on the position coordinate set to generate an updated three-dimensional image; The updated three-dimensional image is projected into a two-dimensional image, wherein the two-dimensional image includes the object identification.

2. The data generation method according to claim 1, characterized in that: The generating a second target object based on the first target object comprises: Determining identification information of the first target object; Determining a target three-dimensional model from a gallery based on the identification information; A contour frame adding operation is performed on the target three-dimensional model to obtain the second target object.

3. The data generation method according to claim 1, characterized in that: The replacing the first target object in the three-dimensional image with the second target object based on the position coordinate set to generate an updated three-dimensional image includes: Determining the position coordinates of the first target object from the three-dimensional image based on the position coordinate set; removing the first target object in the three-dimensional image to generate a target three-dimensional image; determining the position coordinates of the first target object as the position coordinates of the second target object; The second target object is added to the target three-dimensional image based on the position coordinates of the second target object to obtain the updated three-dimensional image.

4. The data generation method according to any one of claims 1 to 3, characterized in that: The step of acquiring an image of a driving scene comprises: Using a binocular camera to collect images of the driving scene; the binocular camera includes a first camera and a second camera; The images include a first image captured by the first camera and a second image captured by the second camera; the first image and the second image are captured at the same time.

5. The data generation method according to claim 4, characterized in that: The performing a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set includes: Determine a first data set based on the first image; the first data set includes pixel coordinates of each first feature point in a plurality of first feature points, and the first feature points belong to the first image; determining a second data set based on the second image, the second data set including pixel coordinates of each second feature point in a plurality of second feature points, the second feature points belonging to the second image; Determine the internal and external parameters of the first camera and the internal and external parameters of the second camera; the internal parameters of the first camera are equal to the internal parameters of the second camera; Determine the position coordinate set based on the intrinsic and extrinsic parameters of the first camera, the intrinsic and extrinsic parameters of the second camera, the first data set, and the second data set; A three-dimensional reconstruction operation is performed on the image based on the position coordinate set to obtain the three-dimensional image.

6. The data generation method according to claim 5, characterized in that: The determining the position coordinate set based on the internal and external parameters of the first camera, the internal and external parameters of the second camera, the first data set, and the second data set includes: Determining epipolar constraints according to the intrinsic and extrinsic parameters of the first camera, the intrinsic and extrinsic parameters of the second camera, the first data set, and the second data set; Performing feature matching on the first data set and the second data set to obtain a feature point pair set; the feature point pair set includes a plurality of feature point pairs; each feature point pair in the plurality of feature point pairs includes the corresponding first feature point and the second feature point; Filtering out a target feature point pair set from the feature point pair set based on the epipolar constraint condition; Determine a target feature point set from the first data set based on the target feature point pair set; the target feature point set includes pixel coordinates of each target first feature point in a plurality of target first feature points; Determine a target three-dimensional coordinate set according to the target feature point set and the internal and external parameters of the first camera, wherein the target three-dimensional coordinate set includes the three-dimensional coordinates of the first feature point of each target; The target three-dimensional coordinate set is determined as the position coordinate set.

7. The data generation method according to claim 1, characterized in that: The step of acquiring an image of a driving scene comprises: Using acquisition equipment to acquire images of driving scenes; The performing a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set includes: Obtaining location information of the acquisition device; Determining a point cloud data set corresponding to the image from a high-precision map based on the location information of the acquisition device and the image; The three-dimensional image and the position coordinate set are generated based on the point cloud data set.

8. A data generating device, characterized in that: include: An acquisition module, used for acquiring images of driving scenes; A reconstruction module, used for performing a three-dimensional reconstruction operation on the image to obtain a three-dimensional image and a position coordinate set; The position coordinate set includes the three-dimensional coordinates of each feature point in a plurality of feature points; the plurality of feature points belong to the three-dimensional image; A determination module, configured to determine a first target object in the three-dimensional image; The first target object includes a vehicle and / or a person; A target object generating module, configured to generate a second target object based on the first target object, wherein the second target object is a three-dimensional model having a contour line; a three-dimensional image generation module, configured to replace the first target object in the three-dimensional image with the second target object based on the position coordinate set, so as to generate an updated three-dimensional image; The projection module is used to project the updated three-dimensional image into a two-dimensional image, wherein the two-dimensional image contains the object identifier.

9. An electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the data generation method as described in any one of claims 1-7.

10. A computer storage medium, characterized in that: The computer storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the data generation method according to any one of claims 1 to 7.