Image processing method and device, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202411434871.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2044-10-14
AI Technical Summary
[0004]本申请实施例的目的是提供一种图像处理方法、装置、电子设备及可读存储介质,可以解决相关技术存在的插帧图像质量差的技术问题
[0016]第六方面,本申请实施例提供了一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述方法的步骤。
Smart Images

Figure CN119420863B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, specifically relating to an image processing method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] Frame interpolation is a technique that generates several frames based on the current frame and the previous frame and inserts them between the current frame and the previous frame. Frame interpolation can increase the frame rate of the screen, making the screen smoother, and can also reduce the rendering pressure on the graphics processing unit (GPU) of electronic devices, thus reducing power consumption.
[0003] The relevant technologies are mainly based on the frame interpolation algorithm AMD FidelityFX. TM Super Resolution 3 is used to determine the interpolated image, which has poor quality. Summary of the Invention
[0004] The purpose of this application is to provide an image processing method, apparatus, electronic device, and readable storage medium that can solve the technical problem of poor image quality in frame interpolation in related technologies.
[0005] In a first aspect, embodiments of this application provide an image processing method, including:
[0006] The binary image of the first image frame, the motion vector image of the first image frame relative to the second image frame, and the depth image of the first image frame are obtained. The second image frame is the previous frame of the first image frame. The pixels of the motion vector image, the binary image, and the depth image correspond one-to-one.
[0007] The motion vector image and depth image are processed based on the binary image to obtain the updated motion vector image and the updated depth image;
[0008] Based on the updated motion vector image and the updated depth image, as well as the first image frame and the second image frame, an interpolated image is generated between the first image frame and the second image frame.
[0009] Secondly, embodiments of this application provide an image processing apparatus, including:
[0010] The acquisition module is used to acquire the binary image of the first image frame, the motion vector image of the first image frame relative to the second image frame, and the depth image of the first image frame. The second image frame is the previous frame of the first image frame. The pixels of the motion vector image, the binary image, and the depth image correspond one-to-one.
[0011] The processing module is used to process the motion vector image and depth image based on the binary image to obtain the updated motion vector image and the updated depth image;
[0012] The generation module is used to generate interpolated frames between the first image frame and the second image frame based on the updated motion vector image and the updated depth image, as well as the first image frame and the second image frame.
[0013] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method as described in the first aspect.
[0014] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method as described in the first aspect.
[0015] Fifthly, embodiments of this application provide a chip, which includes a processor and a communication interface, the communication interface and the processor being coupled together, the processor being used to run programs or instructions to implement the steps of the method as described in the first aspect.
[0016] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the method as described in the first aspect.
[0017] This embodiment of the application acquires a binary image of a first image frame, a motion vector image of the first image frame relative to a second image frame, and a depth image of the first image frame, wherein the second image frame is the previous frame of the first image frame. The motion vector image and depth image are processed based on the binary image to obtain updated motion vector images and updated depth images. Based on the updated motion vector images and updated depth images, as well as the first and second image frames, an interpolated image is generated between the first and second image frames. That is, this embodiment of the application updates the motion vectors in the motion vector image and the depth values in the depth image from a pixel perspective, combining the binary image, reducing the fragmentation of the interpolated image and improving the quality of the interpolated image. Attached Figure Description
[0018] Figure 1 A schematic diagram of a motion vector image provided for related technologies;
[0019] Figure 2 A flowchart illustrating an image processing method provided in an embodiment of this application;
[0020] Figure 3A schematic diagram of a first image frame provided in an embodiment of this application;
[0021] Figure 4 A schematic diagram of a motion vector image provided in an embodiment of this application;
[0022] Figure 5 A schematic diagram of a binary image provided in an embodiment of this application;
[0023] Figure 6 A schematic diagram of a depth image provided in an embodiment of this application;
[0024] Figure 7 A flowchart illustrating another image processing method provided in this application embodiment;
[0025] Figure 8 A flowchart illustrating another image processing method provided in this application embodiment;
[0026] Figure 9 A flowchart illustrating another image processing method provided in this application embodiment;
[0027] Figure 10 A schematic diagram of an original motion vector image provided for an embodiment of this application;
[0028] Figure 11 This application provides a schematic diagram comparing the effects of processed images in an embodiment.
[0029] Figure 12 This is a schematic diagram showing another comparison of processed image effects provided in an embodiment of this application;
[0030] Figure 13 This is a schematic diagram showing another comparison of processed image effects provided in an embodiment of this application;
[0031] Figure 14 This is a schematic diagram showing another comparison of processed image effects provided in an embodiment of this application;
[0032] Figure 15 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application;
[0033] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0034] Figure 17 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0035] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0036] The terms "first," "second," etc., used in this application's specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects have an "or" relationship.
[0037] As mentioned above, frame interpolation technology can improve the frame rate, making the visuals smoother, and can also reduce the rendering load on the GPU, thus lowering power consumption. For example, in 3D games, due to limitations in GPU computing power, large open-world 3D games often run at a refresh rate of 60Hz or even lower, severely impacting the user's gaming experience. Frame interpolation can improve the game's frame rate. Moreover, because the frame interpolation process is performed in a two-dimensional image space, it eliminates the need to consider the complex calculations required in a three-dimensional scene, thereby effectively reducing the GPU's computational load and power consumption.
[0038] In game frame interpolation algorithms, the quality of the motion vector map plays a crucial role in the final image quality of the interpolated frames. However, by observing... Figure 1 The motion vector diagram in rectangle 100 shows that the motion vectors at the edge of the figure are not similar to the motion vectors of the foreground (inside the figure) and the background, which is inaccurate. The motion vector at this point should belong to the foreground. Therefore, an algorithm is needed to correct the motion vectors at the edge of the figure by expanding the motion vectors of the foreground outward to achieve the purpose of correcting the motion vectors at the edge.
[0039] To achieve the above objectives, the most commonly used algorithm is currently AMD FidelityFX. TM The Super Resolution 3 (FSR3) algorithm processes data based on the principle of minimizing depth values. This approach can lead to the following problems:
[0040] During motion vector dilation, the motion vector at a location with a smaller depth value may be incorrect. Direct dilation will cause the area of incorrect motion vectors to be larger, eventually leading to fragmented interpolated images and affecting the interpolation effect.
[0041] Therefore, embodiments of this application provide an image processing method, apparatus, electronic device, and readable storage medium, which can solve the technical problem of poor quality of interpolated images in related technologies and reduce the occurrence of broken interpolated images.
[0042] The image processing method, apparatus, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0043] The image processing method provided in this application can be applied to electronic devices such as mobile phones, tablets, and laptops. This application can also be applied to scenarios such as games and videos.
[0044] Figure 2 A flowchart of an image processing method provided in an embodiment of this application is shown below. Figure 2 As shown, the image processing method may include the following steps:
[0045] S210. Obtain the binary image of the first image frame, the motion vector image of the first image frame relative to the second image frame, and the depth image of the first image frame.
[0046] The second image frame is the image preceding the first image frame, and the pixels of the motion vector image, binary image, and depth image correspond one-to-one.
[0047] S220. Process the motion vector image and depth image based on the binary image to obtain the updated motion vector image and the updated depth image.
[0048] S230. Based on the updated motion vector image and the updated depth image, as well as the first image frame and the second image frame, generate an interpolated image between the first image frame and the second image frame.
[0049] This application embodiment updates the motion vector in the motion vector image and the depth value in the depth image from the perspective of pixels, combining binary images, thereby reducing the fragmentation of the interpolated image and improving the quality of the interpolated image.
[0050] The above steps are explained in detail below:
[0051] In S210, the first image frame can be an image frame in a video, which can be a video obtained from film and television production, a video shot by a camera, an offline or online game, etc.
[0052] The second image frame and the first image frame can be adjacent image frames. Specifically, the second image frame can be the frame before the first image frame or the frame after the first image frame. In this embodiment, the second image frame is taken as the image before the first image frame.
[0053] The motion vector image is used to represent the motion vector of each pixel in the first image frame relative to the second image frame. The depth image is used to represent the depth value of each pixel in the first image frame. The binary image is used to represent which pixels belong to the target object and which pixels belong to the non-target object. The target object can be an object of user interest; for example, in a game frame, the target object can be a character. For example, the binary image can use 0 to represent a non-target object and 1 to represent a target object.
[0054] The first image frame, motion vector image, binary image, and depth image are all the same size, with each pixel corresponding to the next. Figure 3 Taking the first image frame shown as an example, the motion vector image, binary image, and depth image can be found in the following references: Figures 4-6 Since the same pixel at the same location is the same in different images, the subsequent image processing can be simplified, eliminating the need to determine the matching relationship of pixels in each image.
[0055] In S220, the embodiments of this application can update the motion vector image and depth image from a pixel-level perspective using a binary image to obtain an updated motion vector image and an updated depth image, providing a more accurate basis for subsequently generating interpolated images between the first image frame and the second image frame.
[0056] The updated motion vector image can have the same number of pixels, but the motion vectors of some or all of the pixels have changed. Alternatively, the number of pixels can be reduced, but the motion vectors of some or all of the pixels have changed. Reducing the number of pixels will appropriately lower the image resolution, thereby reducing the power consumption of image processing.
[0057] In some embodiments, the electronic device may select a region from a binary image and update the motion vector of the corresponding pixel in the motion vector image and the depth value of the corresponding pixel in the depth image according to the motion vector and depth value of the pixel in the region, respectively.
[0058] This region can be a neighborhood centered on a pixel in a binary image, or it can be a block of an image obtained by dividing a binary image into blocks.
[0059] In other words, electronic devices can update motion vector images and depth images based on the motion vectors and depth values of pixels in the neighborhood, or based on the motion vectors and depth values of pixels within an image block.
[0060] Through the above processing, most erroneous motion vectors can be corrected. To further improve the image processing effect, for example, after S220, the image processing method may also include the following steps:
[0061] The updated motion vector image and the updated depth image are filtered to obtain the filtered motion vector image and the filtered depth image.
[0062] The filtering here can be median filtering or other forms of filtering. By filtering the updated motion vector image and the updated depth image, the motion vector can be made smoother, and there will be fewer holes and fragments in the motion vector within the target object, thereby further improving the quality of the interpolated image.
[0063] In S230, based on the updated motion vector image and depth image, as well as the first image frame and the second image frame, one or more interpolated frames can be generated between the first image frame and the second image frame. The specific generation process is not limited in this embodiment. Inserting the interpolated frames between the first image frame and the second image frame can increase the display frame rate of the image and improve the user experience.
[0064] Figure 7 A flowchart illustrating another image processing method provided in this application embodiment. Figure 7 and Figure 2 The difference is that, Figure 2 S220 in the text can be further refined into Figure 7 The S710-S730 series.
[0065] S710. Determine the target region from the binary image.
[0066] The target region is the area containing some or all of the pixels in a binary image. For example, the target region can be a region centered on any pixel in the binary image. That is, the electronic device can select a pixel in the binary image as the center point and define the region containing that center point as the target region. For instance, the target region can be defined as the neighborhood of pixel A in the binary image with a radius of r, where the radius r is less than or equal to the shortest distance from that feature point to the edge of the binary image. For example, the target region can also be a rectangle or other shapes.
[0067] For example, a pixel can be selected as pixel A from pixels with a value of 1, or a pixel can be selected as pixel A from pixels with a value of 0. Considering that the target object may have multiple edges, in order to improve the image processing effect, for example, each pixel can also be determined as a center point. That is, for each pixel, a target region can be obtained, and a similar process can be performed for each target region.
[0068] For example, the target region can also be an image block in a binary image, obtained by dividing the binary image into blocks. When there are multiple image blocks, the number of pixels contained in different image blocks can be the same or different. In some embodiments, the target region can contain N*N pixels, where N is an integer greater than or equal to 1. These N*N pixels can be equivalent to one pixel, thus reducing the number of pixels, reducing the image resolution, and consequently reducing the image processing power consumption.
[0069] The embodiments of this application can process motion vector images and depth images from a pixel-level or block-level perspective, thereby improving the flexibility of the method while enhancing image quality.
[0070] S720. Determine the first target pixel from the target region based on the number of first pixels in the target region.
[0071] In this context, the first pixel is the pixel corresponding to the target object in the first image frame. For example, when 1 represents the target object and 0 represents a non-target object, the first pixel is the pixel with a value of 1. The number of first pixels is also the number of pixels with a value of 1. The target region may include 0, 1, or more first pixels.
[0072] The first target pixel is a pixel in the target region, and the number of first target pixels can be one or more. The position and number of the first target pixels are related to the number of first pixels in the target region and the selection method of the target region. That is, the embodiments of this application can dynamically determine the first target pixels according to the selection method of the target region and the number of first pixels, which can improve the image processing effect. The specific determination process of the first target pixel can be found in the following embodiments.
[0073] S730. Based on the pixel information of the first target pixel, update the pixel information of the second target pixel in the motion vector image and the depth image to obtain the updated motion vector image and the updated depth image.
[0074] Here, the second target pixel is the pixel in the motion vector image and depth image that corresponds to the first target pixel. The second target pixel and the first target pixel can have a one-to-one correspondence, or they can be a pair of P. For example, when the target region is a region centered at any pixel in the binary image, the second target pixel and the first target pixel can have a one-to-one correspondence. When the target region is an image block in the binary image, the second target pixel and the first target pixel can have a pair of P, where P represents the number of first target pixels, and P is an integer greater than or equal to 1.
[0075] Pixel information can be information that characterizes the features of a pixel. For example, in a motion vector image, pixel information is the motion vector, and in a depth image, pixel information is the depth value.
[0076] For example, the electronic device can update the motion vector of the second target pixel corresponding to the first target pixel in the motion vector image according to the motion vector of the first target pixel, and update the depth value of the second target pixel corresponding to the first target pixel in the depth image according to the depth value of the first target pixel.
[0077] The process of updating motion vectors is similar to that of updating depth values. Taking the update of motion vector of second target pixel in motion vector based on motion vector of first target pixel as an example, for instance, the motion vector of second target pixel in motion vector image can be directly replaced with the motion vector of first target pixel, or the motion vector of first target pixel can be processed to obtain processed motion vector, and the motion vector of second target pixel in motion vector image can be replaced with processed motion vector.
[0078] In this application embodiment, target regions are flexibly selected from binary images according to different selection strategies. Based on the number of pixels corresponding to the target object in the target region, a first target pixel is further determined from the target region. The pixel information of the second target pixel corresponding to the first target pixel in the motion vector image and depth image is updated based on the pixel information of the first target pixel, thereby reducing the occurrence of frame interpolation image fragmentation.
[0079] S720. Perform block processing on the binary image to obtain at least one image block, and determine the image block as the target region.
[0080] Each image block includes at least one pixel. When an image block contains one pixel, it can be represented as 1*1. When an image block contains multiple pixels, it can be represented as M*N, indicating that the image block contains M*N pixels. M and N can be the same or different. In some embodiments, M=N=2, or M=N=4, or M=N=8, or M=N=16, etc.
[0081] The embodiments of this application can process motion vector images and depth images from a pixel-level or block-level perspective, thereby improving the flexibility of the method while enhancing image quality.
[0082] The process of determining the first target pixel is explained below:
[0083] Figure 8 A flowchart illustrating another image processing method provided in this application embodiment. Figure 8 and Figure 7 The difference is that, Figure 7 The S720 in the text can be further refined into Figure 8 S810-S820 in the series.
[0084] S810. When the target region is a region centered on any pixel in the binary image, determine the first target pixel from the target region based on the number of first pixels.
[0085] For example, when the target region is a region centered on any pixel in a binary image, the first target pixel can be determined based on the number of first pixels.
[0086] For example, if the number of first pixels is greater than the third threshold, pixels with depth values less than the first depth threshold can be identified as first target pixels; if the number of first pixels is not greater than the third threshold, pixels with depth values less than the second depth threshold in the target region can be identified as first target pixels.
[0087] The value of the third quantity threshold can be set according to the actual situation. For example, the third quantity threshold can be set to a value between 0 and 1 (including 0 but not including 1).
[0088] The first depth threshold can be set according to the actual situation, as long as the selected depth value is minimized.
[0089] Assume the number of first pixels is N, where N is an integer greater than or equal to 0. For example, when N > 0, the pixel with the smallest depth value can be determined from the first pixels and designated as the first target pixel. For example, when N = 0, the pixel with the smallest depth value can be determined from the target region and designated as the first target pixel.
[0090] The embodiments of this application can determine the target region with each pixel as the center point, and flexibly determine the first target pixel from the first pixel or the target region according to the number of first pixels in the target region, thereby improving the flexibility of the method while improving the image processing effect.
[0091] S820. In the case where the target region is an image block of a binary image, the first target pixel is determined from the target region based on the number of pixels contained in the target region and the number of first pixels in the target region.
[0092] For example, when dividing an image into blocks for a target region that is a binary image, the block type of the target region can be determined based on the number of pixels contained in the target region. Based on the block type and the number of first pixels in the target region, the first target pixel can be adaptively determined, which improves the accuracy of the first target pixel and thus improves the accuracy of the interpolated image.
[0093] The segmentation type can include a first segmentation type or a second segmentation type. The first segmentation type indicates that the number of pixels contained in the target region is less than a first threshold, while the second segmentation type indicates that the number of pixels contained in the target region is not less than the first threshold. That is, based on the number of pixels contained in the target region, the target region can be divided into small blocks or large blocks. The segmentation type for small blocks is the first segmentation type, and the segmentation type for large blocks is the second segmentation type.
[0094] The size of the first quantity threshold can be set according to the actual situation. In some embodiments, the first quantity threshold can be set to 17. For example, a target area containing 2*2 pixels or 4*4 pixels can be determined as a small block, and a target area containing 8*8 pixels or 16*16 pixels can be determined as a large block.
[0095] The embodiments of this application can determine the target region from both pixel-level and block-level perspectives. Then, for different perspectives, the first target pixel is adaptively determined by combining the number of first pixels contained in the target region, thereby improving the flexibility of the method.
[0096] In some embodiments, when the target region is a first block type, that is, when the target region is a small block, the first target pixel can be further determined based on the number of first pixels contained in the target region.
[0097] For example, the above S820 may include the following steps:
[0098] If the number of first pixels in the target area is greater than the fourth number threshold, the first pixel whose depth value is less than the third depth threshold is determined as the first target pixel.
[0099] If the number of first pixels in the target area is not greater than the fourth number threshold, pixels in the target area with a depth value less than the fourth depth threshold are identified as the first target pixels.
[0100] For example, the fourth quantity threshold can be set to a value between 0 and 1 (inclusive of 0 but exclusive of 1), and the third depth threshold is used to minimize the depth value of the first target pixel in the first pixel or target region.
[0101] For example, when the target area is a small block, if the number of first pixels N in the target area is greater than 0, the pixel with the smallest depth value among the first pixels can be determined as the first target pixel. If N = 0, the pixel with the smallest depth value in the target area can be determined as the first target pixel.
[0102] When the target region is divided into two blocks, i.e., the target region is a large block, the first target pixel can be further determined based on the number of first pixels contained in the target region.
[0103] For example, the above S820 may include the following steps:
[0104] If the number of first pixels in the target area is not less than the second number threshold, all first pixels in the target area are determined as first target pixels.
[0105] If the number of first pixels in the target area is less than the second threshold, the first target pixel is determined from the target area based on the depth value of each pixel in the target area.
[0106] Given that the target region contains M*M pixels, the second quantity threshold is... For example, when the target region is a large block, if the target region contains a certain number of first pixels... All first pixels within the target area can be designated as the first target pixel. If The first target pixel can be further determined based on the depth values of each pixel within the target area.
[0107] In embodiments of this application, when the target area is a large block, the first target pixel can be adaptively determined based on the number of first pixels contained in the target area, thereby improving the flexibility of the method.
[0108] In some embodiments, the above step of "determining the first target pixel from the target region based on the depth value of each pixel in the target region" can be further refined into the following steps:
[0109] Determine the difference between the maximum and minimum depth values of each pixel within the target area;
[0110] Based on the depth value, minimum depth value, maximum depth value, and difference of each pixel in the target area, determine the foreground pixels, midground pixels, and background pixels in the target area;
[0111] The pixel with the largest number among the foreground, midground, and background pixels is determined as the first target pixel.
[0112] For example, d range =d max -d min d max d represents the maximum depth value of each pixel within the target area. min d represents the minimum depth value of each pixel within the target region. range It is the difference between the maximum depth value and the minimum depth value.
[0113] For the i-th pixel within the target region, the following process can be performed, where 1 ≤ i ≤ P, and P is the number of pixels contained in the target region:
[0114] if It can be determined that the i-th pixel belongs to the foreground pixel;
[0115] if It can be determined that the i-th pixel belongs to the mid-field pixel;
[0116] if It can be determined that the i-th pixel belongs to the background pixel.
[0117] The above determination process is just one example; in practical applications, other methods can be used. This allows us to obtain the number of foreground, midground, and background pixels within the target area.
[0118] In this embodiment of the application, for example, the pixel with the largest number can be determined as the first target pixel and participate in the subsequent pixel information update calculation. For example, if the number of foreground pixels in the target area is the largest, then all foreground pixels can be determined as the first target pixel.
[0119] This application embodiment addresses the case where the target area is a large block. When the number of first pixels contained in the target area is small, the number of pixels belonging to the foreground, midground, and background can be further determined based on the depth values of each pixel within the target area. The first target pixel is then determined from the foreground, midground, and background pixels based on this number. This improves the accuracy of the first target pixel, thereby enhancing the processing effect of subsequent images.
[0120] The process of determining the second target pixel is explained below:
[0121] The method for obtaining the target region differs, and the method for determining the second target pixel also differs. Specifically, in some embodiments, before S730, the image processing method may further include the following steps:
[0122] When the target region is a region centered on any pixel in the binary image, the pixel in the motion vector image and the depth image that corresponds to the center pixel of the target region is determined as the second target pixel.
[0123] When the target region is a binary image segmented into blocks, the region corresponding to the target region is determined from the motion vector image and the depth image. All pixels in the region are equivalent to one pixel, and the equivalent pixel is determined as the second target pixel.
[0124] For example, when the target region is determined from a pixel-level perspective, that is, when the region centered on any pixel in the binary image is determined as the target region, the pixel in the motion vector image and the depth image corresponding to the center pixel of the target region can be determined as the second target pixel.
[0125] For example, when the target region is determined from a block-level perspective, that is, when the target region is divided into blocks in a binary image, multiple pixels in the region corresponding to the target region in the motion vector image and depth image can be regarded as one pixel. In other words, the number of pixels in the region corresponding to the target region is reduced from multiple to one, which can reduce the amount of subsequent calculations and reduce power consumption.
[0126] The embodiments of this application can adaptively determine the second target pixel points that need to be updated in the motion vector image and depth image according to the method of obtaining the target region, which improves the flexibility of the method. In particular, when determining the target region from the block level, it can reduce the amount of subsequent calculations and reduce the processing power consumption.
[0127] Figure 9 A flowchart illustrating another image processing method provided in this application embodiment. Figure 9 and Figure 7 The difference is that, Figure 7The S730 in the text can be further refined into Figure 9 The S910-S930 series.
[0128] S910. If the target region is an image block of a binary image and the block type of the target region is the first block type, or if the target region is a region centered on any pixel in the binary image, replace the pixel information of the second target pixel in the motion vector image and the depth image with the pixel information of the first target pixel to obtain the updated motion vector image and the updated depth image.
[0129] For example, when the target region is a region centered on any pixel in the binary image, the pixel information of the second target pixel in the motion vector image and the depth image can be directly replaced with the pixel information of the first target pixel.
[0130] Taking the pixel information including motion vectors as an example, when the target region is a region centered on any pixel in the binary image, the motion vector of the second target pixel in the motion vector image can be directly replaced with the motion vector of the first target pixel.
[0131] For example, when the number of first pixels contained in the target region is greater than 0, the motion vector of the pixel with the smallest depth value in the first region can be assigned to the second target pixel in the motion vector image, that is, assigned to the pixel in the motion vector image corresponding to the center pixel of the binary image. When the number of first pixels contained in the target region is equal to 0, the motion vector of the pixel with the smallest depth value in the target region can be assigned to the second target pixel in the motion vector image, that is, assigned to the pixel in the motion vector image corresponding to the center pixel of the binary image.
[0132] For example, when the target region is a small block, the motion vector of the second target pixel in the motion vector image can be directly replaced with the motion vector of the first target pixel.
[0133] For example, when the number of first pixels contained in the target region is greater than 0, the motion vector of the pixel with the smallest depth value among the first pixels can be assigned to the block in the motion vector image corresponding to the target region, and this block is equivalent to one pixel. When the number of first pixels contained in the target region is equal to 0, the motion vector of the pixel with the smallest depth value in the target region can be assigned to the block in the motion vector image corresponding to the target region, and this block is equivalent to one pixel.
[0134] S920. When the target region is an image block of a binary image and the block type of the target region is the second block type, determine the weight of the first target pixel in the pixel information update operation based on the number of first pixels in the target region and the depth value of each pixel in the target region.
[0135] Here, the weight of the first target pixel in the pixel information update operation is used to characterize the probability that the first target pixel is selected. The larger the weight, the greater the probability that the first target pixel is selected. When the target area is a large block, the weight of each first target pixel in the pixel information update operation can be dynamically determined according to the number of first pixels contained in the target area and the depth value of each pixel in the target area.
[0136] The number of first pixels contained in the target area varies, and the corresponding weights are determined in different ways. The specific process of determining the weights is explained below in conjunction with the number of first pixels.
[0137] In some embodiments, if the number of first pixels in the target region is not less than the second quantity threshold, the weight of the first target pixel can be determined based on the depth value of the first pixel and the depth value of the first target pixel.
[0138] For example, the minimum depth value, the maximum depth value, the first difference between the depth value and the minimum depth value of the first target pixel, and the second difference between the maximum depth value and the minimum depth value of the first pixel can be determined; the weight of the first target pixel is determined based on the ratio of the first difference and the second difference.
[0139] Using the second quantity threshold as For example, when At this time, the minimum and maximum depth values can be determined from the depth values of the first pixel within the target area, denoted as d respectively. min1 and d max1 By combining the depth value of the first target pixel, the weight of each first target pixel can be obtained.
[0140] For example, Where, p i d represents the weight of the i-th first target pixel, that is, the weight of the i-th first pixel within the target region. i Let be the depth value of the i-th first target pixel, that is, the depth value of the i-th first pixel within the target area.
[0141] In some embodiments, if the number of first pixels in the target area is less than a second quantity threshold, the weight of the first target pixel can be determined based on the depth values of all pixels in the target area and the depth value of the first target pixel.
[0142] For example, the minimum depth value, maximum depth value, third difference between the depth value of the first target pixel and the minimum depth value, and fourth difference between the maximum depth value and the minimum depth value of all pixels in the target area can be determined; the weight of the first target pixel can be determined based on the ratio of the third difference and the fourth difference.
[0143] For example, when At this point, the minimum and maximum depth values can be determined from the depth values of all pixels within the target area, denoted as d. min2 and d max2 Therefore, the fourth difference d between the minimum depth value and the maximum depth value can be obtained. range =d max2 -d min2 Then, by combining the depth value of the first target pixel, the weight of each first target pixel can be obtained.
[0144] For example, Where, p j d represents the weight of the j-th first target pixel. j d represents the depth value of the j-th first target pixel. Here, the first target pixel is the most numerous foreground, midground, or background pixel within the target region. The sum of the number of foreground, midground, and background pixels equals the total number of pixels contained within the target region. j -d min2 This is the third difference.
[0145] When the target area is a large block, this application embodiment can further adaptively determine the weight of each first target pixel participating in the subsequent update operation based on the number of first pixels in the target area and the depth value of each pixel in the target area, providing a more accurate basis for the update operation of subsequent pixels.
[0146] S930. Based on the weight and pixel information of the first target pixel, update the pixel information of the second target pixel in the motion vector image and the depth image to obtain the updated motion vector image and the updated depth image.
[0147] Once the weights of each first target pixel are determined, the pixel information of the second target pixel in the motion vector image and depth image can be re-determined based on the weights and pixel information of each first target pixel. The re-determined pixel information is then used to replace the original pixel information, thus updating the pixel information.
[0148] The embodiments of this application can adaptively determine the pixel information of corresponding pixels in the motion vector image and depth image according to the method of determining the target area and the number of first pixels contained in the target area, thereby reducing image fragmentation and improving image quality.
[0149] In some embodiments, S930 may include the following steps:
[0150] Determine the weight of the first target pixel and the weighted sum of the corresponding pixel information, as well as the weighted sum of the first target pixels;
[0151] The ratio of the weighted sum to the weighted sum is used to determine the pixel information of the second target pixel in the motion vector image and the depth image.
[0152] For example, when hour, Where mv represents the motion vector of the second target pixel in the motion vector image, d represents the depth value of the second target pixel in the depth image, and mv and d are block-level pixel information. i and d i These are the motion vector and depth value of the i-th first target pixel, respectively.
[0153] For example, when hour, Where, N f This represents the number of pixels contained in the foreground, midground, or background with the most pixels within the target area, MV. j and d j These are the motion vector and depth value of the j-th first target pixel, respectively.
[0154] This application embodiment determines the pixel information of the second target pixel in the motion vector image and depth image based on the weight and pixel information of each first target pixel, taking into account the influence of each first target pixel, thereby more accurately determining the pixel information of the corresponding pixel in the motion vector image and depth image, reducing image fragmentation and improving image quality.
[0155] The image processing method provided in the embodiments of this application will be described below with reference to several effect diagrams.
[0156] Figure 10 This is the original motion vector image, that is, the unprocessed motion vector image. Figure 11 This is a schematic diagram comparing the effects of pixel-level processing in this application with those of related technologies, where 110 is the motion vector image obtained after processing in the embodiment of this application, and 111 is the motion vector image obtained after processing by related technologies.
[0157] Figure 12The images show a comparison of the effects after median filtering, where 120 is the motion vector image obtained after pixel-level processing and filtering in the embodiment of this application, and 111 is the motion vector image obtained after processing and filtering using related techniques.
[0158] Figure 13 This is a schematic diagram comparing the effects of block-level processing in this application with those of related technologies. 130 is the motion vector image obtained after processing in the embodiment of this application, and 131 is the motion vector image obtained after processing by related technologies. Figure 13 Take a small piece as an example.
[0159] Figure 14 The images show a comparison of the effects of median filtering, where 140 is the motion vector image obtained after processing and filtering from a block-level perspective in the embodiment of this application, and 141 is the motion vector image obtained after processing and filtering using related techniques.
[0160] In the above schematic diagram, the yellow ellipse represents the area with obvious contrast. As can be seen from the above effect diagram, the image processing method provided by the embodiment of this application can effectively improve the phenomena such as hollowness and fragmentation of motion vectors in the figure from both pixel-level and block-level perspectives, resulting in better image quality.
[0161] It should be noted that the image processing method provided in this application embodiment can be executed by an image processing device or a processing module within that image processing device for executing the image processing method. This application embodiment uses an image processing device executing the image processing method as an example to illustrate the image processing device provided in this application embodiment.
[0162] Figure 15 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application.
[0163] like Figure 15 As shown, the image processing apparatus 1500 may include:
[0164] The acquisition module 1501 is used to acquire the binary image of the first image frame, the motion vector image of the first image frame relative to the second image frame, and the depth image of the first image frame. The second image frame is the previous frame image of the first image frame. The pixels of the motion vector image, the binary image, and the depth image correspond one-to-one.
[0165] The processing module 1502 is used to process the motion vector image and the depth image based on the binary image to obtain the updated motion vector image and the updated depth image.
[0166] The generation module 1503 is used to generate an interpolated frame between the first image frame and the second image frame based on the updated motion vector image and the updated depth image, as well as the first image frame and the second image frame.
[0167] This embodiment of the application acquires a binary image of a first image frame, a motion vector image of the first image frame relative to a second image frame, and a depth image of the first image frame, wherein the second image frame is the previous frame of the first image frame. The motion vector image and depth image are processed based on the binary image to obtain updated motion vector images and updated depth images. Based on the updated motion vector images and updated depth images, as well as the first and second image frames, an interpolated image is generated between the first and second image frames. That is, this embodiment of the application updates the motion vectors in the motion vector image and the depth values in the depth image from a pixel perspective, combining the binary image, reducing the fragmentation of the interpolated image and improving the quality of the interpolated image.
[0168] In some possible implementations of the embodiments of this application, the processing module 1502 is specifically used for:
[0169] The target region is determined from the binary image. The target region is the region centered on any pixel in the binary image, or the target region is an image block in the binary image. The image block is obtained by dividing the binary image into blocks, and each image block corresponds to a pixel.
[0170] Based on the number of first pixels in the target region, the first target pixel is determined from the target region. The first pixel is the pixel corresponding to the target object in the first image frame.
[0171] Based on the pixel information of the first target pixel, update the pixel information of the second target pixel in the motion vector image and the depth image to obtain the updated motion vector image and the updated depth image. The second target pixel is the pixel corresponding to the first target pixel.
[0172] In some possible implementations of the embodiments of this application, the processing module 1502 is specifically used for:
[0173] When the target region is a region centered on any pixel in the binary image, the first target pixel is determined from the target region based on the number of first pixels.
[0174] In the case where the target region is a binary image segment, the first target pixel is determined from the target region based on the number of pixels contained in the target region and the number of first pixels in the target region.
[0175] In some possible implementations of the embodiments of this application, the processing module 1502 is specifically used for:
[0176] Based on the number of pixels contained in the target region, the block type of the target region is determined. The block type includes a first block type or a second block type. The first block type is used to indicate that the number of pixels contained in the target region is less than a first number threshold, and the second block type is used to indicate that the number of pixels contained in the target region is not less than the first number threshold.
[0177] The first target pixel is determined from the target region based on the block type and the number of first pixels in the target region.
[0178] In some possible implementations of the embodiments of this application, the block type is a second block type;
[0179] Processing module 1502 is specifically used for:
[0180] If the number of first pixels in the target area is not less than the second number threshold, all first pixels in the target area are determined as first target pixels.
[0181] If the number of first pixels in the target area is less than the second threshold, the first target pixel is determined from the target area based on the depth value of each pixel in the target area.
[0182] In some possible implementations of the embodiments of this application, the processing module 1502 is specifically used for:
[0183] Determine the difference between the maximum and minimum depth values of each pixel within the target area;
[0184] Based on the depth value, minimum depth value, maximum depth value and difference of each pixel in the target area, determine the foreground pixel, midground pixel and background pixel in the target area;
[0185] The pixel with the largest number among the foreground, midground, and background pixels is determined as the first target pixel.
[0186] In some possible implementations of the embodiments of this application, the processing module 1502 is specifically used for:
[0187] If the target region is a binary image block and the block type of the target region is the first block type, or if the target region is a region centered on any pixel in the binary image, the pixel information of the second target pixel in the motion vector image and the depth image is replaced with the pixel information of the first target pixel to obtain the updated motion vector image and the updated depth image.
[0188] When the target region is a binary image block and the block type of the target region is the second block type, the weight of the first target pixel participating in the pixel information update operation is determined according to the number of first pixels in the target region and the depth value of each pixel in the target region. Then, according to the weight of the first target pixel and the pixel information, the pixel information of the second target pixel in the motion vector image and the depth image is updated to obtain the updated motion vector image and the updated depth image.
[0189] In some possible implementations of the embodiments of this application, the processing module 1502 is specifically used for:
[0190] If the number of first pixels in the target area is not less than the second number threshold, the weight of the first target pixel is determined based on the depth value of the first pixel and the depth value of the first target pixel.
[0191] If the number of first pixels in the target area is less than the second threshold, the weight of the first target pixel is determined based on the depth values of all pixels in the target area and the depth value of the first target pixel.
[0192] The image processing device in this application embodiment can be a device or a component in an electronic device, such as an integrated circuit or a chip. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0193] The electronic device in this application embodiment can be a terminal with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0194] The image processing apparatus provided in this application embodiment can achieve... Figures 1 to 9The various processes in the image processing method embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0195] like Figure 16 As shown, this application embodiment also provides an electronic device 1600, including a processor 1601 and a memory 1602. The memory 1602 stores programs or instructions that can run on the processor 1601. When the program or instructions are executed by the processor 1601, they implement the various steps of the above-described image processing method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0196] It should be noted that the electronic devices in the embodiments of this application include the mobile terminals and non-mobile terminals mentioned above.
[0197] Figure 17 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0198] The electronic device 1700 includes, but is not limited to, components such as: radio frequency unit 1701, network module 1702, audio output unit 1703, input unit 1704, sensor 1705, display unit 1706, user input unit 1707, interface unit 1708, memory 1709, and processor 1710.
[0199] Those skilled in the art will understand that the electronic device 1700 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 17 The structure of the electronic device 1700 shown does not constitute a limitation on the electronic device 1700. The electronic device 1700 may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be described in detail here.
[0200] The processor 1710 is used to acquire a binary image of a first image frame, a motion vector image of the first image frame relative to a second image frame, and a depth image of the first image frame. The second image frame is the previous frame of the first image frame. The pixels of the motion vector image, the binary image, and the depth image correspond one-to-one.
[0201] The motion vector image and depth image are processed based on the binary image to obtain the updated motion vector image and the updated depth image;
[0202] Based on the updated motion vector image and the updated depth image, as well as the first image frame and the second image frame, an interpolated image is generated between the first image frame and the second image frame.
[0203] This application embodiment updates the motion vector in the motion vector image and the depth value in the depth image from the perspective of pixels, combining binary images, thereby reducing the fragmentation of the interpolated image and improving the quality of the interpolated image.
[0204] In some possible implementations of embodiments of this application, the processor 1710 is specifically used for:
[0205] The target region is determined from the binary image. The target region is the region centered on any pixel in the binary image, or the target region is an image block in the binary image. The image block is obtained by dividing the binary image into blocks, and each image block corresponds to a pixel.
[0206] Based on the number of first pixels in the target region, the first target pixel is determined from the target region. The first pixel is the pixel corresponding to the target object in the first image frame.
[0207] Based on the pixel information of the first target pixel, update the pixel information of the second target pixel in the motion vector image and the depth image to obtain the updated motion vector image and the updated depth image. The second target pixel is the pixel corresponding to the first target pixel.
[0208] In some possible implementations of embodiments of this application, the processor 1710 is specifically used for:
[0209] When the target region is a region centered on any pixel in the binary image, the first target pixel is determined from the target region based on the number of first pixels.
[0210] In the case where the target region is a binary image segment, the first target pixel is determined from the target region based on the number of pixels contained in the target region and the number of first pixels in the target region.
[0211] In some possible implementations of embodiments of this application, the processor 1710 is specifically used for:
[0212] Based on the number of pixels contained in the target region, the block type of the target region is determined. The block type includes a first block type or a second block type. The first block type is used to indicate that the number of pixels contained in the target region is less than a first number threshold, and the second block type is used to indicate that the number of pixels contained in the target region is not less than the first number threshold.
[0213] The first target pixel is determined from the target region based on the block type and the number of first pixels in the target region.
[0214] In some possible implementations of the embodiments of this application, the block type is a second block type;
[0215] Processor 1710, specifically used for:
[0216] If the number of first pixels in the target area is not less than the second number threshold, all first pixels in the target area are determined as first target pixels.
[0217] If the number of first pixels in the target area is less than the second threshold, the first target pixel is determined from the target area based on the depth value of each pixel in the target area.
[0218] In some possible implementations of embodiments of this application, the processor 1710 is specifically used for:
[0219] Determine the difference between the maximum and minimum depth values of each pixel within the target area;
[0220] Based on the depth value, minimum depth value, maximum depth value, and difference of each pixel in the target area, determine the foreground pixels, midground pixels, and background pixels in the target area;
[0221] The pixel with the largest number among the foreground, midground, and background pixels is determined as the first target pixel.
[0222] In some possible implementations of embodiments of this application, the processor 1710 is specifically used for:
[0223] If the target region is a binary image block and the block type of the target region is the first block type, or if the target region is a region centered on any pixel in the binary image, the pixel information of the second target pixel in the motion vector image and the depth image is replaced with the pixel information of the first target pixel to obtain the updated motion vector image and the updated depth image.
[0224] When the target region is a binary image block and the block type of the target region is the second block type, the weight of the first target pixel participating in the pixel information update operation is determined according to the number of first pixels in the target region and the depth value of each pixel in the target region. Then, according to the weight of the first target pixel and the pixel information, the pixel information of the second target pixel in the motion vector image and the depth image is updated to obtain the updated motion vector image and the updated depth image.
[0225] In some possible implementations of embodiments of this application, the processor 1710 is specifically used for:
[0226] If the number of first pixels in the target area is not less than the second number threshold, the weight of the first target pixel is determined based on the depth value of the first pixel and the depth value of the first target pixel.
[0227] If the number of first pixels in the target area is less than the second threshold, the weight of the first target pixel is determined based on the depth values of all pixels in the target area and the depth value of the first target pixel.
[0228] It should be understood that, in this embodiment, the input unit 1704 may include a graphics processing unit (GPU) 17041 and a microphone 17042. The GPU 17041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 706 may include a display panel 17061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1707 includes a touch panel 17071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 17071 may include a touch detection device and a touch controller. Other input devices 17072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0229] The memory 1709 can be used to store software programs and various data. The memory 1709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1709 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1709 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0230] Processor 1710 may include one or more processing units; optionally, processor 1710 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1710.
[0231] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image processing method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0232] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0233] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described image processing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0234] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0235] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described image processing method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0236] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0237] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0238] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An image processing method, characterized in that, include: Obtain the binary image of the first image frame, the motion vector image of the first image frame relative to the second image frame, and the depth image of the first image frame, wherein the second image frame is the previous frame image of the first image frame, and the pixels of the motion vector image, the binary image, and the depth image correspond one-to-one. The target region is determined from the binary image. The target region is a region centered on any pixel in the binary image, or the target region is an image block in the binary image. The image block is obtained by dividing the binary image into blocks, and each image block corresponds to a pixel. Based on the number of first pixels in the target region, a first target pixel is determined from the target region, wherein the first pixel is the pixel corresponding to the target object in the first image frame; When the target region is an image block of the binary image and the block type of the target region is the second block type, the weight of the first target pixel participating in the pixel information update operation is determined according to the number of the first pixel in the target region and the depth value of each pixel in the target region. Then, the pixel information of the second target pixel in the motion vector image and the depth image is updated according to the weight of the first target pixel and the pixel information, so as to obtain the updated motion vector image and the updated depth image. The second block type is used to characterize that the number of pixels contained in the target region is not less than a first number threshold; The second target pixel is the pixel in the depth image that corresponds to the first target pixel; Based on the updated motion vector image and the updated depth image, as well as the first image frame and the second image frame, an interpolated image is generated between the first image frame and the second image frame.
2. The method according to claim 1, characterized in that, Determining the first target pixel from the target region based on the number of first pixels in the target region includes: When the target region is a region centered on any pixel in the binary image, a first target pixel is determined from the target region based on the number of the first pixels. When the target region is an image block of the binary image, a first target pixel is determined from the target region based on the number of pixels contained in the target region and the number of first pixels in the target region.
3. The method according to claim 2, characterized in that, Determining the first target pixel from the target region based on the number of pixels contained in the target region and the number of first pixels in the target region includes: Based on the number of pixels contained in the target region, the block type of the target region is determined. The block type includes a first block type or a second block type. The first block type is used to characterize that the number of pixels contained in the target region is less than a first number threshold. Based on the block type and the number of first pixels in the target region, a first target pixel is determined from the target region.
4. The method according to claim 3, characterized in that, The block type is the second block type; The step of determining the first target pixel from the target region based on the block type and the number of first pixels in the target region includes: If the number of first pixels in the target area is not less than the second number threshold, all first pixels in the target area are determined as the first target pixels. If the number of first pixels in the target area is less than the second number threshold, the first target pixel is determined from the target area based on the depth value of each pixel in the target area.
5. The method according to claim 4, characterized in that, Determining the first target pixel from the target region based on the depth values of each pixel within the target region includes: Determine the difference between the maximum and minimum depth values of each pixel within the target area; Based on the depth values of each pixel within the target area, the minimum depth value, the maximum depth value, and the difference, foreground pixels, mid-ground pixels, and background pixels are determined from the target area. The pixel with the largest number among the foreground pixels, the midground pixels, and the background pixels is determined as the first target pixel.
6. The method according to claim 1, characterized in that, The method further includes: If the target region is an image block of the binary image and the block type of the target region is the first block type, or if the target region is a region centered on any pixel in the binary image, the pixel information of the second target pixel in the motion vector image and the depth image is replaced with the pixel information of the first target pixel to obtain an updated motion vector image and an updated depth image.
7. The method according to claim 1, characterized in that, The step of determining the weight of the first target pixel in the pixel information update operation based on the number of first pixels in the target region and the depth value of each pixel in the target region includes: If the number of first pixels in the target region is not less than the second number threshold, the weight of the first target pixel is determined based on the depth value of the first pixel and the depth value of the first target pixel. If the number of first pixels in the target area is less than the second number threshold, the weight of the first target pixel is determined based on the depth values of all pixels in the target area and the depth value of the first target pixel.
8. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire a binary image of a first image frame, a motion vector image of the first image frame relative to a second image frame, and a depth image of the first image frame, wherein the second image frame is the previous frame of the first image frame, and the pixels of the motion vector image, the binary image, and the depth image correspond one-to-one. The processing module is configured to determine a target region from the binary image, wherein the target region is a region centered on any pixel in the binary image, or the target region is an image block in the binary image, wherein the image block is obtained by dividing the binary image into blocks, and each image block corresponds to one pixel; determine a first target pixel from the target region based on the number of first pixels in the target region, wherein the first pixel is the pixel corresponding to the target object in the first image frame; when the target region is an image block of the binary image and the block type of the target region is a second block type, determine the weight of the first target pixel in the pixel information update operation based on the number of first pixels in the target region and the depth value of each pixel in the target region, and update the pixel information of the second target pixel in the motion vector image and the depth image based on the weight of the first target pixel and the pixel information, thereby obtaining the updated motion vector image and the updated depth image; The second block type is used to characterize that the number of pixels contained in the target region is not less than a first number threshold; The second target pixel is the pixel in the depth image that corresponds to the first target pixel; The generation module is configured to generate an interpolated frame between the first image frame and the second image frame based on the updated motion vector image and the updated depth image, as well as the first image frame and the second image frame.
9. The apparatus according to claim 8, characterized in that, The processing module is specifically used for: When the target region is a region centered on any pixel in the binary image, a first target pixel is determined from the target region based on the number of the first pixels. When the target region is an image block of the binary image, a first target pixel is determined from the target region based on the number of pixels contained in the target region and the number of first pixels in the target region.
10. The apparatus according to claim 9, characterized in that, The processing module is specifically used for: Based on the number of pixels contained in the target region, the block type of the target region is determined. The block type includes a first block type or a second block type. The first block type is used to characterize that the number of pixels contained in the target region is less than a first number threshold. Based on the block type and the number of first pixels in the target region, a first target pixel is determined from the target region.
11. The apparatus according to claim 8, characterized in that, The processing module is specifically used for: If the target region is an image block of the binary image and the block type of the target region is the first block type, or if the target region is a region centered on any pixel in the binary image, the pixel information of the second target pixel in the motion vector image and the depth image is replaced with the pixel information of the first target pixel to obtain an updated motion vector image and an updated depth image.
12. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 7.
13. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Depth video processing method and device, storage medium and electronic equipment
CN111741303A
Video frame insertion method and device, electronic equipment and storage medium
CN118055293A
