Obstacle falling picture acquisition method and device

By acquiring and simulating the physical interaction between the three-dimensional rigid body model of railway obstacles and the real background, a picture set of the obstacle falling process is generated, which solves the problems of lack of data and insufficient authenticity of virtual data in the existing technology, and realizes efficient and realistic obstacles. Obtain object pictures.

CN118470225BActive Publication Date: 2024-10-08HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410939602.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-10-08
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

In the existing deep learning algorithm for railway obstacles, training is difficult due to the lack of railway data of obstacles, and traditional virtual data production is difficult to simulate real physical processes and cannot effectively identify railway obstacles.

Method used

By obtaining a sequence of real background pictures, a three-dimensional rigid body model is established, the physical interaction process between obstacles and the background is simulated, the three-dimensional rigid body model information of the obstacles is recorded, and rendering and fusion is performed to generate a picture set of the obstacle falling process.

Benefits of technology

No manual participation is required, which reduces costs and time-consuming. It improves the speed and efficiency of obtaining images of the whereabouts of obstacles. The resulting image set is closer to real data and is suitable for railway obstacle recognition model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470225B_ABST
    Figure CN118470225B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention proposes a method and device for obtaining pictures of falling obstacles. The method includes: establishing a three-dimensional rigid body model of each frame of the real background picture according to each frame of the real background picture and the corresponding depth information; simulating the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background picture; using the obstacle map to render the three-dimensional rigid body model of the obstacle for each frame of the real background picture according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, and obtaining a rendering image and a mask image of the obstacle for each frame of the real background picture; according to the mask image of the obstacle for each frame of the real background picture, the rendering image of the obstacle for each frame of the real background picture is merged with the corresponding real background picture to obtain a set of pictures of the falling obstacle process. The embodiment of the present invention improves the efficiency of obtaining pictures of falling obstacles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer graphics, and in particular to a method and device for acquiring pictures of falling obstacles. Background Art

[0002] Automatic identification of railway obstacles can reduce the risk of railway accidents and is a very important technology. Common obstacles include fallen rocks, cardboard boxes, tree branches, foam boxes, etc. Figure 1 This is an example of rockfall on the railway.

[0003] The most common method currently relies on radar scanning to detect railway obstacles, which requires manual participation and has high machine costs.

[0004] In recent years, deep learning AI (Artificial Intelligence) algorithms have developed rapidly, and there are more solutions for directly identifying railway obstacles through visible light videos. However, the current railway obstacle deep learning algorithms encounter difficulties in training due to data issues, mainly due to the lack of railway data of obstacles. Such data is very dangerous and costly to produce artificially, and it rarely occurs in practice. At the same time, the algorithm needs a video process of an obstacle from scratch to identify railway obstacles, which requires a large number of continuous videos as support. The ideal video needs to simulate the entire process of the obstacle from the beginning of the fall to the ground, which makes it difficult for traditional virtual data to produce such data. The main difficulties are: 1. It is necessary to perform a complete physical simulation of the entire falling process of the obstacle; 2. The background modeling is difficult and the degree of reality is not high. If all elements in the scene need to be modeled, it cannot meet the actual requirements in terms of time-consuming cost and scene diversity coverage, and it is not real; 3. If a real picture is used as the background and only the foreground obstacles are modeled, then because the background is just a picture, it cannot have physical interactions with the foreground obstacles, such as collisions, and thus cannot simulate a real physical process well. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for obtaining a falling obstacle picture, so as to improve the efficiency of obtaining the falling obstacle picture.

[0006] The technical solution of the embodiment of the present invention is achieved as follows:

[0007] A method for obtaining an obstacle falling picture, the method comprising:

[0008] Acquire a real background image sequence of the obstacle, wherein the real background image sequence of the obstacle is: an image sequence of a real scene that may physically interact with the obstacle, and the image sequence does not contain the obstacle;

[0009] Obtaining depth information of each frame of the real background image in the real background image sequence;

[0010] According to each frame of the real background image and the corresponding depth information, a three-dimensional rigid body model of each frame of the real background image is established;

[0011] Obtain the three-dimensional rigid body model of the obstacle;

[0012] Simulate the continuous physical interaction process between the 3D rigid body model of the obstacle and the 3D rigid body model of each frame of the real background image, and record the 3D rigid body model information of the obstacle during the continuous physical interaction process;

[0013] According to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, the three-dimensional rigid body model of the obstacle for each frame of the real background image is rendered using the obstacle map to obtain a rendering image and a mask image of the obstacle for each frame of the real background image, wherein the obstacle for each frame of the real background image is the obstacle that interacts with the three-dimensional rigid body model of each frame of the real background image;

[0014] According to the rendering image and mask image of the obstacle for each frame of the real background image, the rendering image of the obstacle for each frame of the real background image is fused with the corresponding real background image to obtain a set of images of the obstacle falling process.

[0015] The step of obtaining the depth information of each frame of the real background picture in the real background picture sequence includes:

[0016] Each frame of the real background image in the real background image sequence is input into a pre-trained image depth estimation model for calculation to obtain the depth information of each frame of the real background image.

[0017] The step of obtaining a real background image sequence of obstacles includes:

[0018] A video stream of a preset length is intercepted from a real background video stream of an obstacle collected in advance, and the intercepted video stream is decoded to obtain a real background picture sequence of the obstacle.

[0019] The method of establishing a three-dimensional rigid body model of each frame of the real background image according to each frame of the real background image and the corresponding depth information includes:

[0020] For each frame of the real background image, a two-dimensional grid with the same resolution as the real background image is generated. Then, according to the depth value of each pixel in the depth information of the real background image, the depth value of each grid in the two-dimensional grid is stretched to obtain a three-dimensional rigid body model of the real background image.

[0021] After obtaining the three-dimensional rigid body model of the obstacle and before the continuous physical interaction process between the three-dimensional rigid body model of the simulated obstacle and the three-dimensional rigid body model of each frame of the real background image, the method further includes:

[0022] If the obstacle is split during the falling process, the three-dimensional rigid body model of the obstacle is segmented to obtain three-dimensional rigid body models of multiple segmented sub-obstacles;

[0023] Furthermore, the physical interaction process between the three-dimensional rigid body model of the simulated obstacle and the three-dimensional rigid body model of each frame of the real background image includes:

[0024] If the three-dimensional rigid body model of the obstacle is split into multiple sub-obstacles when physically interacting with the three-dimensional rigid body model of the real background image of the current frame, the physical interaction process between the three-dimensional rigid body model of each sub-obstacle and the three-dimensional rigid body model of the real background image of the current frame and subsequent frames is simulated.

[0025] The three-dimensional rigid body model information of the obstacle recorded in the continuous physical interaction process includes:

[0026] In the continuous physical interaction process, a set of three-dimensional rigid body model information of obstacles is recorded for the three-dimensional rigid body model of each frame of the real background image, wherein the three-dimensional rigid body model information of each set of obstacles includes: three-dimensional coordinates of each vertex in the three-dimensional rigid body model of the obstacle and texture coordinates of each vertex in the three-dimensional rigid body model of the obstacle;

[0027] The method comprises: rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, and obtaining a rendering image and a mask image of the obstacle for each frame of the real background image.

[0028] For each frame of the real background image, the three-dimensional rigid body model of the obstacle is rendered according to the three-dimensional rigid body model information, obstacle map and lighting parameters of the obstacle corresponding to the three-dimensional rigid body model of the frame of the real background image, so as to obtain a rendering image and a mask image of the obstacle for each frame of the real background image, wherein the resolution of the rendering image and the mask image of the obstacle is the same as the resolution of the real background image.

[0029] After recording the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process and before rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map, further comprising:

[0030] Build a blank scene, import a 3D rigid body model of any real background image into the scene, then adjust the camera angle so that the rendering of the 3D rigid body model of the real background image matches the background texture, and record the camera angle when the rendering of the 3D rigid body model of the real background image matches the background texture;

[0031] The method of rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process includes:

[0032] According to the three-dimensional rigid body model information, obstacle map, lighting parameters and the recorded camera viewing angle of the obstacle during the continuous physical interaction process, the three-dimensional rigid body model of the obstacle for each frame of the real background image is rendered.

[0033] After obtaining the obstacle falling process picture set, the method further includes:

[0034] The obstacle is marked in each picture in the obstacle falling process picture set.

[0035] A device for acquiring a picture of a falling obstacle, the device comprising:

[0036] A background three-dimensional rigid body model creation module is used to: obtain a real background image sequence of an obstacle, wherein the real background image sequence of the obstacle is: an image sequence of a real scene that may physically interact with the obstacle, and the image sequence does not contain obstacles; obtain depth information of each frame of the real background image in the real background image sequence; and establish a three-dimensional rigid body model of each frame of the real background image according to each frame of the real background image and the corresponding depth information;

[0037] The obstacle three-dimensional rigid body model acquisition module is used to: obtain the three-dimensional rigid body model of the obstacle;

[0038] The physical interaction simulation module is used to simulate the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background image, and record the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process;

[0039] A rendering module, used to: render the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, so as to obtain a rendering image and a mask image of the obstacle for each frame of the real background image; wherein the obstacle for each frame of the real background image is the obstacle that interacts with the three-dimensional rigid body model of each frame of the real background image;

[0040] The fusion module is used to: fuse the rendered image of the obstacle for each frame of the real background image with the corresponding real background image according to the rendered image and the mask image of the obstacle for each frame of the real background image, so as to obtain a set of images of the obstacle falling process.

[0041] A non-transitory computer-readable storage medium stores instructions, which, when executed by a processor, cause the processor to execute any of the above methods for acquiring images of falling obstacles.

[0042] In the above embodiment, the three-dimensional rigid body model of the real background image is generated by acquiring the depth information of the real background image, and then the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background image is simulated, and then the three-dimensional rigid body model of the obstacle for each frame of the real background image is rendered according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, and finally, according to the rendering image and mask image of the obstacle for each frame of the real background image, the rendering image of the obstacle for each frame of the real background image is fused with the corresponding real background image to obtain a set of pictures of the obstacle falling process, thereby: no manual participation is required, and no modeling of each element in the background model is required, which reduces manual risks, reduces costs, and improves the speed and efficiency of obtaining the obstacle falling pictures; the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background image is simulated, and its principle is highly consistent with the dynamic principle of the real physical world, so that the final set of pictures of the obstacle falling process is closer to real data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0044] Figure 1 This is an example of a rockfall on a railway.

[0045] Figure 2 A flow chart of a method for obtaining a falling obstacle image provided by an embodiment of the present invention;

[0046] Figure 3 A real picture of a railway where rockfall may occur in an application example of the present invention;

[0047] Figure 4 for Figure 3 Schematic diagram of the depth image;

[0048] Figure 5 for Figure 3 Rendering of a 3D rigid body model;

[0049] Figure 6 is a schematic diagram of segmenting the three-dimensional rigid body model of a stone when the obstacle is a stone;

[0050] Figure 7 A rendering of the physical interaction between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of a certain frame of real background image;

[0051] Figure 8 This is a rendering of an application example of the present invention when the obstacle is a stone;

[0052] Fig. 9 A mask image when the obstacle is a stone in an application example of the present invention;

[0053] Fig.10 It is a schematic diagram of matching a rendering of a three-dimensional rigid body model of a real background image with a background map in an application example of the present invention;

[0054] Fig.11 A schematic diagram of a frame of a picture in a picture set of an obstacle falling process in an application example of the present invention;

[0055] Fig.12 A schematic diagram of the structure of a device for acquiring images of falling obstacles provided in one embodiment of the present invention. DETAILED DESCRIPTION

[0056] 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

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

[0058] Figure 2 This is a flow chart of a method for obtaining a falling obstacle image provided by an embodiment of the present invention, and the specific steps are as follows:

[0059] Step 201: Acquire a real background image sequence of an obstacle, wherein the real background image sequence of an obstacle is: an image sequence of a real scene that may physically interact with the obstacle, and the image sequence does not contain an obstacle.

[0060] For example, the real background of an obstacle refers to the background of a real scene where an obstacle may fall. The "background" here refers to the scene when there is no obstacle.

[0061] In practical applications, video streams of scenes where obstacles may fall can be collected and saved in advance. In this case, step 201 specifically includes: intercepting a video stream of a preset length from the real background video stream of the obstacle collected in advance, decoding the intercepted video stream, and obtaining a real background picture sequence of the obstacle. The value of the preset length, that is, the specific length, can be determined according to the estimated duration of the obstacle falling in the real background.

[0062] Figure 3 This is a real picture of a railway where rockfall may occur in an application example of the present invention. The background picture is obtained by intercepting and decoding a real video stream of the railway that was collected in advance.

[0063] Step 202: Obtain depth information of each frame of the real background image in the real background image sequence.

[0064] In an optional embodiment, this step 202 specifically includes: inputting each frame of the real background image in the real background image sequence into a pre-trained image depth estimation model for calculation to obtain depth information of each frame of the real background image. A depth value is output for each pixel point of each frame of the real background image.

[0065] The training process of the image depth estimation model is a mature technology and will not be described in detail. In practical applications, the image depth estimation model can also directly adopt existing open source models such as the DepthAnything (monocular depth estimation) model.

[0066] Figure 4 for Figure 3 Schematic diagram of the depth image.

[0067] Step 203: Establish a three-dimensional rigid body model of each frame of the real background image according to each frame of the real background image and the corresponding depth information.

[0068] In an optional embodiment, this step 203 specifically includes: for each frame of the real background image, generating a two-dimensional grid with the same resolution as the real background image, and then stretching the depth value of each grid in the two-dimensional grid according to the depth value of each pixel point in the depth information of the real background image, thereby obtaining a three-dimensional rigid body model of the real background image.

[0069] The three-dimensional rigid body model of the real background image can be represented by the following two parameters:

[0070] Parameter 1: the three-dimensional coordinates of each vertex in the model;

[0071] Parameter 2: The texture coordinates of each vertex in the model.

[0072] Figure 5 for Figure 3 Rendering of a 3D rigid body model.

[0073] Step 204: Obtain a three-dimensional rigid body model of the obstacle.

[0074] In practical applications, a three-dimensional rigid model library of obstacles can be established in advance, in which one or more three-dimensional rigid models are stored for each type of obstacle. In this case, step 204 specifically includes: according to the type of obstacle to be obtained, a three-dimensional rigid model of the obstacle of the type in the three-dimensional rigid model library of obstacles is randomly obtained as the three-dimensional rigid model of the obstacle in step 204. Alternatively, the three-dimensional rigid model of the obstacle can be manually input; or the three-dimensional rigid model of the obstacle can be obtained by adding noise to a regular geometric body, such as Perlin noise.

[0075] In practical applications, the obstacle may split into multiple sub-obstacles during the falling process, and in this case, the 3D rigid body models of the multiple sub-obstacles need to be obtained in advance, that is, in step 204, after obtaining the 3D rigid body model of the obstacle, the following further includes: if the obstacle splits during the falling process, the 3D rigid body model of the obstacle is segmented to obtain the 3D rigid body models of the multiple sub-obstacles after segmentation. The segmentation algorithm can adopt an existing mature algorithm such as the Voronoi algorithm. Figure 6 This is a schematic diagram of segmenting the three-dimensional rigid body model of a stone when the obstacle is a stone. Figure 6 In the example, the stone is divided into three sub-stones.

[0076] Step 205: Simulate the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background image, and record the three-dimensional rigid body model information of the obstacle during the continuous physical interaction process.

[0077] In this step 205, the three-dimensional rigid body model information of the obstacles in the continuous physical interaction process is specifically recorded as follows: in the continuous physical interaction process, for each frame of the three-dimensional rigid body model of the real background image, a group of three-dimensional rigid body model information of the obstacles is recorded respectively, wherein the three-dimensional rigid body model information of each group of obstacles includes: the three-dimensional coordinates of each vertex of the obstacle and the texture coordinates of each vertex of the obstacle.

[0078] Among them, the air resistance, gravity, wind speed, elastic coefficient of the obstacle and static friction coefficient of the obstacle during the falling process can be pre-set, and the starting position of the obstacle can be pre-set, and then the falling process of the obstacle in the corresponding background can be physically simulated using a pre-established physical simulation library, that is, the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background picture is simulated, and a set of three-dimensional rigid body model information of the obstacle is recorded respectively for the physical interaction between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background picture. Among them, the physical simulation library can be established using existing mature methods.

[0079] It should be noted that, when the three-dimensional rigid body models of multiple sub-obstacles are obtained in step 204, in step 205, when the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background image is simulated, when the three-dimensional rigid body model of the obstacle collides with the three-dimensional rigid body model of a certain frame of the real background image for the first time, if the impulse of the collision is greater than the preset impulse threshold, the three-dimensional rigid body model of the obstacle is split into the three-dimensional rigid body models of the above-mentioned multiple sub-obstacles. From this point on, it is necessary to simulate the physical interaction process between the three-dimensional rigid body models of the multiple sub-obstacles and the three-dimensional rigid body models of the current and subsequent frames of the real background image, and a group of three-dimensional rigid body model information of the multiple sub-obstacles is recorded for the three-dimensional rigid body model of each frame of the real background image, each group of three-dimensional rigid body model information of the multiple sub-obstacles includes: the three-dimensional coordinates of each vertex of the three-dimensional rigid body model of each sub-obstacle in the multiple sub-obstacles and the texture coordinates of each vertex of the three-dimensional rigid body model of each sub-obstacle.

[0080] That is, in an optional embodiment, step 205 may specifically include: if the three-dimensional rigid body model of the obstacle is split into multiple sub-obstacles when physically interacting with the three-dimensional rigid body model of the real background image of the current frame, then start simulating the physical interaction process between the three-dimensional rigid body model of each sub-obstacle and the three-dimensional rigid body model of the real background image of the current frame and subsequent frames, and record the three-dimensional rigid body model information of each sub-obstacle during the physical interaction process.

[0081] Figure 7 It is a rendering of the physical interaction between the 3D rigid body model of the obstacle and the 3D rigid body model of a certain frame of real background image. Figure 7 There are three small stones in the red rectangle, which indicates that the obstacle has collided with the background.

[0082] Step 206: According to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, the three-dimensional rigid body model of the obstacle for each frame of the real background image is rendered using the obstacle map to obtain a rendering image and a mask image of the obstacle for each frame of the real background image. The obstacle for each frame of the real background image is the obstacle that interacts with the three-dimensional rigid body model of each frame of the real background image.

[0083] In step 206 , the rendering method may adopt the existing ray tracing rendering method. Before formal rendering, the ray parameters need to be predefined.

[0084] During actual rendering, this step 206 specifically includes: for each frame of the real background image, according to the recorded three-dimensional rigid body model information of the obstacle corresponding to the three-dimensional rigid body model of the frame of the real background image (that is, the three-dimensional coordinates and texture coordinates of each vertex of the three-dimensional rigid body model of the obstacle), the obstacle map and the lighting parameters, the three-dimensional rigid body model of the obstacle is rendered to obtain a rendering image and a mask image of the obstacle for each frame of the real background image, wherein the resolution of the rendering image and the mask image of the obstacle is the same as the resolution of the real background image. Figure 8 This is a rendering of an application example of the present invention when the obstacle is a stone; Fig. 9 This is a mask image when the obstacle is a stone in an application example of the present invention. The mask image is used to indicate the position of the obstacle in the corresponding real background image.

[0085] Considering that the camera perspective of the three-dimensional rigid body model of the real background image may not match the camera perspective of the real background image, therefore, in an optional embodiment, in step 206, according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, before using the obstacle map to render the three-dimensional rigid body model of the obstacle for each frame of the real background image, it further includes: building a blank scene, importing the three-dimensional rigid body model of any frame of the real background image into the scene, and then adjusting the camera perspective (including: adjusting rotation parameters and scaling parameters, etc.) to match the rendering of the three-dimensional rigid body model of the real background image with the background map. In this way, when the rendering of the three-dimensional rigid body model of the real background image matches the background map, it means that under the camera perspective, the position of the obstacle will correspond to the background map, and the camera perspective when the rendering of the three-dimensional rigid body model of the real background image matches the background map is recorded, and the camera perspective is used as the camera perspective when rendering the three-dimensional rigid body model of the obstacle.

[0086] Then: In this step 206, according to the 3D rigid body model information of the obstacle in the continuous physical interaction process, the obstacle map is used to render the 3D rigid body model of the obstacle for each frame of the real background image, specifically including: according to the 3D rigid body model information of the obstacle in the continuous physical interaction process, the obstacle map, the illumination parameters and the camera perspective recorded above, the 3D rigid body model of the obstacle for each frame of the real background image is rendered. Specifically, for each frame of the real background image, according to the 3D rigid body model information of the obstacle in the 3D rigid body model of the frame of the real background image (i.e., the 3D coordinates and texture coordinates of each vertex of the 3D rigid body model of the obstacle), the obstacle map, the illumination parameters and the camera perspective recorded above, the 3D rigid body model of the obstacle is rendered.

[0087] Fig.10 It is a schematic diagram of matching a rendering of a three-dimensional rigid body model of a real background image with a background map in an application example of the present invention.

[0088] Step 207: Based on the rendering image and mask image of the obstacle for each frame of the real background image, the rendering image of the obstacle for each frame of the real background image is merged with the corresponding real background image to obtain a set of images of the obstacle falling process.

[0089] That is, for each frame of the real background image, the position of the obstacle in the background image can be determined based on the mask image of the obstacle for the background image, and then the rendering image of the obstacle for the background image and the background image are fused at the corresponding position to obtain the obstacle falling image for the background image.

[0090] The specific fusion algorithm is not limited in this embodiment, and an existing mature fusion algorithm such as Poisson fusion algorithm may be used.

[0091] In addition, the obstacle can be marked in each frame of the obstacle falling process picture set to facilitate subsequent use as training data.

[0092] In addition, after obtaining the obstacle falling process picture set, the obstacle falling process picture set can be further encoded into a video stream.

[0093] Fig.11 This is a schematic diagram of a frame of a picture in a picture set of an obstacle falling process in an application example of the present invention, wherein a red rectangular frame is used to calibrate the stone.

[0094] The beneficial technical effects of the embodiments of the present invention are as follows:

[0095] The 3D rigid body model of the real background image is generated by acquiring the depth information of the real background image. Then, the continuous physical interaction process between the 3D rigid body model of the obstacle and the 3D rigid body model of each frame of the real background image is simulated. Then, according to the 3D rigid body model information of the obstacle in the continuous physical interaction process, the 3D rigid body model of the obstacle for each frame of the real background image is rendered. Finally, according to the rendering image and mask image of the obstacle for each frame of the real background image, the rendering image of the obstacle for each frame of the real background image is fused with the corresponding real background image to obtain a set of images of the obstacle falling process, thereby:

[0096] 1. No manual intervention is required, and there is no need to model each element in the background model separately, which reduces manual risks and costs, and improves the speed and efficiency of obtaining pictures of the obstacle falling process;

[0097] Second, the continuous physical interaction process between the 3D rigid body model of the simulated obstacle and the 3D rigid body model of each frame of the real background picture is highly consistent with the dynamic principle of the real physical world, so that the final obstacle falling process picture set is closer to the real data. When the obstacle falling process picture set is applied to the obstacle recognition model training process, the recall rate of the recognition algorithm is greatly improved;

[0098] 3. It can realize automatic calibration of obstacles in the obstacle falling process picture set, thereby reducing labor costs and improving the accuracy and efficiency of obstacle recognition model training.

[0099] Fig.12 The schematic diagram of the structure of the obstacle falling picture acquisition device provided by an embodiment of the present invention mainly includes: a background three-dimensional rigid body model creation module 121, an obstacle three-dimensional rigid body model acquisition module 122, a physical interaction simulation module 123, a rendering module 124 and a fusion module 125, wherein:

[0100] The background three-dimensional rigid body model creation module 121 is used to: obtain a real background image sequence of the obstacle, wherein the real background image sequence of the obstacle is: an image sequence of a real scene that may physically interact with the obstacle, and the image sequence does not contain obstacles; obtain the depth information of each frame of the real background image in the real background image sequence; and establish a three-dimensional rigid body model of each frame of the real background image based on each frame of the real background image and the corresponding depth information.

[0101] The obstacle three-dimensional rigid body model acquisition module 122 is used to: acquire the three-dimensional rigid body model of the obstacle.

[0102] The physical interaction simulation module 123 is used to simulate the continuous physical interaction process between the 3D rigid body model of the obstacle and the 3D rigid body model of each frame of the real background image, and record the 3D rigid body model information of the obstacle during the continuous physical interaction process.

[0103] The rendering module 124 is used to render the 3D rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the 3D rigid body model information of the obstacle in the continuous physical interaction process, and obtain a rendering image and a mask image of the obstacle for each frame of the real background image. The obstacle for each frame of the real background image is the obstacle that interacts with the 3D rigid body model of each frame of the real background image.

[0104] The fusion module 125 is used to fuse the rendered image of the obstacle for each frame of the real background image with the corresponding real background image according to the rendered image and the mask image of the obstacle for each frame of the real background image, so as to obtain a set of images of the obstacle falling process.

[0105] In an optional embodiment, the background three-dimensional rigid body model creation module 121 obtains the depth information of each frame of the real background image in the real background image sequence, including: inputting each frame of the real background image in the real background image sequence into a pre-trained image depth estimation model for calculation to obtain the depth information of each frame of the real background image.

[0106] In an optional embodiment, the background three-dimensional rigid body model creation module 121 obtains a real background image sequence of the obstacle, including: intercepting a video stream of a preset length from a pre-collected real background video stream of the obstacle, decoding the intercepted video stream, and obtaining the real background image sequence of the obstacle.

[0107] In an optional embodiment, the background three-dimensional rigid body model creation module 121 establishes a three-dimensional rigid body model of each frame of the real background image based on each frame of the real background image and the corresponding depth information, including: for each frame of the real background image, generating a two-dimensional grid with the same resolution as the resolution of the real background image, and then stretching the depth value of each grid in the two-dimensional grid according to the depth value of each pixel point in the depth information of the real background image to obtain the three-dimensional rigid body model of the real background image.

[0108] In an optional embodiment, after the obstacle 3D rigid body model acquisition module acquires the 3D rigid body model of the obstacle, it is further used to: if the obstacle is split during the falling process, segment the 3D rigid body model of the obstacle to obtain the 3D rigid body models of multiple segmented sub-obstacles;

[0109] Furthermore, the physical interaction simulation module 123 simulates the physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background image, including: if the three-dimensional rigid body model of the obstacle is split into multiple sub-obstacles when physically interacting with the three-dimensional rigid body model of the real background image of the current frame, then starting to simulate the physical interaction process between the three-dimensional rigid body model of each sub-obstacle and the three-dimensional rigid body model of the real background image of the current frame and subsequent frames.

[0110] In an optional embodiment, the physical interaction simulation module 123 records the three-dimensional rigid body model information of the obstacle during the continuous physical interaction process, including: during the continuous physical interaction process, for each frame of the three-dimensional rigid body model of the real background image, respectively recording a group of three-dimensional rigid body model information of the obstacle, wherein the three-dimensional rigid body model information of each group of obstacles includes: the three-dimensional coordinates of each vertex of the obstacle and the texture coordinates of each vertex of the obstacle;

[0111] Moreover, the rendering module 124 renders the 3D rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the 3D rigid body model information of the obstacle during the continuous physical interaction process, and obtains a rendering image and a mask image of the obstacle for each frame of the real background image, including: for each frame of the real background image, according to the recorded 3D rigid body model information of the obstacle corresponding to the 3D rigid body model of the frame of the real background image, the obstacle map and the lighting parameters, the 3D rigid body model of the obstacle is rendered to obtain a rendering image and a mask image of the obstacle for each frame of the real background image, wherein the resolution of the rendering image and the mask image of the obstacle is the same as the resolution of the real background image.

[0112] In an optional embodiment, before rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map, the rendering module 124 is further used to: build a blank scene, import the three-dimensional rigid body model of any frame of the real background image into the scene, and then adjust the camera angle so that the rendering of the three-dimensional rigid body model of the real background image matches the background map, and record the camera angle when the rendering of the three-dimensional rigid body model of the real background image matches the background map;

[0113] Furthermore, the rendering module 124 renders the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the three-dimensional rigid body model information of the obstacle during the continuous physical interaction process, including: rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image according to the three-dimensional rigid body model information of the obstacle during the continuous physical interaction process, the obstacle map, the lighting parameters and the recorded camera viewing angle.

[0114] In an optional embodiment, after obtaining the obstacle falling process picture set, the fusion module 125 is further configured to: identify the obstacle in each picture in the obstacle falling process picture set.

[0115] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores instructions. When these instructions are executed by a processor, the processor executes the method for acquiring a falling obstacle picture as described in any of the aforementioned embodiments.

[0116] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims disclosed herein may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope disclosed in the present application.

[0117] Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas, and is not used to limit the present application. For those skilled in the art, changes can be made in the specific implementation methods and application scopes according to the ideas, spirits and principles of the present invention, and any modifications, equivalent substitutions, improvements, etc. made therein should be included in the scope of protection of this application.

Claims

1. A method for obtaining a falling obstacle picture, characterized in that: The method includes: Acquire a real background image sequence of the obstacle, wherein the real background image sequence of the obstacle is: an image sequence of a real scene that may physically interact with the obstacle, and the image sequence does not contain the obstacle; Obtaining depth information of each frame of the real background image in the real background image sequence; According to each frame of the real background image and the corresponding depth information, a three-dimensional rigid body model of each frame of the real background image is established; Obtain the three-dimensional rigid body model of the obstacle; Simulate the continuous physical interaction process between the 3D rigid body model of the obstacle and the 3D rigid body model of each frame of the real background image, and record the 3D rigid body model information of the obstacle during the continuous physical interaction process; According to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, the three-dimensional rigid body model of the obstacle for each frame of the real background image is rendered using the obstacle map to obtain a rendering image and a mask image of the obstacle for each frame of the real background image, wherein the obstacle for each frame of the real background image is the obstacle that interacts with the three-dimensional rigid body model of each frame of the real background image; According to the rendering image and mask image of the obstacle for each frame of the real background image, the rendering image of the obstacle for each frame of the real background image is fused with the corresponding real background image to obtain a set of images of the obstacle falling process.

2. The method according to claim 1, characterized in that The step of obtaining the depth information of each frame of the real background picture in the real background picture sequence includes: Each frame of the real background image in the real background image sequence is input into a pre-trained image depth estimation model for calculation to obtain the depth information of each frame of the real background image.

3. The method according to claim 1, characterized in that The step of obtaining a real background image sequence of obstacles includes: A video stream of a preset length is intercepted from a real background video stream of an obstacle collected in advance, and the intercepted video stream is decoded to obtain a real background picture sequence of the obstacle.

4. The method according to claim 1, characterized in that: The method of establishing a three-dimensional rigid body model of each frame of the real background image according to each frame of the real background image and the corresponding depth information includes: For each frame of the real background image, a two-dimensional grid with the same resolution as the real background image is generated. Then, according to the depth value of each pixel in the depth information of the real background image, the depth value of each grid in the two-dimensional grid is stretched to obtain a three-dimensional rigid body model of the real background image.

5. The method according to claim 1, characterized in that After obtaining the three-dimensional rigid body model of the obstacle and before the continuous physical interaction process between the three-dimensional rigid body model of the simulated obstacle and the three-dimensional rigid body model of each frame of the real background image, the method further includes: If the obstacle is split during the falling process, the three-dimensional rigid body model of the obstacle is segmented to obtain three-dimensional rigid body models of multiple segmented sub-obstacles; Furthermore, the physical interaction process between the three-dimensional rigid body model of the simulated obstacle and the three-dimensional rigid body model of each frame of the real background image includes: If the three-dimensional rigid body model of the obstacle is split into multiple sub-obstacles when physically interacting with the three-dimensional rigid body model of the real background image of the current frame, the physical interaction process between the three-dimensional rigid body model of each sub-obstacle and the three-dimensional rigid body model of the real background image of the current frame and subsequent frames is simulated.

6. The method according to claim 1, characterized in that The three-dimensional rigid body model information of the obstacle recorded in the continuous physical interaction process includes: In the continuous physical interaction process, a set of three-dimensional rigid body model information of obstacles is recorded for the three-dimensional rigid body model of each frame of the real background image, wherein the three-dimensional rigid body model information of each set of obstacles includes: three-dimensional coordinates of each vertex in the three-dimensional rigid body model of the obstacle and texture coordinates of each vertex in the three-dimensional rigid body model of the obstacle; The method comprises: rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, and obtaining a rendering image and a mask image of the obstacle for each frame of the real background image. For each frame of the real background image, the three-dimensional rigid body model of the obstacle is rendered according to the three-dimensional rigid body model information, obstacle map and lighting parameters of the obstacle corresponding to the three-dimensional rigid body model of the frame of the real background image, so as to obtain a rendering image and a mask image of the obstacle for each frame of the real background image, wherein the resolution of the rendering image and the mask image of the obstacle is the same as the resolution of the real background image.

7. The method according to claim 1, characterized in that After recording the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process and before rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map, further comprising: Build a blank scene, import a 3D rigid body model of any real background image into the scene, then adjust the camera angle so that the rendering of the 3D rigid body model of the real background image matches the background texture, and record the camera angle when the rendering of the 3D rigid body model of the real background image matches the background texture; The method of rendering the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process includes: According to the three-dimensional rigid body model information, obstacle map, lighting parameters and the recorded camera viewing angle of the obstacle during the continuous physical interaction process, the three-dimensional rigid body model of the obstacle for each frame of the real background image is rendered.

8. The method according to claim 1, characterized in that After obtaining the obstacle falling process picture set, the method further includes: The obstacle is marked in each picture in the obstacle falling process picture set.

9. A device for acquiring images of falling obstacles, characterized in that: The device includes: A background three-dimensional rigid body model creation module is used to: obtain a real background image sequence of an obstacle, wherein the real background image sequence of the obstacle is: an image sequence of a real scene that may physically interact with the obstacle, and the image sequence does not contain obstacles; obtain depth information of each frame of the real background image in the real background image sequence; and establish a three-dimensional rigid body model of each frame of the real background image according to each frame of the real background image and the corresponding depth information; The obstacle three-dimensional rigid body model acquisition module is used to: obtain the three-dimensional rigid body model of the obstacle; The physical interaction simulation module is used to simulate the continuous physical interaction process between the three-dimensional rigid body model of the obstacle and the three-dimensional rigid body model of each frame of the real background image, and record the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process; A rendering module, used to: render the three-dimensional rigid body model of the obstacle for each frame of the real background image using the obstacle map according to the three-dimensional rigid body model information of the obstacle in the continuous physical interaction process, so as to obtain a rendering image and a mask image of the obstacle for each frame of the real background image; wherein the obstacle for each frame of the real background image is the obstacle that interacts with the three-dimensional rigid body model of each frame of the real background image; The fusion module is used to: fuse the rendered image of the obstacle for each frame of the real background image with the corresponding real background image according to the rendered image and the mask image of the obstacle for each frame of the real background image, so as to obtain a set of images of the obstacle falling process.

10. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores instructions, which, when executed by a processor, cause the processor to execute the method for acquiring a falling obstacle image as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Target box labeling method and device for target object in training sample and storage medium

    CN110378999A

  • Self-moving tool cleaning route updating method and device, computer equipment and medium

    CN112220405A

  • Scene information fusion method and system, server and storage medium

    CN112396034A

  • Map construction method and device, electronic equipment and storage medium

    CN113284240A

  • Equipment for monitoring surrounding of vehicle

    JP1996242443A