| CPC G06T 5/70 (2024.01) [G06T 3/4007 (2013.01); G06T 3/403 (2013.01); G06T 7/13 (2017.01); G06T 2207/20192 (2013.01)] | 20 Claims |

|
1. An image processing method applied to an electrical device, the electronic device includes a processor and a memory, the method comprising:
determining, by the processor, according to position coordinates, in a target image, of any interpolation pixel to be processed of the target image, position coordinates of the interpolation pixel in an original image; the target image being an image after the original image is performed a resolution enhancement, and the interpolation pixel being a pixel generated during the resolution enhancement;
calculating, by the processor, a two-dimensional image entropy of an (n×n) neighborhood of the interpolation pixel in the original image according to the position coordinates of the interpolation pixel in the original image, n being greater than or equal to 2 (n≥2) and n being a positive integer;
in a case where the two-dimensional image entropy is greater than or equal to a preset entropy threshold value, calculating, by the processor, a pixel value of the interpolation pixel through a first interpolation algorithm based on all original pixels within the (n×n) neighborhood;
in a case where the two-dimensional image entropy is less than the preset entropy threshold value, calculating, by the processor, gradient values in at least two edge directions within the (n×n) neighborhood, and determining, by the processor, whether there is a strong-edge direction in the at least two edge directions according to the gradient values in the at least two edge directions;
if there is the strong-edge direction, calculating, by the processor, the pixel value of the interpolation pixel through the first interpolation algorithm based on a plurality of original pixels in the strong-edge direction within the (n×n) neighborhood; and
if there is no strong-edge direction, calculating, by the processor, the pixel value of the interpolation pixel through a second interpolation algorithm based on all the original pixels within the (n×n) neighborhood;
mapping, by the processor, the position coordinates of the interpolation pixel in the target image into the original image through a mapping formulas, so as to achieve the resolution enhancement for the original image in any scale.
|