Data synthesis method and system, road sign synthesis method and system and readable storage medium
By obtaining the 2D pixel coordinates of the background image and generating 3D world coordinates, combined with 3D model rendering, the problem of insufficient realism and diversity in data synthesis in the field of autonomous driving is solved, and high-quality 3D and 2D data generation and labeling automation are achieved. Batch synthesis.
Patent Information
- Application Number
- CN202410753040.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-06
AI Technical Summary
Existing data synthesis methods are difficult to generate road signs and lighting and shadow effects that simulate the complexity of the real world, resulting in a lack of realism and diversity in perception algorithm training data in the field of autonomous driving.
By obtaining the 2D pixel coordinates of the background image, the 3D world coordinates are generated based on the internal and external parameters of the camera, and combined with the 3D model for rendering to generate a synthetic image. Taking into account factors such as lighting, weather, and shadows, the 3D and 2D data are automatically synthesized in batches.
It achieves the generation of more accurate and diverse 3D and 2D data and their labels in the field of autonomous driving, solving the problem of label data shortage without requiring additional annotation data.
Smart Images

Figure CN118608656A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data synthesis method, a road sign synthesis method, a system and a readable storage medium. Background Art
[0002] With the rapid development of computer vision technology, the requirements for perception algorithms in the field of autonomous driving are becoming increasingly stringent. In order to build efficient and iterative algorithm models, algorithm engineers often need a large amount of labeled training data. However, manually labeling massive amounts of data is not only time-consuming and labor-intensive, but also expensive.
[0003] From the perspective of data cost, data augmentation and data synthesis methods have been proposed successively. Although data augmentation methods can improve the diversity of training sample sets, they cannot solve the problem of data categories that do not exist at all in the sample sets.
[0004] Although data synthesis can generate data categories that do not exist in the sample set, in the field of autonomous driving, the research on perception algorithms requires that the labeled training data should take into account the actual driving scenarios and restore the real world as much as possible. However, the image data generated by the data synthesis methods in the existing technology is difficult to reflect the complexity of the real world. The synthesized road signs lack realism, and it is difficult to simulate factors such as lighting and shadow effects that are highly required for visual perception tasks. Therefore, the data synthesis effect is not good. Summary of the invention
[0005] In response to the above technical problems, the present invention provides a data synthesis method, a road sign synthesis method, a system and a readable storage medium, which can solve at least one problem in the above background technology.
[0006] A first aspect of the present invention provides a data synthesis method, comprising: Acquire a background image, and acquire 2D pixel coordinates of an object in the background image; Obtaining and generating 3D world coordinates corresponding to the object based on camera internal and external parameters and the 2D pixel coordinates of the object; A 3D model is obtained, the 3D model is placed on a corresponding 3D world coordinate for rendering, and a composite image is generated based on the background image.
[0007] As an optional implementation manner, the acquiring of the background image and acquiring the 2D pixel coordinates of the object in the background image includes: Get the background image under the preset viewing angle; Performing segmentation processing on the background image to retain a road surface mask in the background image; The 2D pixel coordinates of the object are obtained in the background image based on the prior constraint condition and the road surface mask, where the 2D pixel coordinates of the object are the 2D pixel coordinates of the bottom center of the object.
[0008] As an optional implementation manner, the acquiring and generating the 3D coordinates corresponding to the object based on the camera internal and external parameters and the 2D coordinates of the object includes: Assume that the ground is at a height Z relative to the world coordinate system W =0; According to the camera intrinsic parameters and camera extrinsic parameters, the 3D world coordinates (X W ,Y W ,Z W ), the 3D world coordinate (X W ,Y W ,Z W ) are the coordinates of the center point at the bottom of the 3D model.
[0009] As an optional implementation, after acquiring and generating the 3D world coordinates corresponding to the object based on the camera internal and external parameters and the 2D pixel coordinates of the object, the method further includes: Acquire point cloud data, and filter the point cloud data to retain only point cloud data on the road surface within a preset viewing angle; Filter by (X W ,Y W ) The point cloud data within the preset area centered on the coordinates is the target point cloud data; Using the target point cloud data to fit and generate a target plane equation; Based on (X W ,Y W ) coordinates and the target plane equation to obtain the ground truth height Z' W , and the corrected 3D world coordinates (X W ,Y W ,Z' W ).
[0010] As an optional implementation, obtaining a 3D model, placing the 3D model on a corresponding 3D world coordinate and rendering it, and generating a synthetic image includes: Setting the same internal and external parameters of the camera in the image rendering tool, setting influencing factors as needed, and obtaining a 3D model corresponding to the object, wherein the influencing factors include lighting, weather, texture and / or shadow; The 3D model is placed on corresponding 3D world coordinates, and the 3D model is rendered based on the influencing factors.
[0011] As an optional implementation, after placing the 3D model on the corresponding 3D world coordinates for rendering, the method further includes: Acquire multiple 3D sub-models constituting the 3D model, and render the multiple 3D sub-models separately; the object corresponding to the 3D model is composed of the corresponding multiple sub-objects; Based on the rendered image, get the 2D label corresponding to each sub-object.
[0012] A second aspect of the present invention provides a road sign synthesis method, comprising: Acquire a background image, and acquire 2D pixel coordinates of road signs in the background image; Acquire and generate 3D world coordinates corresponding to the road sign based on camera internal and external parameters and the 2D pixel coordinates of the road sign; Acquire a 3D model, place the 3D model on a corresponding 3D world coordinate for rendering, and generate a composite image based on the background image, wherein: The road markings at least include one or more traffic lights and / or one or more traffic signs; The step of acquiring a background image and acquiring 2D pixel coordinates of an object in the background image includes: Get the background image under the preset viewing angle; Performing segmentation processing on the background image to retain a road surface mask in the background image; The coordinates of the candidate positions where the traffic light and / or the traffic sign can be placed are obtained based on the prior constraints and the edge of the road mask, that is, the 2D pixel coordinates.
[0013] As an optional implementation, the 3D model of the traffic light is composed of a light bulb 3D sub-model, a light box 3D sub-model and / or a light pole 3D sub-model, and the 3D model of the traffic sign is composed of a sign 3D sub-model and / or a sign pole 3D sub-model; After placing the 3D model on the corresponding 3D world coordinates for rendering, the method includes: Rendering the light bulb 3D sub-model, the light box 3D sub-model and / or the signboard 3D sub-model separately; Based on the rendered image, 2D labels corresponding to individual light bulbs, light boxes and / or signboards are obtained.
[0014] A third aspect of the present invention provides a data synthesis system, comprising: A 2D coordinate acquisition unit, at least used to acquire a background image, and acquire 2D pixel coordinates of an object in the background image; A 3D coordinate acquisition unit, at least used to acquire and generate a 3D world coordinate corresponding to the object based on the camera internal and external parameters and the 2D pixel coordinates of the object; The image synthesis unit is at least used to obtain a 3D model, place the 3D model on a corresponding 3D world coordinate for rendering, and generate a synthesized image based on the background image.
[0015] As an optional implementation, the data synthesis system further includes a label generation unit, and the label generation unit is at least used for placing the 3D model on the corresponding 3D world coordinates for rendering after the image synthesis unit: A plurality of 3D sub-models constituting the 3D model are obtained, the plurality of 3D sub-models are rendered separately, and a 2D label is obtained; an object corresponding to the 3D model is composed of sub-objects corresponding to the plurality of 3D sub-models.
[0016] A fourth aspect of the present invention provides an electronic device, comprising: At least one processor; and at least one memory in communication with the processor, wherein: the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the data synthesis method as described in the first aspect or the second aspect of the present invention.
[0017] A fifth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the data synthesis method as described in the first aspect or the second aspect of the present invention is executed.
[0018] The present invention obtains 2D pixel coordinates based on a background image, and further obtains 3D world coordinates based on the 2D pixel coordinates and performs rendering, so as to synthesize more accurate 3D and 2D data and their corresponding labels in the field of autonomous driving. In addition, the present invention does not require additional annotation data during the data synthesis process. By using a 3D model in combination with an image rendering tool, new categories of 3D and 2D data can be automatically synthesized in batches, which greatly solves the problem of shortage of image label data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The figure is a flow chart of a data synthesis method in an embodiment of the present invention.
[0020] Figure 2 The figure is a flowchart of another data synthesis method in an embodiment of the present invention.
[0021] Figure 3 The figure is a flowchart of another data synthesis method in an embodiment of the present invention.
[0022] Figure 4 It is a background image of the front view 120 angle that has been distorted in an embodiment of the present invention.
[0023] Figure 5Schematic diagram of a road mask in an embodiment of the present invention.
[0024] Figure 6 Schematic diagram of an approximate straight line segment on an original image in an embodiment of the present invention.
[0025] Figure 7 Schematic diagram of a 2D pixel coordinate group of a candidate position in an embodiment of the present invention.
[0026] Figure 8 It is a schematic diagram of CAD model rendering in an embodiment of the present invention.
[0027] Fig. 9 The figure is a schematic diagram of the effect of data synthesis in an embodiment of the present invention.
[0028] Fig.10 This is another de-distorted background image from the front view 120 perspective according to an embodiment of the present invention.
[0029] Fig.11 The figure is a schematic diagram of a road mask according to an embodiment of the present invention.
[0030] Fig.12 Schematic diagram of a straight line segment along a road in an embodiment of the present invention.
[0031] Fig.13 The figure is a schematic diagram of another image synthesis effect in an embodiment of the present invention.
[0032] Fig.14 The figure is a schematic diagram of a rendering light box in an embodiment of the present invention.
[0033] Fig.15 The figure is a schematic diagram of a rendering bulb in an embodiment of the present invention.
[0034] Fig.16 The figure is a schematic diagram of the effect of data synthesis based on traffic lights in an embodiment of the present invention.
[0035] Fig.17 Schematic diagram of comparison of effects of data synthesis based on traffic lights in an embodiment of the present invention.
[0036] Fig.17 (a) is a schematic diagram of the effect of the first data synthesis based on traffic lights in an embodiment of the present invention.
[0037] Fig.17 (b) is a schematic diagram of the effect of the second data synthesis based on traffic lights in an embodiment of the present invention.
[0038] Fig.18 The figure is a schematic diagram of the effect of data synthesis based on a traffic sign in an embodiment of the present invention.
[0039] Fig.19Schematic diagram of comparison of effects of data synthesis based on traffic signs in an embodiment of the present invention.
[0040] Fig.19 (a) is a schematic diagram of the effect of the first data synthesis based on traffic signs in an embodiment of the present invention.
[0041] Fig.19 (b) is a schematic diagram of the effect of the second data synthesis based on traffic signs in an embodiment of the present invention.
[0042] Fig. 20 4 is a block diagram of a data synthesis system in an embodiment of the present invention.
[0043] Fig.21 FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0045] It should be understood that the terms "first", "second", and "third" etc. in the claims, specifications, and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections. It should also be understood that the terms used in this disclosure specification are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure.
[0046] In the current field of autonomous driving, automotive 3D synthetic data is widely used to develop and test autonomous driving solutions in a simulation environment, thereby saving time and cost for testing and training. However, data synthesis still faces some challenges today.
[0047] Among them, for 2D synthetic data, one of the challenges is how to accurately restore subtle features and subtle differences in complex real scenes; the second challenge is that traditional 2D synthetic data rarely takes into account the simulation of lighting and shadows, which are crucial for visual perception tasks.
[0048] Among them, for 3D synthetic data, one of the challenges is the problem of accuracy and authenticity: generating high-quality 3D synthetic data requires ensuring that it can accurately reflect the complexity of the real world, including roads, traffic signs, buildings, etc. Synthetic data that lacks realism may cause the model to perform poorly in actual scenarios. The second challenge is the problem of scene complexity: autonomous driving systems in the real world will encounter various complex scenes. Simulating these complex scenes requires considering multiple variables, such as road traffic conditions, lighting conditions, weather and other factors, which further increases the difficulty of 3D data synthesis. The third challenge is the problem of high-dimensional data: 3D data is more complex than 2D data and contains more dimensions. The information contained in 3D labels is also more complex than 2D labels, and it is more time-consuming and labor-intensive to process. The fourth challenge is the problem of lighting, weather, and shadows: simulating real lighting and shadow effects in 3D data synthesis is a challenge.
[0049] In view of this, if Figure 1-Figure 3 As shown, the present invention provides a data synthesis method, which mainly includes the following steps.
[0050] Step S110: Acquire a background image, and acquire 2D pixel coordinates of an object in the background image.
[0051] Specifically, the background image may be a background image under the perspective of the front view 120°, or may be a background image under other preset perspectives, such as an image under the left perspective, i.e., a left view, or an image under the right perspective, i.e., a right view. Preferably, the background image is mostly a dedistorted background image. In the embodiments of the present invention, the dedistorted background image under the perspective of the front view 120° is taken as an example for explanation and description.
[0052] In some embodiments, step S110 includes: acquiring a background image at a preset viewing angle; Performing segmentation processing on the background image to retain a road surface mask in the background image; The 2D pixel coordinates of the object are obtained in the background image based on the prior constraint condition and the road surface mask, where the 2D pixel coordinates of the object are the 2D pixel coordinates of the bottom center of the object.
[0053] Specifically, Figure 4-Figure 13 As shown, the present invention uses the background image of the front view 120° without distortion as the image for segmentation processing, and uses the semantic segmentation model to perform semantic segmentation on the background image, replaces the lane line mask with the road surface mask, avoids the loss of the lane line shape in the road surface mask, and finally retains only the image shown in FIG. Figure 5 The road surface mask in the background image shown is used to locate the road surface edge line.
[0054] Set a priori constraint condition, wherein the priori constraint condition is set to the road width; Figure 6 and Figure 7 As shown, edge detection and Hough transform are performed on the road mask, and combined with the prior constraints, an approximate straight line segment, that is, the road edge line, is found, and the obtained approximate straight line segment is expanded to make the segment more obvious, and the circumscribed rectangle of the segment is found, and the coordinates of the center point of each rectangle constitute a 2D pixel coordinate group of the candidate position; One or more sets of coordinates are randomly selected from the 2D pixel coordinate sets of the candidate positions, namely the 2D pixel coordinates (U, V) used for object placement in the background image at the front 120-degree viewing angle, where the 2D pixel coordinates of the object are the 2D pixel coordinates of the bottom center of the object.
[0055] Step S120: acquiring and generating 3D world coordinates corresponding to the object based on the camera internal and external parameters and the 2D pixel coordinates of the object.
[0056] In this step, the 3D world coordinates (X W ,Y W ,Z W ) is the coordinate of the center point at the bottom of the 3D model. Under the assumption of the ground plane, the 3D world coordinates (X W ,Y W ,Z W ).
[0057] In one embodiment of the present invention, after acquiring and generating the 3D world coordinates corresponding to the object based on the camera internal and external parameters and the 2D pixel coordinates of the object, the method further includes: Acquire point cloud data, and filter the point cloud data to retain only point cloud data on the road surface within a preset viewing angle; Filter by (X W ,Y W ) coordinates as the center of the preset area is the target point cloud data. Specifically, select (X W ,Y W ) coordinates as the center of the point cloud data in a certain area, and use the random sampling consensus algorithm (Ramdom Sample Consensus, RANSAC) algorithm to fit a plane to obtain the plane equation AX+BY+CZ+D=0; The target point cloud data is used to fit and generate a target plane equation, where the target plane equation is AX+BY+CZ+D=0; Based on (X W ,Y W ) coordinates and the target plane equation to obtain the ground truth height Z' W, and the corrected 3D world coordinates (X W ,Y W ,Z' W ).
[0058] The present invention can obtain the corrected 3D world coordinates (X W ,Y W ,Z' W ).
[0059] Step S130: Acquire a 3D model, place the 3D model on a corresponding 3D world coordinate for rendering, and generate a composite image based on the background image.
[0060] like Figure 8 and Fig. 9 As shown, in this step, the rendering function of an image rendering tool is mainly used. For example, the free Blender software can be used. In the image rendering tool, the 3D model to be placed is obtained. The 3D model is specifically a 3D CAD model in the Blender software, and a virtual camera with the same internal and external parameters as the front-view camera 120 is set, that is, the same internal and external parameters of the camera are set. The image rendering tool is used to set the influencing factors such as lighting, weather, texture and / or shadow according to the actual data synthesis requirements, and the 3D CAD model is placed in the 3D world coordinates obtained in step S120, and the 3D CAD model is rendered. Combined with the background image under the front-view camera 120, the final composite image and the corresponding 3D label are obtained.
[0061] Here, in this way, the present invention can take into account more complex scenes, such as scenes with strong lighting, rainy scenes, etc., and generate higher quality 3D synthetic data that can accurately reflect the complexity of the real world.
[0062] In one embodiment of the present invention, after placing the 3D model on the corresponding 3D world coordinates for rendering, the method includes: Acquire multiple 3D sub-models constituting the 3D model, and render the multiple 3D sub-models separately; the object corresponding to the 3D model is composed of the corresponding multiple sub-objects; Based on the rendered image, get the 2D label corresponding to each sub-object.
[0063] For example, Figure 14-Figure 19As shown in (b), in order to solve the problem of how to accurately restore subtle features and subtle differences in complex real scenes, the present invention can place different groups of 3D CAD models at corresponding positions and render the complete CAD model. Taking the traffic light as an example, the CAD model of the traffic light includes sub-models of three parts: a light box, a light bulb and a light pole. In order to obtain the 2D label of a single object in the CAD model, multiple light bulbs and a single light box in the CAD model are rendered separately. Through the rendered RGBA image, the 2D label corresponding to the single object can be calculated.
[0064] It should be noted that the present invention may not use point cloud data when synthesizing 2D data, because 3D labels are not required, and the use of point cloud data to fit the road surface height is to obtain more accurate 3D labels; the traffic light exemplified in the present invention is only an example, and those skilled in the art can synthesize other 2D or 3D data such as traffic signs and their corresponding labels as needed; the image rendering tools disclosed in the present invention include but are not limited to Blender software, and also include other software or self-developed software that can achieve similar effects; the data synthesis method and device proposed in the present invention include but are not limited to the synthesis of road signs, and different positioning methods for other static objects in the field of autonomous driving should also be within the scope of protection; the 2D semantic segmentation model disclosed in the present invention is not specifically specified, and includes other semantic segmentation models that can achieve similar effects.
[0065] The data synthesis method proposed in the present invention is suitable for 3D and 2D data synthesis scenarios in the cloud and vehicle side in the field of autonomous driving. It can quickly and accurately synthesize 3D and 2D data and their corresponding labels. In the process of data synthesis, no additional labeled data is required. Only point cloud data of unlabeled categories and the corresponding original background image of the front 120-degree perspective are required. By using a 3D CAD model in combination with an image rendering tool, new categories of 3D and 2D data can be automatically synthesized in batches, which can greatly solve the problem of shortage of labeled data.
[0066] like Figure 3 As shown, the second aspect of the present invention provides a road sign synthesis method, comprising: Step S210: obtaining a background image, and obtaining 2D pixel coordinates of road signs in the background image; Step S220: acquiring and generating 3D world coordinates corresponding to the road sign based on camera internal and external parameters and the 2D pixel coordinates of the road sign; Step S230: Acquire a 3D model, place the 3D model on the corresponding 3D world coordinates for rendering, and generate a synthetic image and its corresponding label based on the background image, wherein the label includes at least a 2D label and a 3D label, wherein Figure 16-Figure 19As shown in (b), the road signs include at least one or more traffic lights and one or more traffic signs. The traffic lights are composed of at least a light bulb, a light box and / or a light pole, and the traffic signs are composed of at least a signboard and / or a sign pole.
[0067] In step S210, the step of acquiring a background image and acquiring 2D pixel coordinates of an object in the background image includes: Get the background image under the preset viewing angle; Performing segmentation processing on the background image to retain a road surface mask in the background image; Performing straight line fitting on the edge of the road mask based on a priori constraints to obtain a plurality of fitting line segments; The coordinates of the midpoint of each line segment are obtained to form the coordinates of the candidate position where the traffic light and / or the traffic sign can be placed, that is, the 2D pixel coordinates.
[0068] In one embodiment of the present invention, the 3D model of the traffic light is composed of a 3D sub-model of a light bulb, a 3D sub-model of a light box and / or a 3D sub-model of a light pole, and the 3D model of the traffic sign is composed of a 3D sub-model of a sign and / or a 3D sub-model of a sign pole; After placing the 3D model on the corresponding 3D world coordinates for rendering, the method includes: Rendering the light bulb 3D sub-model, the light box 3D sub-model and / or the signboard 3D sub-model separately; Based on the rendered image, 2D labels corresponding to individual light bulbs, light boxes and / or signboards are obtained.
[0069] For details, please refer to Fig.16 , Fig.17 (a) and Fig.17 (b) Schematic diagram of the effects of three types of traffic light-based data synthesis, and Fig.18 , Fig.19 (a) and Fig.19 (b) Schematic diagram of the effects of three types of data synthesis based on traffic signs. It can be seen that data can be synthesized by partially changing the position and color of traffic lights, or partially changing the content of traffic signs, which improves the effect of data synthesis and meets the requirements of data synthesis diversity.
[0070] The classification of traffic lights is only a schematic diagram. In actual application scenarios, traffic lights may also exist in various forms. For example, the specifications and models of light boxes in traffic lights may change. However, the solution provided by the present invention can obtain a single object and its corresponding 2D label based on actual division requirements, and this method should fall within the scope of protection of the present invention.
[0071] like Fig. 20As shown, the third aspect of the present invention provides a data synthesis system, comprising: The 2D coordinate acquisition unit 310 is at least used to acquire a background image, and acquire the 2D pixel coordinates of the object in the background image; A 3D coordinate acquisition unit 320, at least used to acquire and generate a 3D world coordinate corresponding to the object based on the camera internal and external parameters and the 2D pixel coordinates of the object; The image synthesis unit 330 is at least used to obtain a 3D model, place the 3D model on a corresponding 3D world coordinate for rendering, and generate a synthesized image based on the background image.
[0072] Furthermore, the data synthesis system further includes a 3D coordinate correction unit 340, which is used at least to obtain point cloud data and filter the point cloud data to retain only point cloud data on the road surface within a preset viewing angle; Filter by (X W ,Y W ) The point cloud data within the preset area centered on the coordinates is the target point cloud data; The target point cloud data is used to fit and generate a target plane equation, where the target plane equation is AX+BY+CZ+D=0; Based on (X W ,Y W ) coordinates and the target plane equation to obtain the ground truth height Z' W , and the corrected 3D world coordinates (X W ,Y W , Z' W ).
[0073] Furthermore, the data synthesis system further includes a label generation unit 350, and the label generation unit 350 is at least used for placing the 3D model on the corresponding 3D world coordinates for rendering after the image synthesis unit: The 3D label of the object can be calculated through the 3D coordinates of the CAD model and the corresponding transformation matrix; and A plurality of 3D sub-models constituting the 3D model are obtained, the plurality of 3D sub-models are rendered separately, and a 2D label is obtained; an object corresponding to the 3D model is composed of sub-objects corresponding to the plurality of 3D sub-models.
[0074] The system proposed in the present invention can quickly and accurately synthesize 3D and 2D data and their corresponding 3D labels and 2D labels, and does not require additional labeled data, only requiring point cloud data of unlabeled categories and the corresponding original background image of the front 120-degree perspective. The present invention can automatically batch synthesize new categories of 3D and 2D data, greatly solving the problem of label data shortage.
[0075] like Fig.21 As shown, the fourth aspect of the present invention provides an electronic device, including: At least one processor; and at least one memory in communication with the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the method described in any of the above embodiments.
[0076] The present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0077] It can be understood that computer-readable storage media may include: any entity or device capable of carrying a computer program, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc. A computer program includes a computer program code. The computer program code may be in source code form, object code form, an executable file, or some intermediate form, etc. A computer-readable storage medium may include: any entity or device capable of carrying a computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc.
[0078] In certain embodiments of the present invention, the electronic device may include a controller or a processor, and the controller is a single-chip microcomputer chip that integrates a processor, a memory, a communication module, etc. The processor may refer to a processor included in the controller. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0079] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0080] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0081] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data synthesis method, It is characterized in that include: Acquire a background image, and acquire 2D pixel coordinates of an object in the background image; Obtaining and generating 3D world coordinates corresponding to the object based on camera internal and external parameters and the 2D pixel coordinates of the object; A 3D model is obtained, the 3D model is placed on a corresponding 3D world coordinate for rendering, and a composite image is generated based on the background image.
2. The data synthesis method according to claim 1, It is characterized in that The step of acquiring a background image and acquiring 2D pixel coordinates of an object in the background image includes: Get the background image under the preset viewing angle; Performing segmentation processing on the background image to retain a road surface mask in the background image; The 2D pixel coordinates of the object are obtained in the background image based on the prior constraint condition and the road surface mask, where the 2D pixel coordinates of the object are the 2D pixel coordinates of the bottom center of the object.
3. The data synthesis method according to claim 1 or 2, It is characterized in that The acquiring and generating the 3D coordinates corresponding to the object based on the camera internal and external parameters and the 2D coordinates of the object includes: Assume that the ground is at a height Z relative to the world coordinate system W =0; According to the camera intrinsic parameters and camera extrinsic parameters, the 3D world coordinates (X W ,Y W ,Z W ), the 3D world coordinate (X W ,Y W ,Z W ) are the coordinates of the center point at the bottom of the 3D model.
4. The data synthesis method according to claim 3, It is characterized in that After acquiring and generating the 3D world coordinates corresponding to the object based on the camera internal and external parameters and the 2D pixel coordinates of the object, the method further includes: Acquire point cloud data, and filter the point cloud data to retain only point cloud data on the road surface within a preset viewing angle; Filter by (X W ,Y W ) The point cloud data within the preset area centered on the coordinates is the target point cloud data; Using the target point cloud data to fit and generate a target plane equation; Based on (X W ,Y W ) coordinates and the target plane equation to obtain the ground truth height Z' W , and the corrected 3D world coordinates (X W ,Y W ,Z' W ).
5. The data synthesis method according to claim 1, It is characterized in that The step of obtaining a 3D model, placing the 3D model on a corresponding 3D world coordinate and rendering the 3D model to generate a composite image includes: Setting the same internal and external parameters of the camera in the image rendering tool, setting influencing factors as needed, and obtaining a 3D model corresponding to the object, wherein the influencing factors include lighting, weather, texture and / or shadow; The 3D model is placed on corresponding 3D world coordinates, and the 3D model is rendered based on the influencing factors.
6. The data synthesis method according to claim 1, It is characterized in that After placing the 3D model on the corresponding 3D world coordinates for rendering, the method includes: Acquire multiple 3D sub-models constituting the 3D model, and render the multiple 3D sub-models separately; the object corresponding to the 3D model is composed of the corresponding multiple sub-objects; Based on the rendered image, get the 2D label corresponding to each sub-object.
7. A road sign synthesis method, It is characterized in that include: Acquire a background image, and acquire 2D pixel coordinates of road signs in the background image; Acquire and generate 3D world coordinates corresponding to the road sign based on camera internal and external parameters and the 2D pixel coordinates of the road sign; Acquire a 3D model, place the 3D model on a corresponding 3D world coordinate for rendering, and generate a composite image based on the background image, wherein: The road signs include at least one or more traffic lights and / or traffic signs; The step of acquiring a background image and acquiring 2D pixel coordinates of an object in the background image includes: Get the background image under the preset viewing angle; Performing segmentation processing on the background image to retain a road surface mask in the background image; Based on the prior constraints and the road mask, the coordinates of the candidate positions where the traffic light and / or the traffic sign can be placed are obtained, that is, the 2D pixel coordinates.
8. The road sign synthesis method according to claim 7, It is characterized in that The 3D model of the traffic light is composed of a 3D sub-model of a light bulb, a 3D sub-model of a light box and / or a 3D sub-model of a light pole, and the 3D model of the traffic sign is composed of a 3D sub-model of a sign and / or a 3D sub-model of a sign pole; After placing the 3D model on the corresponding 3D world coordinates for rendering, the method includes: Rendering the light bulb 3D sub-model, the light box 3D sub-model and / or the signboard 3D sub-model separately; Based on the rendered image, 2D labels corresponding to individual light bulbs, light boxes and / or signboards are obtained.
9. A data synthesis system, It is characterized in that include: A 2D coordinate acquisition unit, at least used to acquire a background image, and acquire 2D pixel coordinates of an object in the background image; A 3D coordinate acquisition unit, at least used to acquire and generate a 3D world coordinate corresponding to the object based on the camera internal and external parameters and the 2D pixel coordinates of the object; The image synthesis unit is at least used to obtain a 3D model, place the 3D model on a corresponding 3D world coordinate for rendering, and generate a synthesized image based on the background image.
10. The data synthesis system according to claim 9, It is characterized in that The label generation unit is further included, and the label generation unit is at least used for rendering the 3D model after the image synthesis unit places the 3D model on the corresponding 3D world coordinates: A plurality of 3D sub-models constituting the 3D model are obtained, the plurality of 3D sub-models are rendered separately, and a 2D label is obtained.
11. An electronic device, It is characterized in that include: at least one processor; And at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the data synthesis method as described in any one of claims 1 to 6 or the road sign synthesis method as described in claim 7 or 8.
12. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and when the computer program is executed by a computer, the data synthesis method according to any one of claims 1 to 6 or the road sign synthesis method according to claim 7 or 8 is executed.
