Virtual viewpoint synthesis method, electronic device and computer readable medium
By preprocessing the depth map of the original image and filling holes in the virtual viewpoint image, the problem of difficulty in image acquisition and low quality of virtual viewpoint rendering images in multi-viewpoint naked-eye 3D technology is solved, and efficient and low-cost virtual viewpoint synthesis is achieved. Improved image quality.
Patent Information
- Application Number
- CN202180000061.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-25
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-01-25
AI Technical Summary
In the existing technology, multi-viewpoint naked-eye 3D technology has the problems of high cost and large data transmission volume when acquiring images. At the same time, the use of virtual viewpoint rendering technology based on depth maps results in low image quality and unsatisfactory viewing effects.
By preprocessing the depth map corresponding to the original image at zero parallax, multiple virtual viewpoint images are generated, and the holes in the virtual viewpoint images are filled to improve image quality.
It achieves fast and effective hole repair in virtual viewpoint images, improves image quality, and saves costs and data transmission volume.
Smart Images

Figure CN115176459B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image and video technology, and in particular to a virtual viewpoint synthesis method, an electronic device and a computer-readable medium. Background Art
[0002] With the development of image and video technology and display technology, 3D display technology has received widespread attention and application. It uses parallax to create a three-dimensional visual effect for viewers. When viewers watch 3D display content, their left and right eyes simultaneously observe different parallax images, which are then fused in the brain to produce a three-dimensional image with a depth effect.
[0003] In order to overcome the problems of 3D display technology, especially the few viewpoints and discontinuous viewpoints in naked-eye 3D display technology, researchers have proposed multi-view naked-eye 3D technology, which specifically uses grating splitting to generate multi-viewpoint images. However, in the actual application of this technology, it is difficult to obtain multi-viewpoint images. For example, when shooting, multiple viewpoints correspond to multiple cameras, and shooting needs to be performed simultaneously, resulting in an increase in the number of cameras, and the need to synchronize and calibrate different cameras. At present, how to generate virtual viewpoint images based on images taken by a camera has the advantages of cost saving and low data transmission. Depth Image Based Rendering (DIBR) technology based on depth maps is often used to solve the above data acquisition problems. Its calculation is simple and efficient, but the images obtained by using this technology for virtual viewpoint drawing and synthesis have low image quality and the corresponding viewing effect is not ideal. Summary of the invention
[0004] The present disclosure aims to solve at least one of the technical problems existing in the prior art, and proposes a virtual viewpoint synthesis method, an electronic device and a computer-readable medium.
[0005] To achieve the above objectives, in a first aspect, an embodiment of the present disclosure provides a virtual viewpoint synthesis method, comprising:
[0006] Preprocessing the depth map at zero parallax corresponding to the original image to obtain a processed depth map;
[0007] Generating virtual viewpoint images corresponding to multiple virtual viewpoints respectively according to the processed depth map and the original image;
[0008] The holes in each of the virtual viewpoint images are filled to generate a plurality of filled virtual viewpoint images.
[0009] In some embodiments, the step of preprocessing the depth map at zero parallax corresponding to the original image to obtain a processed depth map includes:
[0010] Determine edge pixels in the depth map at zero parallax according to the gradient of each pixel in the row direction in the depth map at zero parallax;
[0011] Determine n pixels adjacent to each edge pixel in a row direction as target pixels;
[0012] The depth value of each target pixel is adjusted according to the maximum depth value of a preset neighborhood corresponding to each target pixel.
[0013] In some embodiments, the step of filling the holes in each of the virtual viewpoint images to generate a plurality of filled virtual viewpoint images includes:
[0014] Traversing all pixels of a background area in a target virtual viewpoint image to determine holes in the background area, wherein the target virtual viewpoint image is any one of the virtual viewpoint images, and depth values corresponding to all pixels of the background area are less than or equal to a preset depth value threshold;
[0015] For any hole in the background area, the hole is filled according to pixel information of at least part of pixels adjacent to the hole in the row direction.
[0016] In some embodiments, the target virtual viewpoint image includes a first side and a second side disposed opposite to each other in a row direction;
[0017] The step of traversing all pixels of the background area in the target virtual viewpoint image to determine the holes in the background area includes:
[0018] In response to the virtual viewpoint corresponding to the target virtual viewpoint image being located on a first side of the reference viewpoint corresponding to the original image, traversing all pixels of the background area in order from the first side to the second side;
[0019] In response to the virtual viewpoint corresponding to the target virtual viewpoint image being located at a second side of the reference viewpoint, all pixels of the background area are traversed in order from the second side to the first side.
[0020] In some embodiments, the step of filling any hole in the background area according to pixel information of at least part of pixels adjacent to the hole in the row direction includes:
[0021] For row pixels corresponding to any row in the hole, the row pixels are filled according to pixel information of two pixels closest to the row pixels in the row direction.
[0022] In some embodiments, the step of filling the row of pixels corresponding to any row in the hole according to pixel information of two pixels closest to the row of pixels in the row direction includes:
[0023] In response to the two pixels belonging to the same parallax plane, the row of pixels is filled by linear interpolation according to the pixel information of the two pixels;
[0024] In response to the situation that the two pixels do not belong to the same parallax plane, the row of pixels is filled according to pixel information of a pixel with the smallest depth value corresponding to the two pixels.
[0025] In some embodiments, whether the two pixels belong to the same disparity plane is determined according to the depth values corresponding to the two pixels.
[0026] In some embodiments, the step of generating virtual viewpoint images corresponding to multiple virtual viewpoints respectively according to the processed depth map and the original image includes:
[0027] Determine, according to the depth value of each pixel in the processed depth map, a distance value corresponding to each pixel in the processed depth map;
[0028] For any virtual viewpoint image to be filled in each of the virtual viewpoint images, determine the disparity value corresponding to each pixel in the virtual viewpoint image to be filled according to its corresponding focal length, its corresponding baseline width and the distance value corresponding to each pixel in the processed depth map;
[0029] For the pixels in the to-be-filled virtual viewpoint image, the corresponding points in the original image are determined according to the corresponding disparity values, and the pixels are filled according to the pixel information of the corresponding points.
[0030] In some embodiments, the step of determining the corresponding point in the original image according to the corresponding disparity value of the pixel in the virtual viewpoint image to be filled, and performing pixel filling according to the pixel information of the corresponding point includes:
[0031] In response to the situation that a single pixel in the to-be-filled virtual viewpoint image has multiple corresponding points in the original image, the single pixel is filled according to pixel information of a corresponding point having a maximum depth value among the multiple corresponding points.
[0032] In a second aspect, an embodiment of the present disclosure provides an electronic device, including:
[0033] one or more processors;
[0034] A memory for storing one or more programs;
[0035] When the one or more programs are executed by the one or more processors, the one or more processors implement the virtual viewpoint synthesis method as described in any of the above embodiments.
[0036] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps in the virtual viewpoint synthesis method as described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flowchart of a virtual viewpoint synthesis method provided by an embodiment of the present disclosure;
[0038] Figure 2 A schematic diagram of a process of step S1 provided in an embodiment of the present disclosure;
[0039] Figure 3 A schematic diagram of edge positions of an original image and a depth map provided in an embodiment of the present disclosure;
[0040] Figure 4 A schematic diagram of an artifact noise provided by an embodiment of the present disclosure;
[0041] Figure 5 A flowchart of another virtual viewpoint synthesis method provided by an embodiment of the present disclosure;
[0042] Figure 6 A schematic diagram of a process of step S2 provided in an embodiment of the present disclosure;
[0043] Figure 7 for Figure 6 A schematic diagram of a virtual viewpoint image shown in FIG.
[0044] Figure 8 This is a flowchart of a specific implementation method of step S301 in the embodiment of the present disclosure;
[0045] Fig. 9 This is a flowchart of a specific implementation method of step S302 in the embodiment of the present disclosure;
[0046] Fig.10 This is a flowchart of a specific implementation method of step S3021 in the embodiment of the present disclosure;
[0047] Fig.11 A flowchart of another virtual viewpoint synthesis method provided by an embodiment of the present disclosure;
[0048] Fig.12 This is a flowchart of a specific implementation method of step S203 in the embodiment of the present disclosure;
[0049] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0050] Fig.14 A schematic diagram of the structure of a computer-readable medium provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the virtual viewpoint synthesis method, electronic device and computer-readable medium provided by the present disclosure are described in detail below with reference to the accompanying drawings.
[0052] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.
[0053] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.
[0054] It will be understood that although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish one element from another element. Therefore, without departing from the teachings of the present disclosure, the first element, first component, or first module discussed below may be referred to as the second element, second component, or second module.
[0055] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0056] The virtual viewpoint synthesis method, electronic device and computer-readable medium provided by the present disclosure can be used to generate a virtual viewpoint image corresponding to a virtual viewpoint based on the original image according to the processed depth map after preprocessing the depth map corresponding to the original image at zero parallax, and fill the holes in the virtual viewpoint image, thereby realizing fast and effective hole repair of the virtual viewpoint image and improving image quality.
[0057] Figure 1 Flow chart of a virtual viewpoint synthesis method provided by an embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0058] Step S1: pre-processing the depth map at zero parallax corresponding to the original image to obtain a processed depth map.
[0059] In step S1, the depth map is preprocessed to achieve functions such as smoothing texture, reducing depth value distortion, repairing holes, feature extraction, and foreground and background separation.
[0060] In some embodiments, the depth map uses an 8-bit grayscale value to represent the distance between the pixel on the image and the reference viewpoint corresponding to the original image, that is, the distance between the reference viewpoint and the zero time difference. The grayscale value is the depth value in the depth map. The smaller the depth value, the farther the distance is from the reference viewpoint. Correspondingly, the larger the depth value, the closer the distance is to the reference viewpoint. That is, when the pixel grayscale value is 255, it means that the pixel is closest to the reference viewpoint, and when the pixel grayscale value is 0, it means that the pixel is farthest from the reference viewpoint. However, the depth value is not the same as the distance value, and the two need to be converted through a corresponding algorithm.
[0061] In some embodiments, the depth map can be calculated by software based on original image rendering, or directly obtained by an image acquisition device with a depth map capture and generation function, such as a depth camera, wherein the reference viewpoint corresponds to the image acquisition device that serves as a reference or is in a reference position during shooting.
[0062] In some embodiments, the depth map may be preprocessed by bilateral filtering, feature map segmentation, edge detection, and target recognition.
[0063] In some embodiments, in step S1, before the step of preprocessing the depth map at zero parallax corresponding to the original image to obtain the processed depth map, the method further includes: obtaining the original image and the depth map corresponding to the reference viewpoint of zero parallax.
[0064] Step S2: Generate virtual viewpoint images corresponding to multiple virtual viewpoints according to the processed depth map and the original image.
[0065] In step S2, according to the depth map preprocessed in step S1, virtual viewpoint images corresponding to each virtual viewpoint are generated based on the original image.
[0066] In some embodiments, before the step of generating virtual viewpoint images corresponding to multiple virtual viewpoints respectively according to the processed depth map and the original image in step S2, the step further includes: acquiring multiple virtual viewpoints whose spatial positions are different from the reference viewpoint.
[0067] In some embodiments, the virtual viewpoint images corresponding to each virtual viewpoint are pixel-filled according to the processed depth map and the original image corresponding to the reference viewpoint to generate virtual viewpoint images corresponding to each virtual viewpoint; in some embodiments, the pixels of the virtual viewpoint images are filled by a virtual viewpoint drawing technology based on the depth map; or, in some embodiments, the virtual viewpoint images corresponding to each virtual viewpoint are generated through depth value information conversion and pixel information conversion according to the depth value information of the processed depth map and the pixel information of the original image corresponding to the reference viewpoint.
[0068] In some embodiments, the virtual viewpoint is determined by acquiring reference coordinates corresponding to the virtual viewpoint, or acquiring relative coordinates of the virtual viewpoint corresponding to the reference viewpoint, or acquiring a baseline width between the virtual viewpoint and the reference viewpoint.
[0069] In some embodiments, the original image is a color image.
[0070] Step S3: Fill the holes in each virtual viewpoint image to generate a plurality of filled virtual viewpoint images.
[0071] Among them, after the virtual viewpoint image is generated in step S2, there are partial holes in the virtual viewpoint image at this time. After filling the holes, a virtual viewpoint image corresponding to the virtual viewpoint is finally generated; the holes are continuous holes, which correspond to multiple pixels whose pixel information is null value, or, in some embodiments, correspond to multiple pixels whose pixel information is extreme value.
[0072] In some embodiments, after the step of filling the holes in each virtual viewpoint image to generate a plurality of filled virtual viewpoint images in step S3, the method further includes: fusing the original image and the plurality of filled virtual viewpoint images and reconstructing the three-dimensional scene according to the reference viewpoint and the virtual viewpoint to generate a fused image, and displaying the fused image.
[0073] The disclosed embodiments provide a virtual viewpoint synthesis method, which can be used to generate a virtual viewpoint image corresponding to a virtual viewpoint based on the original image according to the processed depth map after preprocessing the depth map corresponding to the original image at zero parallax, and fill the holes in the virtual viewpoint image, thereby realizing fast and effective hole repair of the virtual viewpoint image and improving image quality.
[0074] Figure 2 A schematic diagram of a process flow of step S1 provided in an embodiment of the present disclosure. Figure 2 As shown, specifically, step S1, the step of preprocessing the depth map at zero parallax corresponding to the original image to obtain the processed depth map, includes: steps S101 to S103.
[0075] Step S101 : determining edge pixels in the depth map at zero disparity according to the gradient of each pixel in the row direction in the depth map at zero disparity.
[0076] Among them, the edge pixels are located at the foreground edge position of the depth map, and the foreground edge position is the edge part of each object in the foreground area; in some embodiments, the depth value corresponding to all pixels in the foreground area is greater than or equal to a preset depth value threshold; in some embodiments, the edge pixels are determined by calculating the gradient of each pixel in the depth map and comparing it with a preset gradient threshold.
[0077] In some embodiments, in step S2, the virtual viewpoint is determined by horizontal shifting, that is, warping is performed in the horizontal direction based on the reference viewpoint to determine the virtual viewpoint, thereby only calculating the gradient of each pixel in the row direction and comparing it with a preset gradient threshold to determine the edge pixel.
[0078] Step S102: determine n pixels adjacent to each edge pixel in the row direction as target pixels.
[0079] Wherein, n is a positive integer; in some embodiments, the depth map includes a first side and a second side relatively arranged in a row direction, and n pixels adjacent to a specific pixel in the row direction, that is, n pixels located on the first side and the second side of the specific pixel.
[0080] In some embodiments, for any edge pixel at a foreground edge position in the depth map, n pixels on its first side and m pixels on its second side are determined as target pixels, where n and m are positive integers. In some embodiments, n and m are equal.
[0081] Figure 3 A schematic diagram of edge positions of an original image and a depth map provided by an embodiment of the present disclosure. Figure 3As shown in the figure, the circled parts are the edge positions of the original image and the depth map, respectively. In the original image, in particular, in the color image, the pixel information corresponding to the edge portion of the object is gradual, and the width corresponding to the edge portion is 1 pixel or multiple pixels. In some embodiments, the width of the edge portion of the object corresponds to 1 to 3 pixels; while in the depth map, the pixel information corresponding to the edge portion of the object is sudden; for the original image and the depth map, if the pixel information corresponding to the foreground edge position of the two is not synchronized, when synthesizing the virtual viewpoint, the foreground edge position will be mapped as the background to the virtual viewpoint image corresponding to the virtual viewpoint according to the depth map, resulting in artifact noise.
[0082] Figure 4 A schematic diagram of an artifact noise provided by an embodiment of the present disclosure. Figure 4 As shown in the figure, the circled part is the artifact noise in the virtual viewpoint image. Pixel information corresponding to the edge of the foreground object appears in the position where the background area should be, thereby causing artifact noise.
[0083] Step S103: adjusting the depth value of each target pixel according to the maximum depth value of the preset neighborhood corresponding to each target pixel.
[0084] The depth value of the preset neighborhood is the depth value corresponding to all pixels in the preset neighborhood; the depth value of each target pixel is adjusted according to the maximum value of the depth value of the preset neighborhood corresponding to each target pixel. Thus, the foreground edge of the depth map is expanded, and the sudden change of the pixel information corresponding to the foreground edge position of the depth map is reduced. When the virtual viewpoint image is generated in the subsequent step S2, the holes on the sides of each object in the foreground area are separated from each object, that is, the left and right sides of the holes are both background areas, which does not affect the pixel information of the foreground area and facilitates hole repair.
[0085] In some embodiments, the method further includes: adjusting the depth value of the target pixel according to an average value of the depth values of a preset neighborhood, or adjusting the depth value of the target pixel according to weight information of the depth values of a preset neighborhood.
[0086] The disclosed embodiments provide a method for synthesizing a virtual viewpoint. The method can be used to determine multiple pixels adjacent to edge pixels at a foreground edge position in a row direction as target pixels, and adjust the depth value of each target pixel according to the depth value of a preset neighborhood corresponding to each target pixel, so as to preprocess the depth map, avoid poor effect in subsequent virtual viewpoint synthesis due to low precision of the depth map, and smooth the foreground edge of the depth map to avoid noise generated during virtual viewpoint synthesis due to sudden changes in pixel information, and adjust the depth value of each target pixel according to the maximum value of the depth value of the preset neighborhood corresponding to each target pixel, so that the left and right sides of the hole generated after synthesis are both background areas.
[0087] Figure 5 A flowchart of another virtual viewpoint synthesis method provided by an embodiment of the present disclosure. Figure 2 A specific optional implementation of the method shown. Figure 5 As shown, in the case where step S1 includes steps S101 to S103, the method includes not only steps S1 and S2, but also steps S301 and S302, wherein steps S301 and S302 are a specific optional implementation of step S3. Only steps S301 and S302 are described in detail below.
[0088] Step S301: traverse all pixels in the background area of the target virtual viewpoint image to determine holes in the background area.
[0089] Among them, the target virtual viewpoint image is any one of the virtual viewpoint images, and the depth values corresponding to all pixels in the background area are less than or equal to a preset depth value threshold; based on the preprocessing of the depth map in steps S101 to S103, in the virtual viewpoint image generated in step S2, except for the holes inside the foreground area, the left and right sides of the remaining holes are all background areas, that is, the holes in the background area, including the holes near the foreground edge position, also meet this characteristic.
[0090] Figure 6 A schematic diagram of a process flow of step S2 provided in an embodiment of the present disclosure. Figure 6 As shown, in step S2, a virtual viewpoint image is generated according to the processed depth map and the original image. It should be noted that the image size relationship between the original image, the depth map, and the virtual viewpoint image shown in the figure is generated based on the drawing layout method selected for the convenience of description, which does not limit the technical solution provided by the embodiment of the present disclosure. In some embodiments, the image sizes of the original image and the depth map are equal, and the virtual viewpoint image is equal to or unequal to the image sizes of the two.
[0091] Figure 7 for Figure 6 A schematic diagram of a virtual viewpoint image shown in FIG. Figure 7 As shown in the figure, the circled pixel information with null value is the hole near the foreground edge. The hole near the foreground edge is the hole caused by the lack of mappable pixel information in some pixels in the original pixel position, especially the edge position, due to the axis shift transformation of the object in the foreground area of the original image when mapping the pixel information of the virtual viewpoint image.
[0092] Step S302: For any hole in the background area, fill the hole according to pixel information of at least part of pixels adjacent to the hole in the row direction.
[0093] Among them, for the holes near the foreground edge, they can also be filled and repaired based on the pixel information of the background area pixels on its left and right sides, combined with steps S101 to S103, and steps S301 and S302, to avoid using the pixel information corresponding to the foreground area to fill such holes.
[0094] In some embodiments, the target virtual viewpoint image includes a first side and a second side relatively arranged in a row direction, and at least part of the pixels can be selected from all the pixels located on the first side and the second side of the hole by nearest neighbor interpolation to repair the hole; or, at least part of the pixels can be selected based on weight information corresponding to the pixels located on the first side and the second side of the hole to repair the hole; or, at least part of the pixels can be selected based on depth values corresponding to the pixels located on the first side and the second side of the hole to repair the hole.
[0095] The embodiment of the present disclosure provides a virtual viewpoint synthesis method, which can be used to repair the hole based on the aforementioned preprocessing method, using the pixel information of the background area pixels on both sides of the hole, on the premise that both sides of the hole are background areas, to avoid using the pixel information corresponding to the foreground area to fill the hole.
[0096] Figure 8 is a flowchart of a specific implementation method of step S301 in the embodiment of the present disclosure. Specifically, the target virtual viewpoint image includes a first side and a second side that are arranged opposite to each other in the row direction; Figure 8 As shown, step S301, traversing all pixels in the background area of the target virtual viewpoint image to determine the holes in the background area, includes: step S3011 and step S3012.
[0097] Step S3011: In response to the virtual viewpoint corresponding to the target virtual viewpoint image being located on a first side of the reference viewpoint corresponding to the original image, traverse all pixels of the background area in order from the first side to the second side.
[0098] Step S3012: In response to the virtual viewpoint corresponding to the target virtual viewpoint image being located on the second side of the reference viewpoint, traverse all pixels of the background area in order from the second side to the first side.
[0099] In this way, pixel information corresponding to the foreground area in the target virtual viewpoint image is avoided from being mistakenly classified as a hole; wherein, when mapping the pixel information of the virtual viewpoint image, an axis-shift transformation is performed based on the original image according to the positional relationship between the virtual viewpoint and the reference viewpoint. When the virtual viewpoint is located on the first side of the reference viewpoint, the hole near the foreground edge position generated in its virtual viewpoint image is located on the first side of its foreground object. Correspondingly, when the virtual viewpoint is located on the second side of the reference viewpoint, the hole near the foreground edge position generated in its virtual viewpoint image is located on the second side of its foreground object.
[0100] Fig. 9 FIG. 1 is a flowchart of a specific implementation method of step S302 in the embodiment of the present disclosure. Specifically, Fig. 9 As shown, step S302, for any hole in the background area, the step of filling the hole according to pixel information of at least part of the pixels adjacent to the hole in the row direction, includes: step S3021.
[0101] Step S3021: For the row of pixels corresponding to any row in the hole, fill the row of pixels according to the pixel information of the two pixels closest to the row of pixels in the row direction.
[0102] The row pixels are all pixels of the corresponding row in the hole, and the two pixels closest to the row pixels in the row direction are both pixels of the background area.
[0103] Fig.10 FIG. 1 is a flowchart of a specific implementation method of step S3021 in the embodiment of the present disclosure. Specifically, Fig.10 As shown, step S3021, for the row pixels corresponding to any row in the hole, the step of filling the row pixels according to the pixel information of the two pixels closest to the row pixels in the row direction includes: step S3021a and step S3021b.
[0104] Step S3021a: In response to the fact that the two pixels belong to the same parallax plane, fill the row of pixels by linear interpolation according to the pixel information of the two pixels.
[0105] Step S3021b: In response to the situation that the two pixels do not belong to the same disparity plane, fill the row of pixels according to the pixel information of the pixel with the smallest depth value corresponding to the two pixels.
[0106] In some embodiments, when the hole to be repaired is a hole close to the foreground edge, if the two pixels on both sides of the hole do not belong to the same disparity plane and have different distance relationships with the virtual viewpoint, the two are not synchronized, and the pixel information of the closer pixel is closer to the pixel information corresponding to the foreground area. Therefore, in order to ensure that the hole is repaired using the pixel information of the background area, when the two pixels do not belong to the same disparity plane, the pixel information of the pixel with a smaller depth value is used to repair the row pixels of the row corresponding to the hole.
[0107] In some embodiments, in step S3021a and step S3021b, it is determined whether the two pixels belong to the same disparity plane according to the depth values corresponding to the two pixels.
[0108] Fig.11 Flow chart of another virtual viewpoint synthesis method provided by the embodiment of the present disclosure. Fig.11 As shown, this method is based on Figure 1 A specific optional implementation of the method shown. The method includes not only step S1 and step S3, but also steps S201 to S203, wherein steps S201 to S203 are a specific optional implementation of step S2. Only steps S201 to S203 are described in detail below.
[0109] Step S201: Determine a distance value corresponding to each pixel in the processed depth map according to the depth value of each pixel in the processed depth map.
[0110] In some embodiments, it also includes determining a zero parallax plane, wherein the zero parallax plane is a planar area that overlaps with the playback screen after image fusion and three-dimensional scene reconstruction based on the original image and the virtual viewpoint image. In some embodiments, the corresponding length of the zero parallax plane is infinite. In actual applications, the length is an adjustable parameter used to adjust the range of entering and exiting the screen when displaying the final image.
[0111] In one embodiment, the depth value may be converted into a distance value in a linear manner or a non-linear manner, wherein the distance value corresponds to the actual distance.
[0112] Specifically, the following formula is used in a linear manner:
[0113]
[0114] Convert the depth value to the distance value, where i and j are the coordinate values of the pixel, D(i,j) and Z(i,j) represent the depth value and distance value corresponding to the pixel respectively, and Z near and Z far Both are preset distance values or pre-acquired fixed values, corresponding to the minimum actual distance and the maximum actual distance respectively.
[0115] Alternatively, the following formula can be used in a nonlinear way:
[0116]
[0117] Converts depth values to distance values.
[0118] Step S202: for any virtual viewpoint image to be filled in each virtual viewpoint image, determine the disparity value corresponding to each pixel in the virtual viewpoint image to be filled according to its corresponding focal length, its corresponding baseline width and the distance value corresponding to each pixel in the processed depth map.
[0119] Among them, the focal length is a preset value or a pre-acquired fixed value, the baseline width represents the distance between the virtual viewpoint and the reference viewpoint, and in some embodiments, the baseline width is the horizontal distance between the projections of the virtual viewpoint and the reference viewpoint corresponding to the virtual viewpoint image on the zero parallax plane.
[0120] In some embodiments, the following formula is used:
[0121]
[0122] Determine the disparity value, where Dis(i,j) represents the disparity value corresponding to the pixel, F is the focal length, B is the baseline width, and Z zero is the zero parallax plane.
[0123] Step S203: for the pixels in the virtual viewpoint image to be filled, determine the corresponding points in the original image according to the corresponding disparity values, and perform pixel filling according to the pixel information of the corresponding points.
[0124] In some embodiments, the following formula is used:
[0125] Virtual[(i,j)+dire*Dis(i,j)]=RGB(i,j)
[0126] Determine the corresponding points of the pixels in the virtual viewpoint image to be filled in the original image, and fill the pixels according to the pixel information of the corresponding points, wherein dire is an adjustment parameter, dire=±1, in response to the situation that the virtual viewpoint is located on the right side of the reference viewpoint, dire is negative, and in response to the situation that the virtual viewpoint is located on the left side of the reference viewpoint, dire is positive; Virtual() represents the pixels in the virtual viewpoint graphics; the original image is a color image, and its color space is RGB space, RGB(i,j) is the corresponding point of the pixel in the virtual viewpoint image in the original image.
[0127] Fig.12 FIG. 2 is a flowchart of a specific implementation method of step S203 in the embodiment of the present disclosure. Specifically, Fig.12As shown, step S203, for the pixels in the virtual viewpoint image to be filled, determining the corresponding points in the original image according to the corresponding disparity values, and performing pixel filling according to the pixel information of the corresponding points, includes: step S2031.
[0128] Step S2031: In response to the situation that a single pixel in the virtual viewpoint image to be filled has multiple corresponding points in the original image, fill the single pixel according to the pixel information of the corresponding point with the largest depth value among the multiple corresponding points.
[0129] To ensure that the foreground area in the virtual viewpoint image to be filled is not blocked by the background area, when a single pixel in the virtual viewpoint image to be filled has multiple corresponding points in the original image, the single pixel is filled according to the pixel information of the corresponding point with the largest depth value.
[0130] In some embodiments, the method further includes: in response to a situation where a plurality of consecutive pixels in the to-be-filled virtual viewpoint image do not have corresponding points in the original image, determining the plurality of pixels as holes.
[0131] Fig.13 The structure diagram of an electronic device provided by the embodiment of the present disclosure is shown in FIG. Fig.13 As shown, the electronic device includes:
[0132] One or more processors 101;
[0133] A memory (device) 102 having one or more programs stored thereon, and when the one or more programs are executed by the one or more processors, the one or more processors implement the virtual viewpoint synthesis method as described in any of the above embodiments;
[0134] One or more I / O interfaces 103 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.
[0135] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU) and the like; the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus) and the like.
[0136] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.
[0137] In some embodiments, the electronic device can be a display for image display, and the images displayed include: original images, depth maps, virtual viewpoint images, and fused images generated by image fusion and three-dimensional scene reconstruction of the original images and virtual viewpoint images based on reference viewpoints and virtual viewpoints.
[0138] Fig.14 A schematic diagram of the structure of a computer-readable medium provided in an embodiment of the present disclosure. The computer-readable medium stores a computer program, wherein when the program is executed by a processor, the steps in any of the virtual viewpoint synthesis methods in the above embodiments are implemented.
[0139] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, the functional modules / units in the device may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0140] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A virtual viewpoint synthesis method, comprising: Preprocessing the depth map at zero parallax corresponding to the original image to obtain a processed depth map; The preprocessing step includes: determining edge pixels in the depth map at zero disparity according to the gradient of each pixel in the row direction in the depth map at zero disparity; Determine n pixels adjacent to each edge pixel in a row direction as target pixels; and adjust the depth value of each target pixel according to an average depth value of a preset neighborhood corresponding to each target pixel; Generating virtual viewpoint images corresponding to multiple virtual viewpoints respectively according to the processed depth map and the original image; The holes in each of the virtual viewpoint images are filled to generate a plurality of filled virtual viewpoint images.
2. The virtual viewpoint synthesis method according to claim 1, wherein: The step of filling the holes in each of the virtual viewpoint images to generate a plurality of filled virtual viewpoint images comprises: Traversing all pixels of a background area in a target virtual viewpoint image to determine holes in the background area, wherein the target virtual viewpoint image is any one of the virtual viewpoint images, and depth values corresponding to all pixels of the background area are less than or equal to a preset depth value threshold; For any hole in the background area, the hole is filled according to pixel information of at least part of pixels adjacent to the hole in the row direction.
3. The virtual viewpoint synthesis method according to claim 2, wherein: The target virtual viewpoint image includes a first side and a second side that are arranged opposite to each other in a row direction; The step of traversing all pixels of the background area in the target virtual viewpoint image to determine the holes in the background area includes: In response to the virtual viewpoint corresponding to the target virtual viewpoint image being located on a first side of the reference viewpoint corresponding to the original image, traversing all pixels of the background area in order from the first side to the second side; In response to the virtual viewpoint corresponding to the target virtual viewpoint image being located at a second side of the reference viewpoint, all pixels of the background area are traversed in order from the second side to the first side.
4. The virtual viewpoint synthesis method according to claim 2, wherein: The step of filling any hole in the background area according to pixel information of at least part of pixels adjacent to the hole in the row direction comprises: For row pixels corresponding to any row in the hole, the row pixels are filled according to pixel information of two pixels closest to the row pixels in the row direction.
5. The virtual viewpoint synthesis method according to claim 4, wherein: The step of filling the row of pixels corresponding to any row in the hole according to the pixel information of two pixels closest to the row of pixels in the row direction comprises: In response to the two pixels belonging to the same parallax plane, the row of pixels is filled by linear interpolation according to the pixel information of the two pixels; In response to the situation that the two pixels do not belong to the same parallax plane, the row of pixels is filled according to pixel information of a pixel with the smallest depth value corresponding to the two pixels.
6. The virtual viewpoint synthesis method according to claim 5, wherein: It is determined whether the two pixels belong to the same disparity plane according to the depth values corresponding to the two pixels.
7. The virtual viewpoint synthesis method according to claim 1, wherein: The step of generating virtual viewpoint images corresponding to multiple virtual viewpoints respectively according to the processed depth map and the original image comprises: Determine, according to the depth value of each pixel in the processed depth map, a distance value corresponding to each pixel in the processed depth map; For any virtual viewpoint image to be filled in each of the virtual viewpoint images, determine the disparity value corresponding to each pixel in the virtual viewpoint image to be filled according to its corresponding focal length, its corresponding baseline width and the distance value corresponding to each pixel in the processed depth map; For the pixels in the to-be-filled virtual viewpoint image, the corresponding points in the original image are determined according to the corresponding disparity values, and the pixels are filled according to the pixel information of the corresponding points.
8. The virtual viewpoint synthesis method according to claim 7, wherein: The step of determining, for a pixel in the virtual viewpoint image to be filled, its corresponding point in the original image according to its corresponding disparity value, and performing pixel filling according to the pixel information of the corresponding point includes: In response to the situation that a single pixel in the to-be-filled virtual viewpoint image has multiple corresponding points in the original image, the single pixel is filled according to pixel information of a corresponding point having a maximum depth value among the multiple corresponding points.
9. An electronic device, comprising: one or more processors; A memory 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 virtual viewpoint synthesis method as described in any one of claims 1-8.
10. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the computer program implements the steps in the virtual viewpoint synthesis method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Virtual viewpoint drawing method based on depth value non-linear transformation
CN102436671A
Virtual viewpoint rendering method
CN102592275A
Depth-based cavity repairing method in viewpoint synthesis
CN104780355A
Virtual viewpoint image generation method with maximum parallax hierarchy
CN110062220A
Apparatus and method for converting scale of three-dimensional image
KR1020140037301A
