US 12,094,077 B2
Method and apparatus for processing image, electronic device, and storage medium
Ping Ji, Shanghai (CN); Tao Ji, Shanghai (CN); Chun Wang, Shanghai (CN); Dongjian Wang, Shanghai (CN); and Xuyun Chen, Shanghai (CN)
Assigned to AMLOGIC (SHANGHAI) CO., LTD., Shanghai (CN)
Filed by AMLOGIC (SHANGHAI) CO., LTD., Shanghai (CN)
Filed on Jul. 16, 2021, as Appl. No. 17/305,873.
Claims priority of application No. 202010705370.0 (CN), filed on Jul. 21, 2020.
Prior Publication US 2022/0028035 A1, Jan. 27, 2022
Int. Cl. H04N 19/182 (2014.01); G06T 3/4007 (2024.01); H04N 19/132 (2014.01); H04N 19/46 (2014.01); H04N 19/513 (2014.01)
CPC G06T 3/4007 (2013.01) [H04N 19/132 (2014.11); H04N 19/182 (2014.11); H04N 19/46 (2014.11); H04N 19/513 (2014.11)] 17 Claims
OG exemplary drawing
 
1. A method for processing an image, comprising:
obtaining, based on a motion vector of a corresponding position of a pixel to be interpolated in a previous image and a motion vector of a corresponding position of the pixel to be interpolated in a current image, a first aim-to-mask flag of the pixel to be interpolated, the mask being an object that is static for a duration in a video stream, the first aim-to-mask flag of the pixel to be interpolated indicating that the motion vector of the corresponding position of the pixel to be interpolated in the previous image aims to a background image or a mask, and indicating that the motion vector of the corresponding position of the pixel to be interpolated in the current image aims to a background image or a mask;
obtaining second aim-to-mask flags of pixels in a preset neighborhood of the pixel to be interpolated, the second aim-to-mask flag of the pixel in the preset neighborhood indicating that the motion vector of the corresponding position of the pixel in the previous image aims to a background image or a mask, and indicating that the motion vector of the corresponding position of the pixel in the current image aims to a background image or a mask;
determining flag categories and a number of pixels of each of the flag categories, in the first aim-to-mask flag and the second aim-to-mask flags, the flag category being defined based on directivity of a motion vector of a corresponding position of a corresponding pixel in a previous image and directivity of a motion vector of a corresponding position of the corresponding pixel in a current image, combinations of directivity of the motion vector of the corresponding position of the corresponding pixel in the previous image and directivity of the motion vector of the corresponding position of the corresponding pixel in the current image are different among different flag categories;
obtaining a third aim-to-mask flag of the pixel to be interpolated based on the flag categories and the number of pixels of to each of the flag categories, comprising:
removing an aim-to-mask flag aiming to a mask from the flag categories;
determining a flag category with a largest number among the flag categories;
using the flag category with the largest number as a third aim-to-mask flag of the pixel to be interpolated; and
updating the first aim-to-mask flag of the pixel to be interpolated to the third aim-to-mask flag;
obtaining interpolation data of the pixel to be interpolated based on the third aim-to-mask flag of the pixel to be interpolated; and
performing motion compensation on the pixel to be interpolated based on the interpolation data.