A scene video fusion method, system, electronic device and storage medium

By acquiring multiple camera videos and merging images based on position parameters, the problem of low efficiency in the integration of virtual reality and real scenes is solved, the rapid integration of virtual reality and real scenes is achieved, and the interactivity and visualization experience are enhanced.

CN112712487BActive Publication Date: 2024-10-01BEIJING SOFTONG INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011536124.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-23
Publication Date
2024-10-01
Estimated Expiration
2040-12-23

AI Technical Summary

Technical Problem

Existing technology cannot effectively realize the rapid integration of virtual scenes and real scenes, resulting in low efficiency in the application of virtual reality in security and management.

Method used

By obtaining videos collected by at least two cameras, determine the frame images containing the same target physical object, perform image fusion based on the camera position parameters, generate the fused image, and project it into the virtual scene to achieve rapid integration of virtual reality and real scenes. .

Benefits of technology

It achieves rapid integration of virtual scenes and real scenes, enhances interactivity and visualization experience, and improves image fusion efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112712487B_ABST
    Figure CN112712487B_ABST
Patent Text Reader

Abstract

The present invention discloses a scene video fusion method, system, electronic device and storage medium, wherein the method comprises: acquiring videos captured by at least two cameras, and determining at least two frames of images containing the same target physical object in the captured videos; fusing the at least two frames of images into one frame of image based on position parameters of the at least two cameras to obtain a fused image; and projecting the target physical object in the fused image to a corresponding position in a virtual scene. The technical solution of the embodiments of the present invention can quickly realize image fusion, can realize the superposition of real images and virtual scenes, effectively increase the interactivity between virtual scenes and reality, and enhance the visualization experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of information processing technology, and in particular to a scene video fusion method, system, electronic device and storage medium. Background Art

[0002] Scene video fusion technology is a branch of virtual reality technology and a development stage of virtual reality. It can fuse one or more image sequence videos of a scene or model collected by video acquisition devices with a related virtual scene to generate a new virtual scene or model of this scene. In the construction of smart cities, especially in security and management, the fusion of scene videos is of great significance.

[0003] Some traditional monitoring equipment such as ordinary cameras cannot realize the combination of virtual scenes and reality. In addition, related technologies directly fuse the original images in the process of realizing scene video fusion, which has slow fusion speed and low efficiency. Summary of the invention

[0004] The embodiments of the present invention provide a scene video fusion method, system, electronic device and storage medium, which can quickly realize image fusion, can realize the superposition of real images and virtual scenes, effectively increase the interactivity between virtual scenes and reality, and enhance the visualization experience.

[0005] In a first aspect, an embodiment of the present invention provides a scene video fusion method, wherein the method includes:

[0006] Acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras;

[0007] Based on the at least two camera position parameters, the at least two frames of images are fused into one frame of image to obtain a fused image;

[0008] The target physical object in the fused image is projected to a corresponding position in the virtual scene.

[0009] In a second aspect, an embodiment of the present invention further provides a scene video fusion system, wherein the system includes:

[0010] An image acquisition module is used to acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras;

[0011] An image fusion module, used for fusing the at least two frames of images into one frame of image based on the at least two camera position parameters to obtain a fused image;

[0012] The projection module is used to project the target physical object in the fused image to a corresponding position in the virtual scene.

[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, wherein the device includes: one or more processors;

[0014] a storage device for storing one or more programs,

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the scene video fusion method as described in any one of the embodiments of the present invention.

[0016] In a fourth aspect, an embodiment of the present invention further provides a storage medium on which a computer program is stored, and when the program is executed by a processor, a scene video fusion method as described in any one of the embodiments of the present invention is implemented.

[0017] The technical solution provided by the embodiment of the present invention obtains videos captured by at least two cameras, and determines at least two frames of images containing the same target physical object in the captured video, fuses the at least two frames of images into one frame of image based on at least two camera position parameters to obtain a fused image, and projects the target physical object in the fused image to a corresponding position in a virtual scene. This can achieve rapid image fusion, achieve mutual superposition of real images and virtual scenes, effectively increase the interactivity between virtual scenes and reality, and enhance the visualization experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a scene video fusion method provided by an embodiment of the present invention;

[0019] Figure 2 is a flow chart of another scene video fusion method provided by an embodiment of the present invention;

[0020] Figure 3 is a flow chart of another scene video fusion method provided by an embodiment of the present invention;

[0021] Figure 4 is a flow chart of another scene video fusion method provided by an embodiment of the present invention;

[0022] Figure 5 (a) is the original image before affine transformation;

[0023] Figure 5 (b) is the output effect diagram after affine transformation;

[0024] Figure 6 (a) is the original image before perspective transformation;

[0025] Figure 6 (b) is the output effect after perspective transformation;

[0026] Figure 7 It is a flowchart of image fusion;

[0027] Figure 8 (a) is the original image before radial distortion correction;

[0028] Figure 8 (b) is the effect of correcting the pincushion distortion deviation of the original image;

[0029] Figure 8 (c) is the effect of correcting the barrel distortion of the original image;

[0030] Fig. 9 (a) is the original image before tangential distortion correction;

[0031] Fig. 9 (b) is the effect image after tangential distortion deviation correction is performed on the original image;

[0032] Fig.10 It is the original example image in the semantic segmentation process;

[0033] Fig.11 It is the semantic segmentation mask map corresponding to the original example map in the semantic segmentation process;

[0034] Fig.12 It is the semantic segmentation foreground map in the semantic segmentation process;

[0035] Fig.13 It is a semantic segmentation synthesis image in the semantic segmentation process;

[0036] Fig.14 This is the alpha channel image obtained by AI cutout;

[0037] Fig.15 This is an example of a synthetic image of AI cutouts;

[0038] Fig.16 is a schematic diagram of the scene video fusion system architecture applicable to the embodiment of the present invention;

[0039] Fig.17 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0041] Figure 1 is a flow chart of a scene video fusion method provided by an embodiment of the present invention. The method can be executed by a scene video fusion system. The system can be implemented by software and / or hardware. The system can be configured in an electronic device such as a server. Optionally, the method is applied to a scene where a virtual scene is fused with a video captured by a camera. Figure 1 As shown, the technical solution provided by the embodiment of the present invention specifically includes:

[0042] S110: Acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras.

[0043] In an embodiment of the present invention, optionally, the position of the camera in the real indoor scene is predetermined, and the position is determined based on the field of view range and the distortion caused by image fusion, that is, the determined camera position can not only meet the requirements of being able to capture a relatively wide field of view range, for example, it can be the range of the entire real indoor scene captured by at least two cameras, but also can achieve the effect of minimizing the distortion when the images in the videos captured by different cameras are fused. The video captured by the camera can have a variety of formats, which can be avi, mp4, rtsp, m3u8, or other video formats. At least one frame of image is obtained from the videos captured by different cameras respectively, and the at least two frames of image obtained must contain the same target physical object, that is, there must be an overlapping area in at least two frames of image. The target physical object can be a person, an object, or other things in a real indoor scene.

[0044] In one implementation of the embodiment of the present invention, optionally, after determining in the captured video at least two frames of images containing the same target physical object, the method further includes: performing image transformation on the at least two frames of images to obtain a transformed image.

[0045] In an embodiment of the present invention, optionally, the image transformation can be performed based on an affine transformation to obtain a transformed image by performing an image transformation on an image with an oblique perspective, or can be performed based on a perspective transformation to transform an image taken by a short-focus camera into an image taken by a long-focus camera to obtain a transformed image, or can be obtained by using other transformation methods. It is determined which image transformation method is better based on actual conditions.

[0046] S120: Fusing the at least two frames of images into one frame of image based on the at least two camera position parameters to obtain a fused image.

[0047] In the embodiment of the present invention, optionally, each camera position is fixed and each camera position corresponds to a position parameter, i.e., a transformation matrix of the camera, which is determined by the camera position. The transformation matrix of the camera is determined based on the reference coordinates. The reference coordinates can be selected from the corners of a real indoor scene, or other reference coordinates can be used as the reference coordinates, which can be determined according to the situation. Based on the position parameters of each camera, at least two frames of images are fused into one frame of image through an image fusion algorithm, i.e., a fused image is obtained.

[0048] Therefore, by fusing at least two frames of images into one frame of image based on at least two camera position parameters, the images can be quickly fused to obtain a fused image.

[0049] S130: Projecting the target physical object in the fused image to a corresponding position in the virtual scene.

[0050] In an embodiment of the present invention, optionally, the virtual scene is obtained by modeling or mapping a real indoor scene through 3D modeling or mapping, and the virtual scene and the real indoor scene have a 1:1 ratio correspondence. With the help of a specific video editing tool, such as Video Mixer Editor, a projection matrix is ​​determined based on position parameters of the camera in the virtual scene to realize virtual reality by projecting the target physical object in the fused image to the corresponding position in the virtual scene. Virtual reality can also be realized in other ways.

[0051] In one implementation of the embodiments of the present invention, optionally, projecting the target physical object in the fused image to a corresponding position in the virtual scene includes: determining a projection relationship based on position parameters of a camera in the virtual scene and position parameters of a camera in a real indoor scene; and projecting the target physical object in the fused image to a corresponding position in the virtual scene based on the projection relationship.

[0052] In the embodiment of the present invention, optionally, the position parameters of the camera in the virtual scene correspond to the position parameters of the camera in the real indoor scene one by one, and the position parameters of the camera in the virtual scene can be completely consistent with the position parameters of the camera in the real indoor scene, or other corresponding relationships can be used. Based on the corresponding relationship, the projection relationship is determined, and based on the projection relationship, each pixel point of the fused image is projected and transformed based on the corresponding coordinate transformation formula, and the transformation between the two three-dimensional coordinate systems is realized through the coordinate transformation formula, and the target physical object in the fused image is projected to the corresponding position in the virtual scene.

[0053] Therefore, by determining the projection relationship based on the position parameters of the camera in the virtual scene and the position parameters of the camera in the real indoor scene, and projecting the target physical object in the fused image to the corresponding position in the virtual scene based on the projection relationship, the correspondence between the virtual scene and the real indoor scene can be achieved, which can enhance the sense of reality and immersive experience.

[0054] In an embodiment of the present invention, optionally, in the process of projecting the target physical object in the fused image to the corresponding position in the virtual scene, editing tools can also be used for editing, including cropping (i.e., painting out parts that are not the main target or affect the visual effect due to projection mismatch caused by field of view angle transformation), perspective transformation and color difference matching (i.e., decolorization and crack elimination, etc., can be achieved, and the color at the corner points is adjusted according to the color of the video to reduce color difference) to make the fusion smoother.

[0055] The technical solution provided by the embodiment of the present invention obtains videos captured by at least two cameras, and determines at least two frames of images containing the same target physical object in the captured video, fuses the at least two frames of images into one frame of image based on at least two camera position parameters to obtain a fused image, and projects the target physical object in the fused image to a corresponding position in the virtual scene, that is, by adding at least two camera position parameters when fusing at least two frames of images, and projecting the target physical object in the fused image to a corresponding position in the virtual scene after the image fusion is completed, rapid image fusion can be achieved, and real images and virtual scenes can be superimposed on each other, effectively increasing the interactivity between the virtual scene and reality, and enhancing the visualization experience.

[0056] Figure 2 It is a flowchart of the scene video fusion method provided by an embodiment of the present invention. In the embodiment of the present invention, optionally, the at least two frames of images are fused into one frame of image based on the position parameters of the at least two cameras to obtain a fused image, including: determining the overlapping area in the at least two frames of images based on the position parameters of the at least two cameras; fusing the target physical objects in the overlapping area in each frame of the image using an image fusion algorithm, and filling the non-overlapping area in the at least two frames of images to obtain the fused image.

[0057] like Figure 2 As shown, the technical solution provided by the embodiment of the present invention includes:

[0058] S210: Obtain videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras.

[0059] S220: Determine an overlapping area in the at least two frames of images based on position parameters of the at least two cameras.

[0060] In an embodiment of the present invention, optionally, based on the position parameters of at least two cameras, the overlapping area of ​​at least two frames of images can be calculated. The specific determination method is: by cutting the at least two frames of images into small units of 10×10 respectively, calculating the world coordinates of the midpoints of each corresponding small unit in the at least two frames of images, if the world coordinates overlap, it represents an overlapping area; if the world coordinates do not overlap, it represents a non-overlapping area.

[0061] S230: Using an image fusion algorithm to fuse the target physical object in the overlapping area of ​​each frame of image, and performing image filling on the non-overlapping area of ​​the at least two frames of image to obtain the fused image.

[0062] In an embodiment of the present invention, optionally, the RGB values ​​of non-overlapping areas of at least two frames of images are set to 1, and then the at least two frames of images are input into an image fusion algorithm for image fusion. The image fusion process may include: feature point extraction (i.e., extracting feature points in the input image based on the input image, each feature point including two attributes: position and feature vector), image registration (after respectively registering the attributes of corresponding feature points in the input image, a group of images with the highest confidence and the most feature points are calculated through a specific algorithm), and obtaining a projection matrix from one frame of image to another frame of image (i.e., image stitching is achieved by transforming one frame of image relative to another frame of image), and then the non-overlapping area, i.e., the area with the RGB value set to 1, is filled with the corresponding area image of the original image, and then post-stitching is performed, i.e., the black part that appears in the image fusion process is removed, and finally the fused image is output.

[0063] Therefore, by fusing the target physical objects in the overlapping areas of each frame of image using an image fusion algorithm, and filling the non-overlapping areas in at least two frames of image to obtain a fused image, it is possible to extract feature points only in the overlapping areas, greatly reducing the workload of feature extraction for the entire frame of image, improving image fusion efficiency, and accelerating image fusion speed.

[0064] S240: Projecting the target physical object in the fused image to a corresponding position in the virtual scene.

[0065] Figure 3 It is a flowchart of the scene video fusion method provided by an embodiment of the present invention. In the embodiment of the present invention, optionally, the method provided by the embodiment of the present invention also includes: cutting out other physical objects in the fused image except the target physical object, and projecting the cut-out images of the other physical objects into the virtual scene.

[0066] Optionally, before cutting out physical objects other than the target physical object in the fused image, the method provided by an embodiment of the present invention further includes: inputting an image containing the other physical objects in a real indoor scene corresponding to the virtual scene and a mask file corresponding to the physical objects into a semantic segmentation model, and training the semantic segmentation model.

[0067] like Figure 3 As shown, the technical solution provided by the embodiment of the present invention includes:

[0068] S310: Obtain videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras.

[0069] S320: Fusing the at least two frames of images into one frame of image based on the at least two camera position parameters to obtain a fused image.

[0070] S330: Projecting the target physical object in the fused image to a corresponding position in the virtual scene.

[0071] S340: Inputting the image containing the other physical objects in the real indoor scene corresponding to the virtual scene and the corresponding mask file of the physical objects into the semantic segmentation model to train the semantic segmentation model.

[0072] In an embodiment of the present invention, optionally, the semantic segmentation model is a model in machine learning, and its structure can be a neural network structure or other structures. Before using the semantic segmentation model, it also includes training the semantic segmentation model: inputting the image of other physical objects in the real indoor scene corresponding to the virtual scene in the training set and the mask file of the corresponding physical object into the semantic segmentation model, and training the semantic segmentation model. Among them, the mask file records the category to which each pixel of the image of other physical objects in the real indoor scene corresponding to the virtual scene belongs, for example, which physical object the pixel belongs to. Specifically, the image of other physical objects in the real indoor scene corresponding to the virtual scene in the training set and the mask file of the corresponding physical object are input into the semantic segmentation model to obtain the category corresponding to each pixel point, and the mask file of the corresponding physical object and the category corresponding to each pixel point obtained are simultaneously input into the loss function, and it is judged whether the semantic segmentation model needs to be optimized according to the output result of the loss function. When the output result of the loss function meets the preset condition, the training process can be stopped to obtain the trained semantic segmentation model.

[0073] Therefore, by inputting images of other physical objects in the real indoor scene corresponding to the virtual scene and the mask files of the corresponding physical objects into the semantic segmentation model for training, the trained semantic segmentation model can recognize the physical objects in the images of other physical objects in the real indoor scene corresponding to the virtual scene, thereby providing accurate and reliable cutout content for the subsequent cutout process.

[0074] S350: Cut out other physical objects in the fused image except the target physical object, and project the cut-out images of the other physical objects into the virtual scene.

[0075] In the embodiment of the present invention, other physical objects may optionally identify complex targets. If other physical objects are simply projected onto the virtual scene, the actual projection effect onto the virtual scene cannot be integrated with the surrounding environment in the virtual scene, and the natural fit requirement of scene video fusion cannot be met. In this case, it is necessary to cut out the image containing other physical objects to identify the other physical objects, and then use the projection technology to project the cut out other physical objects to the corresponding position of the virtual scene. You can use a trained semantic segmentation model for cutting out, or you can use a neural network-based AI cutting out technology trained on specific indoor targets for cutting out, or you can choose other methods for cutting out.

[0076] In one implementation of the embodiments of the present invention, optionally, the cutting out other physical objects except the target physical object in the fused image includes: cutting out other physical objects except the target physical object in the fused image through a semantic segmentation model.

[0077] In an embodiment of the present invention, optionally, based on inputting images of other physical objects in a real indoor scene corresponding to a virtual scene and mask files of the corresponding physical objects into a semantic segmentation model to obtain a trained semantic segmentation model, other physical objects in images of other physical objects in a real indoor scene corresponding to the virtual scene can be identified, and clipping of other physical objects can be achieved, thereby providing a reliable and accurate image source for better fusion of scene videos.

[0078] Therefore, by cutting out the physical objects other than the target physical object in the fused image and projecting the images of the other physical objects obtained into the virtual scene, the virtual scene can be synchronized with the real indoor scene, achieving a smooth and fluent scene video fusion effect.

[0079] Figure 4 is a flow chart of a scene video fusion method provided by an embodiment of the present invention. Figure 4As shown in , the black dots in the real indoor scene are the fusion targets, and the black dots in the virtual scene are the projections after fusion. Figure 4 As shown, the technical solution provided by the embodiment of the present invention includes the following steps:

[0080] 1. Get video: support video data access in common formats, including avi, mp4, rtsp, m3u8, etc.

[0081] 2. Get images: The concept of video is continuous images. A complete video contains multiple frames of images and the motion information of the images. Each video has a corresponding number of frames. For example, a 60-frame video, that is, 60 frames per second, actually plays 60 frames of images per second, so it is also called a video stream. Since the frequency of human eye recognition is limited, when the number of image frames seen in a unit time exceeds a certain number, the human eye feels that the picture is moving. So in fact, video is also an image, and processing video is the processing of each frame of the image. Video fusion is to divide the video into a corresponding number of images according to the number of frames for processing.

[0082] 3. Image transformation: Image transformation algorithm based on OpenCV, mainly affine transformation and perspective transformation.

[0083] Affine transformation and perspective transformation are of great significance in image restoration and local image change processing. Affine transformation is more commonly used in 2D planes, while perspective transformation is more commonly used in 3D planes. The principles and results of the two transformations are similar, but appropriate transformations should be used for different occasions. The mathematical principle of affine transformation and perspective transformation is that the calculation method is the product of the coordinate vector and the transformation matrix, in other words, matrix operation. At the application level, affine transformation is a transformation of an image based on three fixed vertices, such as Figure 5 (a) and 5(b), Figure 5 (a) is the original image before affine transformation. Figure 5 (b) is the output effect after affine transformation. The fixed vertex is the black point 51 in the figure. The pixel value of the fixed vertex remains unchanged before and after the transformation, and the image as a whole is transformed according to the transformation rule. Similarly, perspective transformation is the transformation of the image based on 4 fixed vertices, such as Figure 6 (a) and 6(b), Figure 6 (a) is the original image before perspective transformation. Figure 6(b) is the output effect after perspective transformation. The fixed vertex is the black point 61 in the figure. The pixel value of the fixed vertex remains unchanged after the transformation, and the image as a whole is transformed according to the transformation rules. Referring to OpenCV, the affine transformation and perspective transformation functions have been encapsulated, namely void warpAffine and void warpPerspective, and the two transformation functions are exactly the same. Based on the image transformation algorithm, it serves the image transformation of multiple cameras in the same coordinate system.

[0084] 4. Image fusion: Image fusion is a method of stitching at least two frames of overlapping images of the same scene into a larger image. It is of great significance in the field of digital twins. The union of all input images is the output of image stitching, such as Figure 7 As shown, image fusion is mainly carried out according to the following process: 1) input image; 2) feature extraction; 3) image registration; 4) random sample consensus algorithm (RANSAC); 5) deformation fusion; 6) output image.

[0085] Detecting feature points in all input images for image registration is feature extraction, which requires establishing geometric correspondences between images so that they can be compared, transformed, and analyzed in a common reference system. It can be roughly divided into: algorithms that directly use the pixel values ​​of the image; algorithms for frequency domain processing, such as FFT-based methods; algorithms for low-level features, usually using edges and corners, for example, feature-based methods; algorithms for high-level features, usually used for overlapping parts of image objects, such as graph theory methods.

[0086] Feature point extraction is used to match elements from two input images that are inside image blocks. These image blocks are groups of pixels in the images. Because the intensities of the pixels are very similar, it is not possible to perform an exact feature match. To provide a better feature match for the image pair, corner matching is used for quantitative measurement. Corners are a good matching feature. Corner features are stable when the viewpoint changes. Also, there are abrupt changes in intensity near the corners. Corner detection algorithms are used to detect the corners of an image.

[0087] Warp and blend include image warping and image blending. Image warping refers to reprojecting one of the frames and placing the projected image on a larger canvas. Image blending refers to changing the grayscale of images near the border, removing these gaps, and creating a blended image, thereby achieving a smooth transition between images. Blending modes are used to merge two layers together.

[0088] Compared with the general image fusion algorithm, the improved graphics fusion algorithm adds camera position parameters, which can speed up image fusion efficiency, reduce fusion distortion, and increase the fusion field of view. Ordinary graphics cards can meet the 1080×30 fusion requirements.

[0089] 5. Projection: The projection will calculate the main fusion projection transformation based on the fused image and camera position parameters. In the actual projection process, if the target object is blocked or deformed, it can be corrected by manually adjusting the deviation.

[0090] The principle of projection is to perform a projection transformation (conversion between two three-dimensional coordinate systems) on each pixel of the image, and then output it to the corresponding position of the new image. The actual algorithm should be to first calculate the size of the output grid, and then use the coordinate transformation formula to calculate the pixel points in the output grid and the corresponding pixel points in the source image for sampling output.

[0091] Deviation correction: In the actual projection process, if the target object is blocked or deformed, it can be corrected by manually adjusting the deviation. There are two main types of image deviation correction: radial distortion deviation correction and tangential distortion deviation correction.

[0092] Radial distortion correction: The distortion at the exact center is minimal, and increases with the radius, including pincushion distortion correction and barrel distortion correction. Figure 8 (a), 8(b) and Figure 8 (c) is used to illustrate the process of radial distortion correction, where: Figure 8 (a) is the original image before radial distortion correction. Figure 8 (b) is the effect of correcting the pincushion distortion of the original image. Figure 8 (c) is the effect of barrel distortion correction on the original image. The formula for radial distortion correction is as follows (the first three terms of Taylor series expansion):

[0093]

[0094] Where (x, y) is the ideal coordinate, x dr and dr is the pixel coordinate after distortion, and: r 2 =x 2 +y 2 .

[0095] Tangential distortion correction: When the lens is not parallel to the imaging plane, a perspective transformation similar to that will occur. Fig. 9 (a) and Fig. 9 (b) is used to illustrate the tangential distortion correction process, where: Fig. 9 (a) is the original image before tangential distortion correction. Fig. 9 (b) is the effect of the original image after tangential distortion deviation correction. The formula for tangential distortion deviation correction is as follows:

[0096]

[0097] Both types of distortion deviation correction are ultimately reduced to five parameters: k1, k2, k3, p1, p2; knowing these five parameters can complete the distortion deviation correction.

[0098] The fused image does not have the projection parameters corresponding to the actual camera. The video editing tool Video Mixer Editor will pre-calculate a projection matrix to project the fused image to the corresponding position of the virtual scene, and then edit the projected image, including cropping, perspective transformation, color difference matching, etc. It can adjust the color of the corner points according to the color of the video, reduce the color difference, and make the fusion smoother and more natural.

[0099] 6. Cutout: For other physical objects that cannot be integrated with the virtual scene by projection alone, the use of cutout technology can better obtain the outer contour of complex targets and obtain good projection effects. Cutout can be performed using a trained semantic segmentation model, or using an AI cutout neural network trained for specific indoor targets for virtual scene projection.

[0100] Semantic segmentation is an end-to-end classification of pixels according to semantics. Before using the semantic segmentation model to cut out the target image, it is necessary to first input the images of other physical objects in the real indoor scene corresponding to the virtual scene and the mask files of the corresponding physical objects into the semantic segmentation model to train the semantic segmentation model. Fig.10 , Fig.11 , Fig.12 and Fig.13 To illustrate the complete semantic segmentation model process, Fig.10 is the original example image in the semantic segmentation process, Fig.11 It is the semantic segmentation mask map corresponding to the original example map in the semantic segmentation process. Fig.12 It is the semantic segmentation foreground map in the semantic segmentation process. Fig.13 It is a semantic segmentation synthesis image in the semantic segmentation process.

[0101] Obtaining the outer contour of complex targets is the strength of AI cutout technology, and the projection effect obtained is also good. Cutout divides the image into two parts, foreground and background, and then extracts the foreground part. In AI cutout, the concept of alpha channel can be understood as transparency. The AI ​​cutout model models the cutout as the following formula: I = αF + (1-α) B, where I is the observed image, F is the foreground, and B is the background. α is alpha, which represents transparency. The observed image is equivalent to a linear mixture of the foreground and background, and the degree of mixing of each part is controlled by α. F and B can be understood as layers in PhotoShop, and I is the superposition of two layers. The ultimate goal of AI cutout is actually to obtain α, and this α is not a simple 0, 1 binary classification or a simple multi-classification. In actual operation, α is also regarded as a channel (alpha channel), and its value range is an integer of [0, 255] like the RGB color space. From this perspective, only two semantics (foreground and background) are defined in the semantic segmentation task, so the prediction range of each pixel in the semantic segmentation is 0 or 1, that is, binary classification. For AI cutout, the prediction range of each pixel is an integer from 0 to 255, and its accuracy requirement is higher. Therefore, AI cutout is a high-level semantic segmentation task, which is more difficult.

[0102] Combination Fig.14 and Fig.15 To illustrate the working process of AI cutout, Fig.14 This is the alpha channel image obtained by AI cutout. Fig.15 This is an example of a synthetic AI cutout. Fig.14 and Fig.15 As shown in the figure, the transparent area of ​​the AI ​​cutout composite image carries a part of the original image background. In terms of naturalness effect, AI cutout is more natural. Semantic segmentation and AI cutout are different, but they are often processed together. The core technology of AI cutout is to calculate its alpha channel map through an algorithm.

[0103] The technical solution provided by the embodiment of the present invention supports image acquisition, image transformation, image fusion, projection and cutout. In a virtual scene, at least two camera video streams are fused by acquiring camera video stream data and camera position parameters, and then the fused image is projected into the virtual scene. Virtual scene video fusion technology is a graphic image technology for the early stage of digital twin technology to quickly reproduce the "dynamically enhanced virtual environment" of real scenes. Combined with 5G's fast transmission and image fusion algorithm, it supports multi-camera and multi-angle image fusion, effectively enhancing the sense of presence.

[0104] Fig.1616 is a schematic diagram of the architecture of a scene video fusion system applicable to an embodiment of the present invention. The system includes: an image acquisition module 1610 , an image fusion module 1620 and a projection module 1630 .

[0105] Among them, the image acquisition module 1610 is used to acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured video; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras; the image fusion module 1620 is used to fuse the at least two frames of images into one frame of image based on the position parameters of the at least two cameras to obtain a fused image; the projection module 1630 is used to project the target physical object in the fused image to the corresponding position in the virtual scene.

[0106] In an exemplary embodiment, the system further includes a cutout module for cutting out other physical objects in the fused image except the target physical object, and projecting the cutout images of the other physical objects into the virtual scene.

[0107] In an exemplary embodiment, the step of cutting out other physical objects except the target physical object in the fused image includes: cutting out other physical objects except the target physical object in the fused image by using a semantic segmentation model.

[0108] In an exemplary embodiment, the system also includes a model training module for inputting images of the other physical objects in the real indoor scene corresponding to the virtual scene and the corresponding mask files of the physical objects into the semantic segmentation model to train the semantic segmentation model.

[0109] In an exemplary embodiment, the fusing of the at least two frames of images into one frame of image based on the position parameters of the at least two cameras to obtain a fused image includes: determining the overlapping area in the at least two frames of images based on the position parameters of the at least two cameras; fusing the target physical objects in the overlapping area in each frame of image using an image fusion algorithm, and filling the non-overlapping area in the at least two frames of image to obtain the fused image.

[0110] In an exemplary embodiment, the system further includes an image transformation module for, after determining at least two frames of images containing the same target physical object in the captured video, performing image transformation on the at least two frames of images to obtain a transformed image.

[0111] In an exemplary embodiment, projecting the target physical object in the fused image to a corresponding position in the virtual scene includes: determining a projection relationship based on position parameters of a camera in the virtual scene and position parameters of a camera in a real indoor scene; and projecting the target physical object in the fused image to a corresponding position in the virtual scene based on the projection relationship.

[0112] It should be noted that the various modules in the embodiments of the present invention may be configured in one device, for example, may be configured in a server.

[0113] The system provided in the above embodiments can execute the scene video fusion method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0114] Fig.17 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Fig.17 As shown, the device includes:

[0115] one or more processors 1710, Fig.17 A processor 1710 is taken as an example;

[0116] Memory 1720;

[0117] The device may further include: an input device 1730 and an output device 1740 .

[0118] The processor 1710, memory 1720, input device 1730 and output device 1740 in the device may be connected via a bus or other means. Fig.17 The example of connecting through bus is taken in the following.

[0119] The memory 1720 is a non-transitory computer-readable storage medium that can be used to store software programs, computer executable programs, and modules, such as program instructions / modules corresponding to a scene video fusion method in an embodiment of the present invention (for example, the attached Fig.16 The processor 1710 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 1720, that is, a scene video fusion method of the above method embodiment is implemented, namely:

[0120] Acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras;

[0121] Based on the at least two camera position parameters, the at least two frames of images are fused into one frame of image to obtain a fused image;

[0122] The target physical object in the fused image is projected to a corresponding position in the virtual scene.

[0123] The memory 1720 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1720 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1720 may optionally include a memory remotely arranged relative to the processor 1710, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0124] The input device 1730 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 1740 may include a display device such as a display screen.

[0125] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, a scene video fusion method provided in an embodiment of the present invention is implemented, that is,

[0126] Acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras;

[0127] Based on the at least two camera position parameters, the at least two frames of images are fused into one frame of image to obtain a fused image;

[0128] The target physical object in the fused image is projected to a corresponding position in the virtual scene.

[0129] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A 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 thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: 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 or 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 thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0130] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. 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 a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0131] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0132] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0133] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A scene video fusion method, It is characterized in that include: Acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras; and the positions of the cameras are fixed; Based on the at least two camera position parameters, the at least two frames of images are fused into one frame of image to obtain a fused image; Projecting the target physical object in the fused image to a corresponding position in the virtual scene; The step of fusing the at least two frames of images into one frame of image based on the at least two camera position parameters to obtain a fused image includes: Determine an overlapping area in the at least two frames of images based on position parameters of the at least two cameras; The target physical object in the overlapping area of ​​each frame of image is fused by using an image fusion algorithm, and the non-overlapping area in the at least two frames of image is filled with an image to obtain the fused image; Cutting out other physical objects except the target physical object in the fused image, and projecting the cut-out images of the other physical objects into the virtual scene; The step of cutting out other physical objects in the fused image except the target physical object comprises: The other physical objects except the target physical object in the fused image are cut out through a semantic segmentation model.

2. The method according to claim 1, It is characterized in that After determining in the acquired video that at least two frames of images contain the same target physical object, the method further includes: The at least two frames of images are transformed to obtain a transformed image.

3. The method according to claim 1, It is characterized in that Also includes: An image containing the other physical objects in a real indoor scene corresponding to the virtual scene and a mask file corresponding to the physical objects are input into a semantic segmentation model to train the semantic segmentation model.

4. The method according to claim 1, It is characterized in that The projecting the target physical object in the fused image to a corresponding position in the virtual scene includes: Determine the projection relationship based on the position parameters of the camera in the virtual scene and the position parameters of the camera in the real indoor scene; The target physical object in the fused image is projected to a corresponding position in the virtual scene based on the projection relationship.

5. A scene video fusion system, It is characterized in that include: An image acquisition module is used to acquire videos captured by at least two cameras, and determine at least two frames of images containing the same target physical object in the captured videos; wherein the at least two frames of images are respectively from the videos captured by the corresponding at least two cameras; and the positions of the cameras are fixed; An image fusion module, used for fusing the at least two frames of images into one frame of image based on the at least two camera position parameters to obtain a fused image; A projection module, used for projecting the target physical object in the fused image to a corresponding position in the virtual scene; The step of fusing the at least two frames of images into one frame of image based on the at least two camera position parameters to obtain a fused image includes: Determine an overlapping area in the at least two frames of images based on position parameters of the at least two cameras; The target physical object in the overlapping area of ​​each frame of image is fused by using an image fusion algorithm, and the non-overlapping area in the at least two frames of image is filled with an image to obtain the fused image; A cutout module, used for cutting out other physical objects in the fused image except the target physical object, and projecting the cutout images of the other physical objects into the virtual scene; Cutting out other physical objects except the target physical object in the fused image includes: cutting out other physical objects except the target physical object in the fused image through a semantic segmentation model.

6. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Gaze data restoration method and system

    CN110147770A

  • Hand function training system based on mixed reality, and data processing method

    CN110211661A

  • Training system based on mixed reality technology and method thereof

    CN111729283A

  • Method and apparatus for fusing object into panoramic video

    US20200387740A1

  • Large-scale scene video image stitching method

    WO2016086754A1