Viewpoint hole masking method for RGB-D video synthesis based on background separation

By using the P-UNet network and Gaussian mixture model to separate the foreground and background in virtual viewpoint synthesis, and combining it with the BDC-Inpainting algorithm to repair temporal consistency, the problem of holes and temporal consistency in virtual viewpoint synthesis is solved, and the quality of the video is improved. Visual quality and playback stability.

CN115426535BActive Publication Date: 2024-08-27HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211065539.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2024-08-27
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

In virtual viewpoint synthesis, when using DIBR technology, the part covered by the foreground object may show holes in the virtual view, and after the holes are repaired, foreground bleeding and temporal inconsistency problems are prone to occur.

Method used

An RGB-D video synthesis method based on background separation is adopted, the P-UNet network and Gaussian mixture model are used to separate the foreground and background, combined with parallel attention and depth information, the BDC-Inpainting algorithm is used to repair the temporal consistency and fill the virtual viewpoint hole. .

Benefits of technology

It reduces the foreground penetration after hole repair, ensures the temporal consistency of the hole area between different frames, and improves the visual quality and playback stability of the video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115426535B
    Figure CN115426535B
Patent Text Reader

Abstract

The method of the present invention discloses a method for covering up viewpoint holes in RGB-D video synthesis based on background separation. The method of the present invention uses a reference color map, a reference depth map and camera information as units, separates the foreground of the color map by using a P-UNet network with parallel attention, separates the foreground according to the pixel mutation between the foreground and the background of the reference depth map, combines the backgrounds of the two methods and uses a Gaussian mixture model to build a cleaner background; uses a repair method based on depth and time consistency to repair the background; then draws a virtual viewpoint and a virtual background according to a 3D transformation formula and camera information, and repairs the virtual background again; finally, uses the virtual background to fill the missing pixels in the virtual viewpoint hole. The present invention avoids foreground penetration during repair, and the generated hole area is more temporally consistent between adjacent frames, reduces frame flash during video playback, and improves visual quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing, in particular to the technical field of virtual viewpoint synthesis, and relates to a viewpoint hole masking method for RGB-D video synthesis based on background separation. Background Art

[0002] Immersive multimedia services such as 3D video, free viewpoint video and virtual reality can bring people a sense of realism, and are increasingly loved and paid attention to by people. Virtual viewpoint rendering technology can synthesize viewpoint information of a specific angle and is a key technology in immersive multimedia services. Among them, depth image based rendering technology (Depth Image Based Rendering, DIBR) is based on the reference viewpoint texture map and the corresponding depth map to draw the virtual view. It has low computational complexity and is widely used in view synthesis of immersive multimedia services. At present, a major problem with using DIBR for view synthesis is that the part covered by the foreground object in the reference view may be displayed in the virtual view, but there is no corresponding pixel transformation to that position, resulting in a large range of holes. The current hole filling algorithm still produces foreground penetration in the hole area after repair and does not meet the temporal consistency of the hole area.

[0003] In recent years, the research and development of deep learning has shown excellent results in many fields. Among them, image segmentation methods can provide a new way to construct background information. A significant advantage of these methods is that they can segment the corresponding objects by learning image features from a large amount of data. In addition, for images drawn from virtual viewpoints, the temporal consistency of the hole area should also be considered, that is, the hole areas at the same position in different frames are temporally correlated. Summary of the invention

[0004] The purpose of the present invention is to provide a method for covering up viewpoint holes in RGB-D video synthesis based on background separation, in view of the fact that research on virtual viewpoint synthesis technology is still immature. The virtual viewpoint synthesis method proposed by the present invention not only reduces the foreground penetration after the hole area is repaired, but also considers the temporal correlation of the hole area between different frames.

[0005] The method of the present invention uses the reference color map, reference depth map and camera information as units, uses the P-UNet (Unet for Parallel Attention) network with parallel attention to separate the color map foreground, separates the foreground according to the pixel mutation between the foreground and background of the reference depth map, combines the backgrounds of the two methods and uses the Gaussian Mixed Model (GMM) to build a cleaner background; uses the depth and temporal consistency based inpainting method (BDC-Inpainting) to inpaint the background; then draws the virtual viewpoint and virtual background according to the 3D transformation formula and camera information, and inpaints the virtual background again. Finally, the virtual background is used to fill the missing pixels in the virtual viewpoint hole.

[0006] The specific steps of the method of the present invention are as follows:

[0007] Step (1) Obtain the reference color background through the P-UNet network and the reference depth map edge features. and reference depth background

[0008] (1-1) The P-UNet network is trained using the VOCdevkit2007 dataset as the training set and test set to obtain a network model for foreground segmentation of the reference viewpoint image; the P-UNet network structure is an encoder-decoder structure. In the encoder stage, the effective features of the image are learned through multiple convolutions and downsampling; in the decoder stage, the effective features are upsampled and concatenated with the corresponding encoder features, and the concatenated features are used to segment the reference color image.

[0009] The P-UNet network uses parallel attention, including: channel attention, which increases the channel weights related to foreground objects by allocating channel weights in the feature map; reverse attention, which makes the boundary details gradually accurate by correcting the foreground objects; and the features generated by channel attention and reverse attention are fused to obtain more effective features.

[0010] The two features of the input parallel attention come from the features F provided by the encoder e and the feature F provided by the decoder d ;

[0011] The feature map R obtained after reverse attention k =Conv(F e ·M k ), Conv represents the convolution operation, and the reverse attention weight M k =-(σ(Fd )), σ is the activation function sigmoid, - is the negation operation;

[0012] Feature map C obtained after channel attention k =ReLu(Conv(MaxPool(F))·F), ReLu is the activation function, MaxPool represents the maximum pooling of the input data, F e and F d The concatenated feature F = Concat(F e ,F d ), Concat represents the concatenation of input data;

[0013] The two features are combined to obtain the parallel attention output feature O k =ReLu(Concat(R k ,C k ));

[0014] For parallel attention output feature O k Perform a convolution operation to obtain a binary image of the P-UNet network segmentation reference color image Through the binary image Get the background B of the P-UNet network segmentation reference color map C .

[0015] (1-2) First, bilateral filtering is performed on the reference depth map D. Then, Canny edge detection is used to extract the foreground object edge map E of the reference depth map D. The foreground edge of the foreground object edge map E is used as the boundary to obtain the foreground object of the entire reference depth map. The entire foreground area is obtained by iteration. In each iteration, the difference between the current pixel D(x, y) and the adjacent foreground pixel and whether the current pixel D(x, y) is greater than the set threshold Ostu(FE i ) Determine whether the current pixel D(x,y) belongs to the foreground;

[0016] Foreground pixels after iteration 1 means it belongs to the foreground, 0 means it does not belong to the foreground; FE i represents the minimum rectangular area that can contain the i-th continuous edge, F8(D(x,y)) represents the foreground pixels of the eight-neighborhood of the current pixel D(x,y), the similarity between the current pixel D(x,y) and the foreground pixels F8(D(x,y)) of the eight-neighborhood is Diff(D(x,y),F8(D(x,y)))=|F8(D(x,y))-D(x,y)|, c2 is the threshold for judging whether the adjacent pixel is the foreground.

[0017] (1-3) The network model extracts the foreground of the reference color image and obtains the foreground binary image of the reference color image Perform foreground extraction on the reference depth map to obtain the foreground binary image of the reference depth map

[0018] The two foreground binary images and Take the union to get the accurate foreground binary image, thus getting a cleaner reference color background and reference depth background

[0019] Step (2) uses a Gaussian mixture model (GMM) to perform background modeling on the reference color background and reference depth background of each frame in the video sequence.

[0020] (2-1) A Gaussian mixture model (GMM) is used to reconstruct a stable background. GMM performs pixel-level operations, where each pixel is independently modeled by a mixture of K Gaussian distributions, and foreground pixels are not used for background modeling.

[0021] Gaussian mixture models are often used to separate moving objects from stable backgrounds, and can therefore be used to reconstruct stable backgrounds. The modified Gaussian mixture distribution with K components is expressed as: Among them, s t represents the pixel s at time t, p(s t ) represents the probability density of pixel s at time t, w k,t Represents the Gaussian distribution weight of pixel s at time t, satisfying η represents the Gaussian function, u k,t and σ 2 k,t Respectively represent the mean and variance of pixel s at time t, M(s t ) indicates whether pixel s is the background at time t, if it is the background, it is 1, otherwise it is 0.

[0022] (2-2) Initialize the parameters of GMM at time t, and initialize the first Gaussian distribution corresponding to each pixel in the first frame, with the mean being the current pixel value, the weight being 1, and the variance being the set value σ 2 0. The mean and weight of the Gaussian distribution function of each pixel except the first Gaussian distribution are initialized to 0.

[0023] (2-3) Starting from the second frame, if a pixel value appears in the area that was originally a hole, the pixel value is directly assigned to the mean of the first Gaussian distribution of the hole pixel. Starting from the second frame, each pixel is matched, and the pixel must be a background pixel to see if it matches a Gaussian model. The matching condition is |s t -u k,t-1 |<2.5σ k,t-1 ,M(s t )=1.

[0024] If at least one of the K models matches, the parameters of the matching model are updated, and the parameters of other models remain unchanged; the parameter update is: w k,t =(1-α)w k,t-1 +α, α is the learning rate of GMM, u k,t =(1-ρ)·u k,t-1 +ρ·X t , σ 2 k.t =(1-ρ)·σ 2 k.t-1 +ρ·(X t -u k,t-1 ) 2 , X t is the pixel value of the current pixel, the intermediate parameter

[0025] If none of the K models match, a new Gaussian distribution is created and one of the Gaussian model parameters with a weight of 0 is reassigned; the parameter assignment is: w k,t =α,u k,t =X t , σ 2 k,t =σ 2 0.

[0026] After the parameters are assigned, the weights need to be normalized to ensure that the sum of the K weights is still 1. If K distributions have been modeled, according to The model with smaller value sorting weight and larger standard deviation indicates that the background is more unstable, so the Gaussian distribution is discarded and the parameters are reassigned. In this way, the reference depth background sequence is obtained. and the reference color background sequence

[0027] Step (3) constructs the reference depth background sequence Depth prediction is performed for each hole area in the frame; the hole area in the reference depth background is predicted by linear interpolation. If there are still background pixels on both sides of the hole, prediction is performed by linear interpolation. If there are pixels on only one side of the hole, the depth of the existing side is directly used to predict the missing depth value. In this way, a reference depth background map is obtained after depth prediction for each frame.

[0028] Background pixels on both sides of the hole Among them, (x l ,y) and (x r ,y) are the pixel coordinates of the left and right edges of the same row of the hole, respectively. l ,y) and D(x r,y) is the coordinate (x l ,y) and (x r ,y) depth value, S l is from the coordinates (x l ,y) to (x r ,y) depth value slope, To set the threshold.

[0029] If (x l ,y) and (x r ,y) are all background pixels, then S l is a smaller value, set If the foreground is not fully extracted, then S l If the value is larger, (x l ,y) and (x r ,y) to fill the missing area. If there are pixels on only one side of the hole, the depth of the existing side is directly used to predict the missing depth value.

[0030] Step (4) uses the BDC-Inpainting algorithm to repair the reference color background image constructed by GMM in step (2), wherein the BDC-Inpainting algorithm combines the depth information and the reference color background repaired in the previous frame to guide the repair of the reference background of the current frame.

[0031] (4-1) First calculate the priority of the blocks of the hole area contour and find the block with the highest priority

[0032] (4-2) Optimizing hole repair by combining depth information. In 3D videos, depth maps are used to help generate stereoscopic views in 3D-TV, while the Just Noticeable Depth Difference (JNDD) shows the depth threshold at which viewers cannot perceive changes.

[0033] Set target block The average depth of Φ is the intact area of ​​the image, |Ψ p ∩Φ| is the number of non-hole pixels, and D(q) represents the depth value of each pixel in the matching block.

[0034] according to Select the corresponding threshold and use it to filter the depth information in the matching block. It is considered to meet the requirements, D JND Indicates the edge threshold of JNDD. If the depth in the matching block does not meet the condition, the matching block is skipped.

[0035] Find the best matching block with the smallest error Among them, dis(Ψ a ,Ψ b ) is the distance between two blocks, obtained by the sum of squared differences (SSD) of the filled pixels in the two blocks. pre It is the weight of the previous frame affecting the selection of the best matching block in the current frame, which is used to balance the impact of the previous frame on the overall error. and Ψ′ q The previous frame corresponds to the current frame respectively. and q The target block and the matching block are obtained. Thus, the color background image of the current frame is obtained.

[0036] Step (5) transforms the reference color image, the reference depth image, the reference color background image and the reference depth background image of step (4) into a virtual viewpoint image through the 3D-Warping formula.

[0037] Let M = [X, Y, Z, 1] T is the world coordinate of a pixel, m = [u, v, 1] T is the pixel coordinate of the camera coordinate system P in the homogeneous coordinate system, PM = δm, δ is the normalization factor, and the camera matrix P = K[R|t]; where the orthogonal matrix R represents the direction and the vector t represents the position. The matrix K is called the intrinsic parameter matrix, which represents the internal structure of the camera. The pixel coordinate system information s of the virtual viewpoint is inferred from the world coordinate system coordinate M obtained by the reference viewpoint v m v =K v R v M+K v t v , orthogonal matrix R v Represents the direction of the virtual viewpoint camera, vector t v Represents the position of the virtual viewpoint camera, matrix K v is the intrinsic parameter matrix of the virtual viewpoint camera, s v is the normalization factor of the virtual viewpoint camera, m v is the pixel coordinate of the virtual viewpoint camera. Thus, a virtual viewpoint image with a hole is obtained, including a virtual color image C v , virtual depth map, virtual reference color background map, virtual reference depth background map.

[0038] Step (6) performs depth prediction on the synthesized virtual depth background image through step (3) and repairs the synthesized virtual color background through step (4). Thus, the repaired virtual reference color background image B is obtained. c v .

[0039] Step (7) Use step (6) to obtain the restored virtual reference color background image B c v The synthetic virtual color image C obtained in step (5) v Fill the empty areas in .

[0040] The method of the present invention proposes a RGB-D video synthesis viewpoint hole masking technology based on background separation in the field of virtual viewpoint synthesis research. Cleaner background information is constructed based on the P-UNet network with parallel attention and the edge information of the depth map to avoid foreground penetration during repair. According to the depth information and the temporal consistency of adjacent frames in the hole area, a repair method based on depth and temporal consistency (BDC-Inpainting) is used to make the generated hole area more temporally consistent between adjacent frames, reduce frame flicker during video playback, and improve visual quality. At the same time, JNDD is used to ensure that the observer cannot perceive changes in the stereoscopic view. The model can be directly applied to the fields of hole filling in 3D videos, video and image repair, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a flow chart of the method of the present invention;

[0042] Figure 2 A flow chart for constructing a reference background in the present invention;

[0043] Figure 3 P-UNet network structure diagram in the present invention;

[0044] Figure 4 Schematic diagram of the attention mechanism in this invention. DETAILED DESCRIPTION

[0045] The present invention is further described in detail with reference to the following specific embodiments and accompanying drawings.

[0046] like Figure 1 As shown in the figure, the RGB-D video synthesis viewpoint hole masking method based on background separation is as follows:

[0047] Step (1) Figure 2 As shown, the reference color background is obtained through the P-UNet network and the reference depth map edge features. and reference depth background

[0048] (1-1) Using the VOCdevkit2007 dataset as the training set and test set, the P-UNet network is trained to obtain a network model for foreground segmentation of the reference viewpoint image. Figure 3As shown in the figure, the P-UNet network structure is an encoder-decoder structure. In the encoder stage, the effective features of the image are learned through multiple convolutions and downsampling; in the decoder stage, the effective features are upsampled and concatenated with the corresponding encoder features, and the concatenated features are used to segment the reference color image.

[0049] The P-UNet network uses parallel attention, Figure 4 A schematic diagram of the modified attention mechanism is shown, including: channel attention, which increases the channel weights related to foreground objects by allocating channel weights in the feature map; reverse attention, which gradually makes the boundary detail information accurate by correcting the foreground objects; and the features generated by channel attention and reverse attention are fused to obtain more effective features.

[0050] The two features of the input parallel attention come from the features F provided by the encoder e and the feature F provided by the decoder d .

[0051] The feature map R obtained after reverse attention k =Conv(F e ·M k ), Conv represents the convolution operation, and the reverse attention weight M k =-(σ(F d )), σ is the activation function sigmoid, and - is the inversion operation.

[0052] Feature map C obtained after channel attention k =ReLu(Conv(MaxPool(F))·F), ReLu is the activation function, MaxPool represents the maximum pooling of the input data, F e and F d The concatenated feature F = Concat(F e ,F d ), Concat means concatenation of input data.

[0053] The two features are combined to obtain the parallel attention output feature O k =ReLu(Concat(R k ,C k )).

[0054] For parallel attention output feature O k Perform a convolution operation to obtain a binary image of the P-UNet network segmentation reference color image Through the binary image Get the background B of the P-UNet network segmentation reference color map C .

[0055] (1-2) First, bilateral filtering is performed on the reference depth map D. Bilateral filtering can preserve edges well while smoothing and denoising. For flat areas, it is equivalent to Gaussian filtering, which eliminates unreal edges. For edge areas, because the difference between edge pixels and non-edge pixels is large, the edge pixels will still maintain a large difference with non-edge pixels after filtering.

[0056] Then, the foreground object edge map E of the reference depth map D is extracted through Canny edge detection, and the foreground object of the entire reference depth map is obtained by taking the foreground edge of the foreground object edge map E as the boundary.

[0057] Since the depth map has been bilaterally filtered, the adjacent depth values ​​of the same foreground object are similar, and the entire foreground area is obtained by iteration. In each iteration, the difference between the current pixel D(x, y) and the adjacent foreground pixel and whether the current pixel D(x, y) is greater than the set threshold Ostu(FE i ) determines whether the current pixel D(x,y) belongs to the foreground.

[0058] Foreground pixels after iteration 1 means it belongs to the foreground, 0 means it does not belong to the foreground; FE i represents the minimum rectangular area that can contain the i-th continuous edge, F8(D(x,y)) represents the foreground pixels of the eight neighborhoods of the current pixel D(x,y), the similarity between the current pixel D(x,y) and the foreground pixels F8(D(x,y)) of the eight neighborhoods Diff(D(x,y),F8(D(x,y)))=|F8(D(x,y))-D(x,y)|, c2 is the threshold for judging whether the adjacent pixel is the foreground, and in this embodiment c2=5.

[0059] (1-3) The network model extracts the foreground of the reference color image and obtains the foreground binary image of the reference color image Perform foreground extraction on the reference depth map to obtain the foreground binary image of the reference depth map

[0060] The two foreground binary images and Take the union to get the accurate foreground binary image, thus getting a cleaner reference color background and reference depth background

[0061] Step (2) uses a Gaussian mixture model (GMM) to perform background modeling on the reference color background and reference depth background of each frame in the video sequence.

[0062] (2-1) A Gaussian mixture model (GMM) is used to reconstruct a stable background. GMM performs pixel-level operations, where each pixel is independently modeled by a mixture of K Gaussian distributions. In this embodiment, K=3, and foreground pixels are not used for background modeling.

[0063] Gaussian mixture models are often used to separate moving objects from stable backgrounds, and can therefore be used to reconstruct stable backgrounds. The modified Gaussian mixture distribution with K components is expressed as: Among them, s t represents the pixel s at time t, p(s t ) represents the probability density of pixel s at time t, w k,t Represents the Gaussian distribution weight of pixel s at time t, satisfying η represents the Gaussian function, u k,t and σ 2 k,t Respectively represent the mean and variance of pixel s at time t, M(s t ) indicates whether pixel s is the background at time t, if it is the background, it is 1, otherwise it is 0.

[0064] (2-2) Initialize the parameters of GMM at time t, and initialize the first Gaussian distribution corresponding to each pixel in the first frame, with the mean being the current pixel value, the weight being 1, and the variance being the set value σ 2 0, this embodiment sets the variance σ 2 0 is 5.5. The mean and weight of the Gaussian distribution function of each pixel except the first Gaussian distribution are initialized to 0.

[0065] (2-3) Starting from the second frame, if a pixel value appears in the area that was originally a hole, the pixel value is directly assigned to the mean of the first Gaussian distribution of the hole pixel, rather than the learning rate α multiplied by the pixel value assigned to the mean of the first Gaussian distribution.

[0066] Starting from the second frame, each pixel is matched, and the pixel must be a background pixel to see if it matches a Gaussian model. The matching condition is |s t -u k,t-1 |<2.5σ k,t-1 ,M(s t )=1.

[0067] If at least one of the K models matches, the parameters of the matching model are updated, and the parameters of other models remain unchanged; the parameter update is: w k,t =(1-α)w k,t-1 +α, α is the learning rate of GMM, u k,t =(1-ρ)·u k,t-1 +ρ·X t , σ 2k.t =(1-ρ)·σ 2 k.t-1 +ρ·(X t -u k,t-1 ) 2 , X t is the pixel value of the current pixel, the intermediate parameter

[0068] If none of the K models match, a new Gaussian distribution is created and one of the Gaussian model parameters with a weight of 0 is reassigned; the parameter assignment is: w k,t =α,u k,t =X t , σ 2 k,t =σ 2 0, initial variance σ 2 0=5.5.

[0069] After the parameters are assigned, the weights need to be normalized to ensure that the sum of the K weights is still 1. If K distributions have been modeled, according to The model with smaller value sorting weight and larger standard deviation indicates that the background is more unstable, so the Gaussian distribution is discarded and the parameters are reassigned. In this way, the reference depth background sequence is obtained. and the reference color background sequence

[0070] Step (3) constructs the reference depth background sequence Depth prediction is performed for each hole area in the frame; the hole area in the reference depth background is predicted by linear interpolation. If there are still background pixels on both sides of the hole, prediction is performed by linear interpolation. If there are pixels on only one side of the hole, the depth of the existing side is directly used to predict the missing depth value. In this way, a reference depth background map is obtained after depth prediction for each frame.

[0071] Background pixels on both sides of the hole Among them, (x l ,y) and (x r ,y) are the pixel coordinates of the left and right edges of the same row of the hole, respectively. l ,y) and D(x r ,y) is the coordinate (x l ,y) and (x r ,y) depth value, S l is from the coordinate (x l ,y) to (x r ,y) depth value slope, To set the threshold, this embodiment sets

[0072] If (x l ,y) and (x r ,y) are all background pixels, then S l is a smaller value, set If the foreground is not fully extracted, then S l If the value is larger, (x l ,y) and (x r ,y) to fill the missing area. If there are pixels on only one side of the hole, the depth of the existing side is directly used to predict the missing depth value.

[0073] Step (4) uses the BDC-Inpainting algorithm to repair the reference color background image constructed by GMM in step (2), wherein the BDC-Inpainting algorithm combines the depth information and the reference color background repaired in the previous frame to guide the repair of the reference background of the current frame.

[0074] (4-1) First calculate the priority of the blocks of the hole area contour and find the block with the highest priority

[0075] (4-2) Optimize hole repair by combining depth information. In 3D videos, depth maps are used to help generate stereoscopic views in 3D-TV, and the Just Noticeable Depth Difference (JNDD) shows the depth threshold at which the viewer cannot perceive the change. In order to make the depth difference between the matching block and the target block small, the adaptive edge threshold change of JNDD is used to limit the depth of the matching block, reducing the search area while making the viewer unable to perceive the change in the stereoscopic view. Since foreground extraction is performed, only the background can be used to repair the holes in the background. Adding depth information to limit the hole repair makes it more reasonable. Suppose the target block The average depth of Φ is the intact area of ​​the image, |Ψ p ∩Φ| is the number of non-hole pixels, and D(q) represents the depth value of each pixel in the matching block.

[0076] according to Select the corresponding threshold and use it to filter the depth information in the matching block. It is considered to meet the requirements, D JND Indicates the edge threshold of JNDD. If the depth in the matching block does not meet the condition, the matching block is skipped.

[0077] Find the best matching block with the smallest error Among them, dis(Ψ a ,Ψ b ) is the distance between two blocks, obtained by the sum of squared differences (SSD) of the filled pixels in the two blocks. pre It is the weight of the previous frame affecting the selection of the best matching block in the current frame, which is used to balance the impact of the previous frame on the overall error. and Ψ′ q The previous frame corresponds to the current frame respectively. and q When inpainting pictures other than the first frame, BDC-Inpainting considers the same area of ​​the inpainted color image of the previous frame, making the inpainted reference color background more temporally consistent. This way, the color background image of the current frame is obtained.

[0078] Step (5) transforms the reference color image, the reference depth image, the reference color background image and the reference depth background image of step (4) into a virtual viewpoint image through the 3D-Warping formula.

[0079] Let M = [X, Y, Z, 1] T is the world coordinate of a pixel, m = [u, v, 1] T is the pixel coordinate of the camera coordinate system P in the homogeneous coordinate system, PM = δm, δ is the normalization factor, and the camera matrix P = K[R|t]; where the orthogonal matrix R represents the direction and the vector t represents the position. The matrix K is called the intrinsic parameter matrix, which represents the internal structure of the camera. The pixel coordinate system information s of the virtual viewpoint is inferred from the world coordinate system coordinate M obtained by the reference viewpoint v m v =K v R v M+K v t v , orthogonal matrix R v Represents the direction of the virtual viewpoint camera, vector t v Represents the position of the virtual viewpoint camera, matrix K v is the intrinsic parameter matrix of the virtual viewpoint camera, s v is the normalization factor of the virtual viewpoint camera, m v is the pixel coordinate of the virtual viewpoint camera. Thus, a virtual viewpoint image with a hole is obtained, including a virtual color image C v , virtual depth map, virtual reference color background map, virtual reference depth background map.

[0080] Step (6) performs depth prediction on the synthesized virtual depth background image through step (3) and repairs the synthesized virtual color background through step (4). Thus, the repaired virtual reference color background image B is obtained. c v .

[0081] Step (7) Use step (6) to obtain the restored virtual reference color background image B c v The synthetic virtual color image C obtained in step (5) v Fill the empty areas in .

Claims

1. A viewpoint hole masking method for RGB-D video synthesis based on background separation, characterized by: Step (1) Obtain the reference color background through the P-UNet network and the reference depth map edge features. and reference depth background Specifically: (1-1) The VOCdevkit2007 dataset is used as the training set and test set to train the P-UNet network and obtain a network model for foreground segmentation of the reference viewpoint image; the P-UNet network structure is an encoder-decoder structure. In the encoder stage, the effective features of the image are learned through multiple convolutions and downsampling; in the decoder stage, the effective features are upsampled and concatenated with the corresponding encoder features, and the concatenated features are used to segment the reference color image; The P-UNet network uses parallel attention, including: channel attention, which increases the channel weights related to foreground objects by allocating channel weights in the feature map; reverse attention, which makes the boundary details gradually accurate by correcting the foreground objects; and the features generated by channel attention and reverse attention are fused to obtain more effective features. The two features of the input parallel attention come from the features F provided by the encoder e and the feature F provided by the decoder d ; The feature map R obtained after reverse attention k =Conv(F e ·M k ), Conv represents the convolution operation, and the reverse attention weight M k =-(σ(F d )), σ is the activation function sigmoid, - is the negation operation; Feature map C obtained after channel attention k =ReLu(Conv(MaxPool(F))·F), ReLu is the activation function, MaxPool represents the maximum pooling of the input data, F e and F d The concatenated feature F = Concat(F e ,F d ), Concat represents the concatenation of input data; The two features are combined to obtain the parallel attention output feature O k =ReLu(Concat(R k ,C k )); For parallel attention output feature O k Perform a convolution operation to obtain a binary image of the P-UNet network segmentation reference color image Through the binary image Get the background B of the P-UNet network segmentation reference color map C ; (1-2) First, bilateral filtering is performed on the reference depth map, and then Canny edge detection is performed to extract the foreground object edge map E of the reference depth map. The foreground edge of the foreground object edge map E is used as the boundary to obtain the foreground object of the entire reference depth map; The entire foreground area is obtained by iteration; in each iteration, the difference between the current pixel D(x, y) and the adjacent foreground pixel and whether the current pixel D(x, y) is greater than the set threshold Ostu(FE i ) Determine whether the current pixel D(x,y) belongs to the foreground; Foreground pixels after iteration 1 means it belongs to the foreground, 0 means it does not belong to the foreground; FE i represents the minimum rectangular area that can contain the i-th continuous edge, F8(D(x,y)) represents the foreground pixels of the eight neighborhoods of the current pixel D(x,y), the similarity between the current pixel D(x,y) and the foreground pixel F8(D(x,y)) of the eight neighborhoods Diff(D(x,y),F8(D(x,y)))=|F8(D(x,y))-D(x,y)|, c2 is the threshold for judging whether the adjacent pixel is the foreground; (1-3) The network model extracts the foreground of the reference color image and obtains the foreground binary image of the reference color image Perform foreground extraction on the reference depth map to obtain the foreground binary image of the reference depth map The two foreground binary images and Take the union to get the accurate foreground binary image, thus getting a cleaner reference color background and reference depth background Step (2) using a Gaussian mixture model (GMM) to perform background modeling on the reference color background and the reference depth background of each frame in the video sequence; Step (3) constructs the reference depth background sequence Depth prediction is performed for each hole area in the frame; the hole area in the reference depth background is predicted by linear interpolation. If there are still background pixels on both sides of the hole, prediction is performed by linear interpolation; if there are pixels on only one side of the hole, the depth of the existing side is directly used to predict the missing depth value; thereby obtaining a reference depth background map after depth prediction for each frame; Step (4) using the BDC-Inpainting algorithm to repair the reference color background image constructed by the Gaussian mixture model GMM, wherein the BDC-Inpainting algorithm combines the depth information and the reference color background repaired in the previous frame to guide the repair of the reference background of the current frame; Step (5) transforms the reference color image, the reference depth image, the reference color background image and the reference depth background image into a virtual viewpoint image by using a 3D-Warping formula; Step (6) performs depth prediction on the synthesized virtual depth background image through step (3) and repairs the synthesized virtual color background through step (4); thereby obtaining the repaired virtual reference color background image B c v ; Step (7) Use step (6) to obtain the restored virtual reference color background image B c v The synthetic virtual color image C obtained in step (5) v Fill the empty areas in .

2. The method for concealing viewpoint holes in RGB-D video synthesis based on background separation as claimed in claim 1, characterized in that: Step (2) is specifically: (2-1) A Gaussian mixture model (GMM) is used to reconstruct a stable background. GMM performs pixel-level operations, where each pixel is independently modeled by a mixture of K Gaussian distributions, and foreground pixels are not used for background modeling. (2-2) Initialize the parameters of GMM at time t, and initialize the first Gaussian distribution corresponding to each pixel in the first frame, with the mean being the current pixel value, the weight being 1, and the variance being the set value σ 2 0; the mean and weight of the Gaussian distribution function of each pixel except the first Gaussian distribution are initialized to 0; (2-3) Starting from the second frame, if a pixel value appears in the area that was originally a hole, the pixel value is directly assigned to the mean of the first Gaussian distribution of the hole pixel; starting from the second frame, each pixel is matched, and the pixel must be a background pixel to see if it matches a Gaussian model. The matching condition is |s t -u k,t-1 |<2.5σ k,t-1 ,M(s t )=1; If at least one of the K models matches, the parameters of the matching model are updated. If none of the K models match, a new Gaussian distribution is created and the weights are normalized. The Gaussian distribution with small weights is discarded and the parameters are reassigned. The reference depth background sequence is obtained and the reference color background sequence 3. The method for concealing viewpoint holes in RGB-D video synthesis based on background separation as claimed in claim 2, characterized in that: Step (3) is specifically: Background pixels on both sides of the hole Among them, (x l ,y) and (x r ,y) are the pixel coordinates of the left and right edges of the same row of the hole, respectively. l ,y) and D(x r ,y) is the coordinate (x l ,y) and (x r ,y) depth value, S l is from the coordinate (x l ,y) to (x r ,y) depth value slope, To set the threshold; If (x l ,y) and (x r ,y) are all background pixels, then S l is a smaller value, set If the foreground is not fully extracted, then S l If the value is larger, (x l ,y) and (x r ,y) to fill the missing area; if there are pixels on only one side of the hole, the depth of the existing side is directly used to predict the missing depth value.

4. The method for concealing viewpoint holes in RGB-D video synthesis based on background separation as claimed in claim 3, characterized in that: Step (4) is specifically: (4-1) First calculate the priority of the blocks of the hole area contour and find the block with the highest priority (4-2) Optimize hole repair by combining depth information; Set target block The average depth of Φ is the intact area of ​​the image, |Ψ p ∩Φ| is the number of non-hole pixels, and D(q) represents the depth value of each pixel in the matching block; according to Select a corresponding threshold and use it to filter the depth information in the matching block; if the depth values ​​in the matching block all meet It is considered to meet the requirements, D JND Indicates the edge threshold of the minimum perceptible difference JNDD. If the depth in the matching block does not meet the condition, the matching block is skipped. Find the best matching block with the smallest error Among them, dis(Ψ a ,Ψ b ) is the distance between two blocks, which is obtained by the sum of square differences (SSD) of the filled pixels in the two blocks; w pre It is the weight of the previous frame affecting the selection of the best matching block in the current frame, which is used to balance the impact of the previous frame on the overall error; and Ψ′ q The previous frame corresponds to the current frame respectively. and q The target block and the matching block are obtained; thereby obtaining the color background image of the current frame.

5. The method for concealing viewpoint holes in RGB-D video synthesis based on background separation as claimed in claim 4, characterized in that: Step (5) is specifically: Let M = [X, Y, Z, 1] T is the world coordinate of a pixel, m = [u, v, 1] T is the pixel coordinate of the camera coordinate system P in the homogeneous coordinate system, PM = δm, δ is the normalization factor, and the camera matrix P = K[R|t]; where the orthogonal matrix R represents the direction, and the vector t represents the position; the matrix K is called the intrinsic parameter matrix, which represents the internal structure of the camera; the pixel coordinate system information s of the virtual viewpoint is deduced from the world coordinate system coordinate M obtained by the reference viewpoint v m v =K v R v M+K v t v , orthogonal matrix R v Represents the direction of the virtual viewpoint camera, vector t v Represents the position of the virtual viewpoint camera, matrix K v is the intrinsic parameter matrix of the virtual viewpoint camera, s v is the normalization factor of the virtual viewpoint camera, m v is the pixel coordinate of the virtual viewpoint camera; thus, a virtual viewpoint image with a hole is obtained, including a virtual color image C v , virtual depth map, virtual reference color background map, virtual reference depth background map.

6. The method for concealing viewpoint holes in RGB-D video synthesis based on background separation as claimed in claim 2, characterized in that: Step (2-1) is specifically: the Gaussian mixture distribution with K components modified is expressed as Among them, s t represents the pixel s at time t, p(s t ) represents the probability density of pixel s at time t, w k,t Represents the Gaussian distribution weight of pixel s at time t, satisfying η represents the Gaussian function, u k,t and σ 2 k,t Respectively represent the mean and variance of pixel s at time t, M(s t ) indicates whether pixel s is the background at time t, if it is the background, it is 1, otherwise it is 0.

7. The method for concealing viewpoint holes in RGB-D video synthesis based on background separation as claimed in claim 6, characterized in that: The matching condition in step (2-3) is |s t -u k,t-1 |<2.5σ k,t-1 ,M(s t )=1; If at least one of the K models matches, the parameters of the matching model are updated, and the parameters of other models remain unchanged; the parameter update is: w k,t =(1-α)w k,t-1 +α, α is the learning rate of GMM, u k,t =(1-ρ)·u k,t-1 +ρ·X t , σ 2 k.t =(1-ρ)·σ 2 k.t-1 +ρ·(X t -u k,t-1 ) 2 , X t is the pixel value of the current pixel, the intermediate parameter If none of the K models match, a new Gaussian distribution is created and one of the Gaussian model parameters with a weight of 0 is reassigned; the parameter assignment is: w k,t =α,u k,t =X t , σ 2 k,t =σ 2 0; After the parameters are assigned, the weights need to be normalized to ensure that the sum of the K weights is still 1. If K distributions have been modeled, according to The model with smaller value ranking weight and larger standard deviation indicates that the background is more unstable, so the Gaussian distribution is discarded and the parameters are reassigned; The reference depth background sequence is obtained and the reference color background sequence