Simulation image generation method, simulation image reinjection method and related devices and equipment
By generating and back-annotating simulation images of target locations, the problem of insufficient video data of new vehicle models is solved, data adaptability and application breadth are enhanced, and the efficiency of algorithm training and verification is improved.
Patent Information
- Application Number
- CN202410621913.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-12-01
AI Technical Summary
When injecting video data into the controller of a new vehicle model, the existing technology is difficult to effectively train and verify the algorithm. As a result, there is not much video data and the training and verification effects cannot be achieved well.
By acquiring the camera data of the first vehicle, a simulation image at the target position of the second vehicle is formed, and is injected back to the data processing unit of the second vehicle, and is determined using the external parameter matrix of the target camera and the external parameter matrix of the second camera. The camera adjacent to the target position forms a matching simulated image based on the real image and depth map, enhancing the adaptability and application breadth of the second camera data.
It enriches the camera data of the second vehicle, improves the adaptability and application breadth of the data, improves the efficiency of algorithm training and verification, and is suitable for the development and testing of new models.
Smart Images

Figure CN118587667A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a simulation image generation method, a simulation image back-annotation method, and related devices and equipment. Background Art
[0002] Currently, driverless technology is booming, and the most important thing it relies on is data information collected in real situations. In the process of algorithm development, using data collected in real situations to inject back (i.e., inject) into the controller can verify the effect of the algorithm and improve the efficiency of algorithm development and verification.
[0003] Specifically, the controller is equipped with an algorithm (e.g., a neural network for machine learning). After the algorithm is developed, the camera on the vehicle can inject the collected video data into the controller. The controller's algorithm can process the collected video data and obtain output results, thereby realizing various functions such as target recognition.
[0004] During the algorithm development process, the algorithm (such as a neural network) needs to be trained and verified. At this time, various video data need to be injected into the controller algorithm. The data source of the video data can be real collected video data or simulated. However, in the prior art, when it is necessary to inject video data into the controller of a new model of vehicle, the camera of the new model of vehicle needs to actually collect real video data, or simulated video data is formed specifically for the camera of the new model of vehicle. When injecting video data into the new model of vehicle, there is often not much video data, and the training and verification effects cannot be achieved well. Summary of the invention
[0005] In view of this, the present application proposes a simulation image generation method, a simulation image back-annotation method and related devices and equipment, which can use the first camera data of the first vehicle to form a simulation image at the target position of the second vehicle, further enrich the second camera data of the second vehicle, enhance the adaptability of the second camera data, and expand the application breadth of the second camera data.
[0006] According to one aspect of the present application, a method for back-annotating a simulated image of a target position is provided, the method comprising: acquiring first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, the first camera data comprising an external parameter matrix of each first camera, the first camera set comprising a preset target camera, the second camera set comprising a plurality of second cameras, the position of the target camera being the same as a preset target position on the second vehicle, the target position being different from the position of each of the second cameras, the second camera data comprising an external parameter matrix of the second camera and a real image captured by the second camera; determining at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrix of each of the second cameras; forming a simulated image matching the target position based on the real image and depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera; and back-annotating the simulated image to a data processing unit of the second vehicle.
[0007] According to another aspect of the present application, a simulated image back-injection device for a target camera is provided, the simulated image back-injection device for the target camera comprising: a camera data acquisition module, used to acquire first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, the first camera data comprising an external parameter matrix of each first camera, the first camera set comprising a preset target camera, the second camera set comprising a plurality of second cameras, the position of the target camera being the same as a preset target position on the second vehicle, the target position being different from the position of each second camera, the second camera data comprising an external parameter matrix of the second camera and a real image captured by the second camera; a camera determination module, used to determine at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrix of each second camera; an image formation module, used to form a simulated image matching the target position based on the real image and depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera; and a back-injection module, used to back-inject the simulated image to a data processing unit of the second vehicle.
[0008] By acquiring the first camera data of the first camera set of the first vehicle and the second camera data of the second camera set of the second vehicle, and then determining at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrix of each second camera, and then based on the real image and depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera, a simulation image matching the target position is formed, and finally the simulation image is fed back to the data processing unit of the second vehicle. According to various aspects of the present application, the first camera data of the first vehicle can be used to form a simulation image at the target position of the second vehicle, further enriching the second camera data of the second vehicle, enhancing the adaptability of the second camera data, and expanding the application breadth of the second camera data. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.
[0010] Figure 1 A flow chart showing a method for re-annotating a simulated image at a target location according to an embodiment of the present application is shown.
[0011] Figure 2 A schematic diagram showing a target position and a target camera according to an embodiment of the present application.
[0012] Figure 3 A block diagram of a simulated image re-injection device for a target camera according to an embodiment of the present application is shown.
[0013] Figure 4 A schematic structural diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0014] 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, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0015] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0016] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or mutual communication; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0017] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or reference letters in different examples, and this repetition is for the purpose of simplification and clarity, and does not indicate the relationship between the various embodiments and / or settings discussed in itself. In addition, the examples of various specific processes and materials provided by the present application, but those of ordinary skill in the art can be aware of the application of other processes and / or the use of other materials. In some instances, methods, means, components and circuits well known to those skilled in the art are not described in detail, so as to highlight the subject matter of the present application.
[0018] Figure 1 A flow chart showing a method for re-annotating a simulated image at a target position according to an embodiment of the present application is shown. Figure 1 As shown, the method for back-annotating a simulated image at a target position of the present application may include:
[0019] Step S1: acquiring first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, wherein the first camera data includes an external parameter matrix of each first camera, the first camera set includes a preset target camera, the second camera set includes a plurality of second cameras, the position of the target camera is the same as a preset target position on the second vehicle, the target position is different from a position of each second camera, and the second camera data includes an external parameter matrix of the second camera and a real image captured by the second camera;
[0020] The plurality of first cameras may be installed on a first vehicle, and there may be one or more of the first vehicles. Correspondingly, the plurality of second cameras may be installed on a second vehicle, and there may be one or more of the second vehicles. It is understood that the present application does not limit the number of the first vehicle and the second vehicle.
[0021] The first camera data may be a data set, and the first camera data may include parameters such as the external parameter matrix of each of the first cameras and the internal parameter matrix of each of the first cameras. Similar to the first camera data, the second camera data may be a data set, and the second camera data may include parameters such as the external parameter matrix of each of the second cameras and the internal parameter matrix of each of the second cameras. It should be noted that the first camera data may also include the original images captured by each of the first cameras, and the second camera data may also include the real images captured by each of the second cameras.
[0022] Exemplarily, the first vehicle may be an old model vehicle, and the second vehicle may be a new model vehicle. The first camera data and the second camera data may both be stored in a corresponding database.
[0023] Among them, the external parameter matrix of the target camera and the internal parameter matrix of the target camera can be obtained simultaneously or in sequence. The external parameter matrix may include rotation parameters and translation parameters for converting from the world coordinate system to the camera coordinate system, which are used to convert the coordinate points of the world coordinate system to the coordinate points of the camera coordinate system; the internal parameter matrix may include the parameters of the camera itself, such as the focal length of the camera, etc. The internal parameter matrix can be used to convert the coordinate points of the camera coordinate system to the coordinate points of the pixel coordinate system. The internal parameter matrix is usually fixed, while the external parameter matrix may be related to parameters such as the position and orientation of the camera.
[0024] Figure 2 A schematic diagram showing a target position and a target camera according to an embodiment of the present application.
[0025] like Figure 2As shown, a first vehicle may be equipped with a plurality of first cameras, and a second vehicle may be equipped with a plurality of second cameras. Among the plurality of first cameras, one of the plurality of first cameras may be used as a target camera, and the target camera exists on the first vehicle, while there is no corresponding camera at the same position as the target camera on the second vehicle.
[0026] Specifically, the position of the target camera is the same as the target position preset on the second vehicle, and the target position is different from the position of each of the second cameras. In the embodiment of the present application, there is no camera in the second vehicle at the same position as the target camera of the first vehicle. Therefore, a plurality of second cameras adjacent to the target position can be used to simulate the simulated image that may be captured when the second camera is installed at the target position.
[0027] Since the position of the first camera installed on the first vehicle is different from the position of the second camera installed on the second vehicle, or the model of the first camera installed on the first vehicle is different from the model of the second camera installed on the second vehicle, the viewing angle of the first camera installed on the first vehicle is different from the viewing angle of the second camera installed on the second vehicle. Therefore, the camera data of the first vehicle cannot be directly used for the second vehicle, and the method of the present application needs to be used to transform the camera data of the first vehicle for the second vehicle. In the case where the position of the second camera is the same as that of the first camera, the first camera data corresponding to the first camera can be directly transplanted to the second camera at the same position as the first camera.
[0028] Step S2: determining at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrices of each of the second cameras;
[0029] In the embodiment of the present application, since there is no camera in the second vehicle at the same position as the target camera, it is necessary to use at least one second camera near the target position of the second vehicle to simulate the simulated image of the target position, so as to simulate the image taken after the camera is installed at the target position. It is worth noting that since the external parameter matrix reflects the viewing angle information of the camera, the internal parameter matrix does not need to be involved in the process of determining at least one second camera adjacent to the target position, thereby improving the selection efficiency of the at least one second camera.
[0030] Further, determining at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrices of each of the second cameras may include:
[0031] Step S21: extracting a first translation parameter, a second translation parameter, and a third translation parameter corresponding to the target camera through the external parameter matrix of the target camera;
[0032] For example, the first vehicle is equipped with C1, C2...C N There are N first cameras in total, where N is a positive integer. For each first camera, an external parameter matrix corresponding to the first camera can be obtained. Exemplarily, for the target camera C1, the first translation parameter, the second translation parameter, and the third translation parameter in the external parameter matrix corresponding to the target camera can be expressed as t x(C1) ,t y(C1) ,t z(C1) , characterizing the translation parameters of the target object photographed by the target camera from the world coordinate system to the camera coordinate system.
[0033] Step S22: extracting the fourth translation parameter, the fifth translation parameter and the sixth translation parameter corresponding to each of the second cameras respectively through the external parameter matrices of each of the second cameras;
[0034] The fourth translation parameter, the fifth translation parameter and the sixth translation parameter may be t in the external parameter matrix of each of the second cameras. x ,t y ,t z , represents the translation parameter of the target object photographed by any second camera from the world coordinate system to the camera coordinate system.
[0035] Step S23: based on the fourth translation parameter, the fifth translation parameter and the sixth translation parameter corresponding to each of the second cameras and the first translation parameter, the second translation parameter and the third translation parameter corresponding to the target camera, respectively calculating the Euclidean distance between each of the second cameras and the target camera to obtain a plurality of camera distances corresponding to the plurality of second cameras;
[0036] Exemplarily, for the target camera C1 on the first vehicle and any second camera on the second vehicle, the translation parameters corresponding to the two cameras may be squared to obtain the Euclidean distance corresponding to the second camera. Specifically, the square of the first translation parameter subtracted from the fourth translation parameter may be added, the square of the second translation parameter subtracted from the fifth translation parameter may be added, and the square of the third translation parameter subtracted from the sixth translation parameter may be added, and the square root of the total sum may be taken to obtain the camera distance corresponding to the second camera. Similarly, the camera distances corresponding to the other second cameras may be obtained.
[0037] Step S24: selecting at least one second camera whose distance is lower than a preset camera distance threshold as at least one second camera adjacent to the target position.
[0038] The camera distance threshold can be set as needed. The at least one second camera can be n second cameras, where n is an integer. Optionally, n can be set to 2 or 3, and 2 second cameras or 3 second cameras close to the position of the target camera are selected as references.
[0039] By using the external parameter matrix of the target camera and the external parameter matrices of each of the second cameras to determine at least one second camera close to the target position, the embodiment of the present application can improve the accuracy of camera data migration of different vehicles while reducing the amount of calculated data.
[0040] Step S3: Based on the real image and the depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera, a simulation image matching the target position is formed;
[0041] Furthermore, before forming a simulated image matching the target position based on the real image and depth map corresponding to the at least one second camera and the first camera data corresponding to the target camera, the simulated image back-injection method of the target position includes:
[0042] Step S301: Processing the real image captured by the at least one second camera based on the SFM algorithm to generate a depth map corresponding to each of the at least one second camera.
[0043] The second camera data may be a data set including a plurality of real images captured by each second camera. In step S301, the at least one second camera may be found in the second camera data by the serial number of the second camera, and then the plurality of real images captured by the at least one second camera may be directly extracted.
[0044] Among them, the depth map can be used to characterize the distance between the target object photographed by the target camera and the target camera, that is, the target depth information. For example, for the second vehicle, a target camera is installed on the left front of the second vehicle. The straight-line distance between the traffic light photographed by the target camera and the camera is 10m, and the straight-line distance between the pedestrian photographed by the target camera and the target camera is 15m. At this time, both the traffic light and the pedestrian can be used as the target object. There can be one or more target objects, and the distance between the target object and the camera of the second vehicle can be specifically measured based on the geometric center of the target object and the optical center of the camera.
[0045] In practical applications, the coordinates of the target object photographed by the target camera can be calibrated using the world coordinate system. The origin of the world coordinate system has nothing to do with the specific position of the target camera and can be selected according to actual needs. Usually, the coordinates of the target object in the world coordinate system cannot be directly projected onto the image of the two-dimensional plane and need to be further converted. For example, the coordinates in the world coordinate system can be converted to the camera coordinate system using an external parameter matrix, and then the corresponding coordinates in the camera coordinate system can be converted to the pixel coordinate system using an internal parameter matrix. Exemplarily, the origin of the camera coordinate system can be the optical center of the camera, and the origin of the pixel coordinate system can be located in the upper left corner of the captured image.
[0046] The depth information may be obtained by radar detection or binocular vision. It is understood that there are many ways to obtain the depth information, which is not limited in this application.
[0047] Among them, the SFM algorithm, also known as the Structure From Motion algorithm, can reconstruct a three-dimensional structure from a series of multiple two-dimensional image sequences containing visual motion information.
[0048] Exemplarily, based on the SFM algorithm, two adjacent real images from the multiple real images may be selected for calculation in pairs, then feature points in different real images may be matched, and then corresponding basic matrices and intrinsic matrices may be calculated, and then depth maps corresponding to the at least one second camera may be reconstructed according to the basic matrix and the intrinsic matrix. Each of the at least one second camera corresponds to a depth map. For any of the at least one second camera, the depth map corresponding to the second camera may include the distance between the target object and the second camera.
[0049] Further, based on the real image and the depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera, a simulation image matching the target position is formed, including:
[0050] Step S31: obtaining an internal parameter matrix of each of the at least one second camera;
[0051] In step S31, the internal parameter matrix of each of the at least one second camera may be extracted from the second camera data.
[0052] Step S32: Based on the external parameter matrix of each of the at least one second camera, the internal parameter matrix of each of the second cameras, the depth map corresponding to each of the at least one second camera, and the real image, project the pixel points of the real image from the pixel coordinate system to the world coordinate system to obtain a plurality of first pixel points in the world coordinate system;
[0053] The target object may include a plurality of feature points, each of which may correspond to a pixel point on an image captured based on the target object. Each feature point has a first pixel point in the world coordinate system. In practical applications, the feature points corresponding to each of the depth maps may be translated to the world coordinate system.
[0054] Due to the difference in viewing angles between the first camera and the target camera, and the inability to directly transform the pixel points of the pixel coordinate system into the coordinate points of the world coordinate system, each of the depth maps is translated into the world coordinate system, so as to realize the transformation process of projecting the pixel points of the multiple real images from the pixel coordinate system into the world coordinate system through each of the depth maps. In other words, without the depth map, the transformation of the pixel points of the multiple real images from the pixel coordinate system into the world coordinate system cannot be realized; however, in combination with the external parameter matrix of each of the second cameras in the at least one second camera, the internal parameter matrix of each of the second cameras, and the depth map corresponding to each of the at least one second camera, the pixel points of the multiple real images can be projected from the pixel coordinate system into the world coordinate system.
[0055] Step S33: forming a simulation image matching the target position based on the plurality of first pixel points and the first camera data corresponding to the target camera.
[0056] Further, based on the plurality of first pixel points and the first camera data corresponding to the target camera, a simulation image matching the target position is formed, including:
[0057] Step S331: Generate an external parameter matrix of the target position using the external parameter matrix of the target camera;
[0058] In one example, the external parameter matrix of the target camera may be directly used as the external parameter matrix of the target position.
[0059] Step S332: projecting part or all of the first pixel points to a camera coordinate system corresponding to the target camera according to the external parameter matrix of the target position, to obtain a plurality of second pixel points in the camera coordinate system;
[0060] In one example, the conversion relationship between the first pixel point and the second pixel point can be expressed by formula (1) as follows:
[0061]
[0062] Among them, X, Y, and Z represent the first pixel point of the target object in the world coordinate system; X c , Y c , Z c They represent the second pixel point of the target object in the camera coordinate system respectively; r in the external parameter matrix 11 -r 33 A total of 9 parameters represent the rotation parameters of the target object from the world coordinate system to the camera coordinate system; t x ,t y ,t z They respectively represent the translation parameters of the target object from the world coordinate system to the camera coordinate system.
[0063] Since the origin of the world coordinate system does not coincide with the origin of the camera coordinate system, when a point in the world coordinate system needs to be projected onto the image plane, the world coordinate system needs to be converted to the camera coordinate system using an external parameter matrix, which characterizes the rotation and translation during the conversion process. Of course, since the target object may include multiple feature points, the actual processing object of formula (1) may be the feature points of the target object. From the perspective of the pixel coordinate system, the feature points may be individual pixel points in the captured image.
[0064] Step S333: Based on the plurality of second pixel points and the first camera data corresponding to the target camera, a simulation image matching the target position is formed.
[0065] The transformation process of formula (1) can be regarded as a part of the forward transformation process, and the process of step S32 can be called the inverse transformation process.
[0066] It should be noted that in this application, the three coordinate systems of the world coordinate system, the camera coordinate system and the pixel coordinate system are mainly used to calibrate the position of the target object and the target camera. It can be understood by those skilled in the art that there are other possible deformations in the coordinate transformation, and this application does not limit the deformation conversion between the coordinate systems.
[0067] Further, according to the external parameter matrix of the target position, part or all of the first pixel points are projected to the camera coordinate system corresponding to the target camera to obtain a plurality of second pixel points in the camera coordinate system, including:
[0068] Step S3321: Obtain the viewing angle range of the target camera;
[0069] The viewing angle range of the target camera may be the maximum viewing angle that the target camera can observe. For example, when the target camera is installed at the left front of the vehicle, the maximum viewing angle that the target camera can observe may be 120 degrees, and when the target camera is installed at the right front of the vehicle, the maximum viewing angle that the target camera can observe may be 180 degrees. The viewing angle ranges of target cameras at different positions may be different. In other words, the maximum viewing angle that the target camera can observe may be related to the coordinates of the target camera itself.
[0070] Step S3322: determining whether each first pixel point among the plurality of first pixel points is within the viewing angle range;
[0071] Step S3323: If the first pixel point is within the viewing angle range, project the first pixel point to the camera coordinate system corresponding to the target position; if the first pixel point is outside the viewing angle range, filter the first pixel point.
[0072] It should be noted that the viewing angle range of the target camera may be related to factors such as the installation position of the camera itself and the performance of the camera, and the viewing angle range of the target camera is limited. For example, the viewing angle range of the target camera can capture a range of 120 degrees in the horizontal direction and 120 degrees in the vertical direction. Therefore, when projecting each first pixel point, it is necessary to determine whether each first pixel point among the multiple first pixel points is located within the viewing angle range.
[0073] The target object can be selected as needed. The target object corresponding to the first image captured by the first camera is the same as the target object corresponding to the real image captured by the second camera. The first camera and the second camera can both capture the same target object from different perspectives.
[0074] Among them, when the first pixel point is within the viewing angle range, the first pixel point can be directly projected to the camera coordinate system corresponding to the target position; when the first pixel point is outside the viewing angle range, the first pixel point outside the viewing angle range can be filtered out. By judging whether each of the multiple first pixel points is within the viewing angle range, the embodiment of the present application can reduce the amount of coordinate data in the coordinate projection process and improve the generation efficiency of the simulation graphics.
[0075] Furthermore, the first camera data also includes an internal parameter matrix of each of the first cameras, and based on the plurality of second pixel points and the first camera data corresponding to the target camera, a simulation image matching the target position is formed, including:
[0076] Step S3331: Obtain the internal parameter matrix of the target camera;
[0077] In step S3331, the internal parameter matrix of the target camera can be extracted from the first camera data.
[0078] Step S3332: Generate an internal parameter matrix of the target position using the internal parameter matrix of the target camera;
[0079] In one example, the internal parameter matrix of the target camera may be directly used as the internal parameter matrix of the target position.
[0080] Step S3333: projecting each of the plurality of second pixel points to a pixel coordinate system corresponding to the target position according to the internal parameter matrix of the target position to obtain a plurality of third pixel points in the pixel coordinate system;
[0081] In an example, the conversion relationship between the second pixel point and the third pixel point can be expressed by formula (2) as follows:
[0082]
[0083] Among them, X c , Y c , Z c represent the second pixel point of the target object in the camera coordinate system; x and y represent the third pixel point of the target object in the pixel coordinate system; c in the internal parameter matrix x 、c y They represent the pixel coordinates corresponding to the origin of the camera coordinate system on the image; f in the internal parameter matrix x 、f y Can represent the focal length of the camera.
[0084] In addition, in the process of converting the second pixel point to the third pixel point through the internal parameter matrix, the distortion factor can also be considered. For example, a radial distortion coefficient and a tangential distortion coefficient are added to the internal parameter matrix. Adding the distortion factor can improve the problem of offset and deformation between the theoretically calculated pixel points and the actual pixel points. In practical applications, whether the distortion factor is added can be determined according to actual needs, and this application does not limit it.
[0085] It should be noted that formula (2) is based on the principle of camera projection. The transformation process of formula (2) can also be regarded as part of the forward transformation process. In the present application, the first pixel point can be the coordinate of the target object in the real world, which is three-dimensional; the second pixel point can be the intermediate coordinate, which is also three-dimensional; the third pixel point can be the coordinate of the target object in the captured image, which is two-dimensional.
[0086] Step S3334: Based on the multiple third pixel points, a simulation image matching the target position is formed.
[0087] The simulated image may be used for the second vehicle. For example, the simulated image may be input into a data processing unit of the second vehicle so that the data processing unit may use the simulated image for training, verification or testing.
[0088] It should be noted that, in the process of processing each of the depth maps, it is assumed that the direction of the virtual perspective external parameters of the target position is consistent, and considering that the external parameters r11-r33 are consistent in the virtual camera and the target camera participating in the target position, it is only necessary to consider the translation difference of the perspective, and there is no need to consider the rotation difference of the perspective. For ease of understanding, it can also be considered that the at least one second camera is a camera that is closer to the target position, so the direction of each second camera in the at least one second camera is similar to the direction of the target camera, and there is a deviation in the left, right, up and down positions, which leads to a deviation in the perspective, so translation can be achieved in the process of processing each of the depth maps.
[0089] Step S4: injecting the simulation image back into the data processing unit of the second vehicle.
[0090] Further, injecting the simulation image back into the data processing unit of the second vehicle includes:
[0091] Step S41: using a bilinear interpolation algorithm and / or an image restoration algorithm to fill in the missing pixels in the simulation image to obtain a fitting image corresponding to the target position;
[0092] Each pixel of the simulated image may correspond to a fixed RGB value (e.g., grayscale). The missing or damaged pixels may be repaired using a bilinear interpolation algorithm and / or an image inpainting algorithm. Exemplarily, the simulated image may also be completed based on semantic information. The image inpainting algorithm may be based on a generative adversarial network (GAN).
[0093] It should be noted that the bilinear difference algorithm and the image restoration algorithm can be performed simultaneously or one of them can be performed selectively. It can be understood by those skilled in the art that the bilinear difference algorithm and the image restoration algorithm have multiple implementation forms, and the present application does not limit the specific implementation of the bilinear difference algorithm and the image restoration algorithm.
[0094] Step S42: injecting the fitting image back into the data processing unit of the second vehicle.
[0095] There may be one or more fitting images. In the case where there are multiple fitting images, the fitting images may be further fused to make the fitting image at the target position closer to the actual situation.
[0096] Further, annotating the fitting image back to the data processing unit of the second vehicle may include:
[0097] Step S421: inputting the formed fitting image matching the target camera into the data processing unit of the second vehicle for neural network training to obtain a training value corresponding to the target position;
[0098] Exemplarily, the second vehicle may include an industrial computer and an injection device. The fitting image may be decoded as video data by an industrial computer (also called a real-time machine), and then injected into a data processing unit through an injection device (such as a video injection board). The algorithm of the data processing unit may be based on a neural network model, which performs neural network training with the fitting image as input, thereby obtaining a training value corresponding to the target position.
[0099] Step S422: comparing the training value with the real value collected by the camera installed at the target position to obtain a comparison result corresponding to the training value;
[0100] In one example, the training value can be compared with the real value captured by the camera installed at the target position, and the comparison result can be equal or unequal. If the comparison result is equal, it means that the fitting image can better fit the image actually captured by the camera installed at the target position; if the comparison result is unequal, it means that the fitting image cannot better fit the image actually captured by the camera installed at the target position, and the neural network model needs to be readjusted.
[0101] Step S423: adjusting the neural network model in the data processing unit according to the comparison result.
[0102] Among them, the neural network model may include network models such as DNN, CNN, LSTM, ResNet, etc., and the present application does not limit the type of neural network model.
[0103] In one embodiment, since there are usually many overlapping parts between the simulated image (or fitted image) and the real image, the simulated image (or fitted image) and the real image captured by each second camera can be spliced together as a to-be-verified image based on the overlapping parts. At the same time, each real image may also have many overlapping parts, so the real images captured by each second camera can be spliced together as a reference image based on the overlapping parts; then the similarity between the to-be-verified image and the reference image is compared to obtain similarity evaluation information for characterizing the similarity. Exemplarily, if the similarity evaluation information is positively correlated with the similarity, the simulated image can be re-annotated when the similarity evaluation information is higher than the similarity threshold, otherwise it will not be re-annotated; if the similarity evaluation information is negatively correlated with the similarity, the simulated image can be re-annotated when the similarity evaluation information is lower than the similarity threshold, otherwise it will not be re-annotated. In addition, the simulated image (or fitted image) can be re-annotated synchronously with other real images.
[0104] Through the above-mentioned scheme of judging whether to re-annotate a simulated image or a fitted image based on similarity, the embodiment of the present application can avoid re-annotating images with poor simulation or fitting results (for example, poor accuracy), and solve the problem that re-annotation may cause mismatches in the synchronously annotated images observed by the data processing unit, thereby improving the training, verification, and testing effects of the algorithm.
[0105] It should be noted that the above solution can be mainly used in the case where there is no need to fill the missing pixels of the simulated image, and it is not excluded that it can be used in the case where there are missing pixels.
[0106] In one example, it is also possible to take into account the situation where there are pixels that need to be filled and the situation where there are no missing pixels that need to be filled. At this time, since the difference between images when there are missing pixels may be caused by defects in the algorithm used when filling or other related defects, different similarity thresholds can also be used for different situations. For example, for the situation of missing pixels, if the missing pixels need to be filled (that is, the image to be injected is a fitting image), the similarity threshold can be determined to be the first similarity threshold, and if there are no missing pixels that need to be filled (that is, the image to be injected is a simulated image), the similarity threshold can be determined to be the second similarity threshold. Further, if the similarity evaluation information is positively correlated with the similarity, the first similarity threshold is less than the second similarity threshold, and if the similarity evaluation information is negatively correlated with the similarity, the first similarity threshold is greater than the second similarity threshold.
[0107] In summary, the present application utilizes coordinate mapping relationships and depth maps to fit the simulated image of the target position perspective by adapting and adjusting the first camera data and the second camera data, so that the first camera data can be adapted to the second vehicle, further enriching the second camera data of the second vehicle, enhancing the adaptability of the second camera data, and expanding the application breadth of the second camera data. In addition, the adapted simulated image can be used for neural network training, thereby improving the training accuracy of the neural network, and quickly adapting to new models based on the first camera data and the second camera data, which also improves the research and development and testing efficiency of new models.
[0108] Figure 3 A block diagram of a simulated image re-injection device for a target camera according to an embodiment of the present application is shown.
[0109] like Figure 3 As shown, the simulation image back-injection device 30 of the target camera of the embodiment of the present application may include:
[0110] A camera data acquisition module 31 is used to acquire first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, wherein the first camera data includes an external parameter matrix of each first camera, the first camera set includes a preset target camera, the second camera set includes a plurality of second cameras, the position of the target camera is the same as a preset target position on the second vehicle, the target position is different from a position of each second camera, and the second camera data includes an external parameter matrix of the second camera and a real image captured by the second camera;
[0111] A camera determination module 32, configured to determine at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrices of each of the second cameras;
[0112] An image forming module 33, configured to form a simulation image matching the target position based on the real image and the depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera;
[0113] The re-injection module 34 is used to inject the simulation image back into the data processing unit of the second vehicle.
[0114] In addition, the present application provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for simulated image back-annotation of the target position is implemented.
[0115] Furthermore, the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the simulated image backfill method of the target location.
[0116] Figure 4 A schematic structural diagram of an electronic device according to an embodiment of the present application is shown.
[0117] like Figure 4 As shown, the electronic device can be used to implement the simulated image backfilling method of the target position. Specifically, the electronic device can include a computer system. It should be noted that, Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0118] like Figure 3 As shown, the computer system includes a central processing unit (CPU) 1801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1802 or the program loaded from the storage part 1808 to the random access memory (RAM) 1803, such as executing the method described in the above embodiment. In RAM 1803, various programs and data required for system operation are also stored. CPU 1801, ROM 1802 and RAM 1803 are connected to each other through bus 1804. Input / output (I / O) interface 1805 is also connected to bus 1804.
[0119] The following components are connected to the I / O interface 1805: an input section 1806 including a keyboard, a mouse, etc.; an output section 1807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1808 including a hard disk, etc.; and a communication section 1809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1809 performs communication processing via a network such as the Internet. A drive 1810 is also connected to the I / O interface 1805 as needed. A removable medium 1811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1810 as needed so that a computer program read therefrom is installed into the storage section 1808 as needed.
[0120] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1809, and / or installed from a removable medium 1811. When the computer program is executed by a central processing unit (CPU) 1801, various functions defined in the system of the present application are executed.
[0121] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0122] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0123] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0124] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0125] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0126] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0127] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0128] The above is a detailed introduction to the simulation image generation method, simulation image back-annotation method and related devices and equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the technical solution and core idea of the present application. Ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating a simulation image, It is characterized in that The method comprises: Acquire first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, wherein the first camera data includes an external parameter matrix of each first camera, the first camera set includes a preset target camera, the second camera set includes a plurality of second cameras, the position of the target camera is the same as a preset target position on the second vehicle, the target position is different from a position of each second camera, and the second camera data includes an external parameter matrix of the second camera and a real image captured by the second camera; Determining at least one second camera adjacent to the target position according to the extrinsic parameter matrix of the target camera and the extrinsic parameter matrices of each of the second cameras; Based on the real image and depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera, a simulation image matching the target position is formed, including: obtaining an internal parameter matrix of each of the at least one second camera; based on the external parameter matrix of each of the at least one second camera, the internal parameter matrix of each of the second cameras, the depth map corresponding to each of the at least one second camera and the real image, projecting the pixel points of the real image from the pixel coordinate system to the world coordinate system to obtain a plurality of first pixel points in the world coordinate system; based on the plurality of first pixel points and the first camera data corresponding to the target camera, a simulation image matching the target position is formed; Wherein, forming a simulated image matching the target position based on the multiple first pixel points and the first camera data corresponding to the target camera includes: generating an external parameter matrix of the target position using the external parameter matrix of the target camera; projecting part or all of the first pixel points to the camera coordinate system corresponding to the target camera according to the external parameter matrix of the target position to obtain a plurality of second pixel points in the camera coordinate system; forming a simulated image matching the target position based on the multiple second pixel points and the first camera data corresponding to the target camera.
2. The method for generating a simulated image according to claim 1, It is characterized in that Determining at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrices of each of the second cameras, comprising: Extracting a first translation parameter, a second translation parameter, and a third translation parameter corresponding to the target camera through an external parameter matrix of the target camera; respectively extracting a fourth translation parameter, a fifth translation parameter, and a sixth translation parameter corresponding to each of the second cameras through the external parameter matrices of each of the second cameras; Based on the fourth translation parameter, the fifth translation parameter and the sixth translation parameter corresponding to each of the second cameras and the first translation parameter, the second translation parameter and the third translation parameter corresponding to the target camera, respectively calculating the Euclidean distance between each of the second cameras and the target camera to obtain a plurality of camera distances corresponding to the plurality of second cameras; At least one second camera whose distance is lower than a preset camera distance threshold is selected as at least one second camera adjacent to the target position.
3. The method for generating a simulated image according to claim 1, It is characterized in that Before forming a simulated image matching the target position based on the real image and the depth map respectively corresponding to the at least one second camera and the first camera data corresponding to the target camera, the simulated image generation method includes: The real image captured by the at least one second camera is processed based on the SFM algorithm to generate a depth map corresponding to each of the at least one second camera.
4. The method for generating a simulated image according to claim 1, It is characterized in that According to the external parameter matrix of the target position, part or all of the first pixel points are projected to the camera coordinate system corresponding to the target camera to obtain a plurality of second pixel points in the camera coordinate system, including: Obtaining the viewing angle range of the target camera; Determining whether each first pixel point among the plurality of first pixel points is within the viewing angle range; If the first pixel point is within the viewing angle range, the first pixel point is projected to the camera coordinate system corresponding to the target position; if the first pixel point is outside the viewing angle range, the first pixel point is filtered.
5. The method for generating a simulated image according to claim 1, It is characterized in that The first camera data also includes an internal parameter matrix of each of the first cameras, and based on the plurality of second pixel points and the first camera data corresponding to the target camera, a simulation image matching the target position is formed, including: Obtaining the internal parameter matrix of the target camera; Generate an internal parameter matrix of the target position using the internal parameter matrix of the target camera; According to the internal parameter matrix of the target position, each second pixel point of the plurality of second pixel points is projected to a pixel coordinate system corresponding to the target position to obtain a plurality of third pixel points in the pixel coordinate system; Based on the plurality of third pixel points, a simulation image matching the target position is formed.
6. A simulation image generating device, It is characterized in that The simulation image generating device comprises: a camera data acquisition module, configured to acquire first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, wherein the first camera data includes an external parameter matrix of each first camera, the first camera set includes a preset target camera, the second camera set includes a plurality of second cameras, the position of the target camera is the same as a preset target position on the second vehicle, the target position is different from a position of each second camera, and the second camera data includes an external parameter matrix of the second camera and a real image captured by the second camera; A camera determination module, configured to determine at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrices of each of the second cameras; An image forming module, for forming a simulated image matching the target position based on the real image and depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera, comprising: obtaining an internal parameter matrix of each of the at least one second camera; projecting the pixel points of the real image from a pixel coordinate system to a world coordinate system based on the external parameter matrix of each of the at least one second camera, the internal parameter matrix of each of the second cameras, the depth map corresponding to each of the at least one second camera and the real image, to obtain a plurality of first pixel points in the world coordinate system; forming a simulated image matching the target position based on the plurality of first pixel points and the first camera data corresponding to the target camera; Wherein, forming a simulated image matching the target position based on the multiple first pixel points and the first camera data corresponding to the target camera includes: generating an external parameter matrix of the target position using the external parameter matrix of the target camera; projecting part or all of the first pixel points to the camera coordinate system corresponding to the target camera according to the external parameter matrix of the target position to obtain a plurality of second pixel points in the camera coordinate system; forming a simulated image matching the target position based on the multiple second pixel points and the first camera data corresponding to the target camera.
7. A simulation image back-annotation method, It is characterized in that The method comprises: Acquire first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, wherein the first camera data includes an external parameter matrix of each first camera, the first camera set includes a preset target camera, the second camera set includes a plurality of second cameras, the position of the target camera is the same as a preset target position on the second vehicle, the target position is different from a position of each second camera, and the second camera data includes an external parameter matrix of the second camera and a real image captured by the second camera; Determining at least one second camera adjacent to the target position according to the extrinsic parameter matrix of the target camera and the extrinsic parameter matrices of each of the second cameras; Based on the real image and depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera, forming a simulation image matching the target position, including: obtaining the internal parameter matrix of each of the at least one second camera; based on the external parameter matrix of each of the at least one second camera, the internal parameter matrix of each of the second camera, the depth map corresponding to each of the at least one second camera and the real image, projecting the pixel points of the real image from the pixel coordinate system to the world coordinate system to obtain a plurality of first pixel points in the world coordinate system; based on the plurality of first pixel points and the first camera data corresponding to the target camera, forming a simulation image matching the target position; wherein, forming the simulation image matching the target position based on the plurality of first pixel points and the first camera data corresponding to the target camera includes: generating the external parameter matrix of the target position using the external parameter matrix of the target camera; according to the external parameter matrix of the target position, projecting part or all of the first pixel points to the camera coordinate system corresponding to the target camera to obtain a plurality of second pixel points in the camera coordinate system; based on the plurality of second pixel points and the first camera data corresponding to the target camera, forming a simulation image matching the target position; The simulation image is fed back to the data processing unit.
8. The method for back-annotating a simulated image according to claim 7, It is characterized in that The method further includes: injecting the simulation image back into the data processing unit, comprising: Using a bilinear interpolation algorithm and / or an image restoration algorithm to fill in missing pixels in the simulation image to obtain a fitting image corresponding to the target position; The fitted image is injected back into the data processing unit of the second vehicle.
9. A simulation image back-injection device, It is characterized in that The simulation image back-injection device comprises: a camera data acquisition module, configured to acquire first camera data of a first camera set of a first vehicle and second camera data of a second camera set of a second vehicle, wherein the first camera data includes an external parameter matrix of each first camera, the first camera set includes a preset target camera, the second camera set includes a plurality of second cameras, the position of the target camera is the same as a preset target position on the second vehicle, the target position is different from a position of each second camera, and the second camera data includes an external parameter matrix of the second camera and a real image captured by the second camera; A camera determination module, configured to determine at least one second camera adjacent to the target position according to the external parameter matrix of the target camera and the external parameter matrices of each of the second cameras; The image forming module is used to form a simulated image matching the target position based on the real image and depth map corresponding to each of the at least one second camera and the first camera data corresponding to the target camera, including: obtaining the internal parameter matrix of each of the at least one second camera; based on the external parameter matrix of each of the at least one second camera, the internal parameter matrix of each of the second cameras, the depth map corresponding to each of the at least one second camera and the real image, projecting the pixel points of the real image from the pixel coordinate system to the world coordinate system to obtain a plurality of first pixel points in the world coordinate system; based on the plurality of first pixel points and the The first camera data corresponding to the target camera is used to form a simulation image matching the target position; wherein, the formation of the simulation image matching the target position based on the multiple first pixel points and the first camera data corresponding to the target camera includes: using the external parameter matrix of the target camera to generate the external parameter matrix of the target position; according to the external parameter matrix of the target position, part or all of the first pixel points are projected to the camera coordinate system corresponding to the target camera to obtain multiple second pixel points in the camera coordinate system; based on the multiple second pixel points and the first camera data corresponding to the target camera, a simulation image matching the target position is formed; The re-injection module is used to inject the simulation image back to the data processing unit.
10. An electronic device, It is characterized in that include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the simulation image generation method described in any one of claims 1 to 5 or the simulation image back-injection method described in any one of claims 7-8.
Citation Information
Patent Citations
Camera calibration method and device, electronic equipment and computer readable medium
CN112991465A
Road data multiplexing method, auxiliary driving system and device and computer equipment
CN114723820A
Method for evaluating feature similarity between visible light real shot image and simulation image of ship
CN115205556A
Image correction device and image correction program
JP2015211387A
System for generating generalized simulation scenarios
US20210347372A1
