Image interpolation method and device, electronic device, computer readable medium

CN118898565BActive Publication Date: 2026-10-16SANECHIPS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310477890.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-27
Publication Date
2026-10-16
Estimated Expiration
2043-04-27

AI Technical Summary

Technical Problem

[0002]目前数字图像处理领域的图像插值方法主要有传统插值方法和深度学习算法插值方法2种,传统插值方法如双线性(Bilinear)插值方法,双三次(Bicubic)插值方法,兰索斯法(Lanczos)插值方法等实现原理简单,易于硬件实现,但这些方法无法较好地生成图像边缘纹理细节,插值后的图像边缘存在较多锯齿,因此主观质量不高;深度学习算法插值方法能很好的保留图像纹理细节,主观质量明显好于传统插值方法,但深度学习算法模型复杂,参数众多,算法的部署对硬件资源有较高的要求,且其效果受训练数据集和图像本身内容影响较大

Benefits of technology

[0008] The image interpolation method provided in this application embodiment interpolates based on the direction value and direction reliability of the first pixel corresponding to the pixel to be interpolated in the original image. Compared with traditional interpolation methods, the image interpolation method in this application embodiment recovers the edge detail information of the image better, and the interpolated image has fewer jagged edges and higher subjective quality. Compared with deep learning algorithms, the image interpolation method in this application embodiment has a simpler mathematical model, is easier to deploy on the terminal, and has better generalization effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898565B_ABST
    Figure CN118898565B_ABST
Patent Text Reader

Abstract

The application provides an image interpolation method and device, electronic equipment and computer readable medium. The image interpolation method comprises the following steps: converting a first coordinate of a pixel point to be interpolated in a target image coordinate system into a second coordinate in an original image coordinate system; determining a direction value and a direction reliability of a first pixel point corresponding to the second coordinate in the original image; and determining a final pixel value of the pixel point to be interpolated according to the direction value and the direction reliability of the first pixel point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to image interpolation methods and apparatus, electronic devices, and computer-readable media. Background Technology

[0002] Currently, image interpolation methods in the field of digital image processing mainly fall into two categories: traditional interpolation methods and deep learning algorithm interpolation methods. Traditional interpolation methods, such as bilinear interpolation, bicubic interpolation, and Lanczos interpolation, are simple in principle and easy to implement in hardware. However, these methods cannot generate image edge texture details well, and the interpolated image edges have many jagged edges, resulting in low subjective quality. Deep learning algorithm interpolation methods can preserve image texture details very well, and the subjective quality is significantly better than traditional interpolation methods. However, deep learning algorithm models are complex with many parameters, and the deployment of the algorithm has high requirements for hardware resources. Moreover, its performance is greatly affected by the training dataset and the content of the image itself. Summary of the Invention

[0003] This application provides an image interpolation method and apparatus, an electronic device, and a computer-readable medium.

[0004] In a first aspect, embodiments of this application provide an image interpolation method, comprising: converting a first coordinate of a pixel to be interpolated in a target image coordinate system into a second coordinate in an original image coordinate system; determining the orientation value and orientation reliability of a first pixel corresponding to the second coordinate in the original image; and determining the final pixel value of the pixel to be interpolated based on the orientation value and orientation reliability of the first pixel.

[0005] Secondly, embodiments of this application provide an image interpolation apparatus, comprising: a coordinate transformation module for converting a first coordinate of a pixel to be interpolated in a target image coordinate system into a second coordinate in an original image coordinate system; a direction calculation module for determining the direction value and direction reliability of a first pixel corresponding to the second coordinate in the original image; and an interpolation module for determining the final pixel value of the pixel to be interpolated based on the direction value and direction reliability of the first pixel.

[0006] Thirdly, embodiments of this application provide an electronic device, including: at least one processor; and a memory storing at least one program, which, when executed by the at least one processor, implements any of the above-described image interpolation methods.

[0007] Fourthly, embodiments of this application provide a computer-readable medium storing a computer program, which, when executed by a processor, implements any of the above-described image interpolation methods.

[0008] The image interpolation method provided in this application embodiment interpolates based on the direction value and direction reliability of the first pixel corresponding to the pixel to be interpolated in the original image. Compared with traditional interpolation methods, the image interpolation method in this application embodiment recovers the edge detail information of the image better, and the interpolated image has fewer jagged edges and higher subjective quality. Compared with deep learning algorithms, the image interpolation method in this application embodiment has a simpler mathematical model, is easier to deploy on the terminal, and has better generalization effect. Attached Figure Description

[0009] Figure 1 A flowchart of an image interpolation method provided in one embodiment of this application;

[0010] Figure 2 This is a schematic diagram of 16 sub-directions when the slope is positive in the embodiments of this application;

[0011] Figure 3 This is a schematic diagram showing the positional relationship of the first straight line L2, the second straight line L1, the third straight line L3, and the perpendicular line L4 in the target coordinate system in the embodiments of this application.

[0012] Figure 4 A block diagram of an image interpolation apparatus provided in another embodiment of this application;

[0013] Figure 5 A block diagram of an electronic device provided in another embodiment of this application. Detailed Implementation

[0014] To enable those skilled in the art to better understand the technical solutions of this application, the image interpolation method and apparatus, electronic equipment, and computer-readable medium provided in this application will be described in detail below with reference to the accompanying drawings.

[0015] Exemplary embodiments will be described more fully below with reference to the accompanying drawings; however, these exemplary embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will enable those skilled in the art to fully understand the scope of this application.

[0016] Where there is no conflict, the various embodiments of this application and the features thereof may be combined with each other.

[0017] As used herein, the term “and / or” includes any and all combinations of at least one related enumerated entry.

[0018] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used herein, the singular forms “a” 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 stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of at least one other feature, integral, step, operation, element, component, and / or group thereof is not excluded.

[0019] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one 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 this application, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.

[0020] Figure 1 A flowchart of an image interpolation method provided in one embodiment of this application.

[0021] Firstly, referring to Figure 1 One embodiment of this application provides an image interpolation method, including:

[0022] Step 100: Convert the first coordinate of the pixel to be interpolated in the target image coordinate system to the second coordinate in the original image coordinate system.

[0023] In some exemplary embodiments, the original image refers to the image that needs to be interpolated, and the target image refers to the image obtained by interpolating the original image.

[0024] In some exemplary embodiments, if the resolution of the original image is src_width × src_height, the resolution of the target image is dst_width × dst_height, the first coordinate of the pixel to be interpolated in the target image coordinate system is (x, y), and the second coordinate of the pixel to be interpolated in the original image coordinate system is (x0, y0), then x0 and x satisfy the following condition: The relationship between y0 and y satisfies

[0025] Step 101: Determine the direction value and direction reliability of the first pixel point corresponding to the second coordinate in the original image.

[0026] In some exemplary embodiments, determining the orientation value and orientation reliability of the first pixel corresponding to the second coordinate in the original image includes: calculating the orientation value and orientation reliability of each second pixel in the original image respectively; and determining the orientation value and orientation reliability of the first pixel based on the orientation value and orientation reliability of each second pixel in the original image.

[0027] In some exemplary embodiments, calculating the orientation value and orientation reliability of each second pixel in the original image includes: calculating the gradient in the x-direction and the gradient in the y-direction of each third pixel in the original image; and for each second pixel in the original image, calculating the orientation value and orientation reliability of the second pixel based on the gradients in the x-direction and the gradients in the y-direction of all third pixels in the first pixel matrix centered on the second pixel in the original image.

[0028] In some exemplary embodiments, determining the orientation value and orientation reliability of the first pixel point corresponding to the second coordinate in the original image includes: calculating the gradient in the x-direction and the gradient in the y-direction of each third pixel point in the second pixel matrix centered on the first pixel point; and calculating the orientation value and orientation reliability of the first pixel point based on the gradients in the x-direction and the gradients in the y-direction of all third pixel points in the second pixel matrix.

[0029] In some exemplary embodiments, determining the direction value and direction reliability of the first pixel corresponding to the second coordinate in the original image includes: when the second coordinate is an integer, calculating the gradient in the x-direction and the gradient in the y-direction of each third pixel in the second pixel matrix centered on the first pixel; calculating the direction value and direction reliability of the first pixel based on the gradients in the x-direction and the y-direction of all third pixels in the second pixel matrix. When the second coordinate is not an integer, converting the second coordinate to an integer coordinate; calculating the gradient in the x-direction and the gradient in the y-direction of each third pixel in the second pixel matrix centered on the pixel corresponding to the integer coordinate; calculating the direction value and direction reliability of the pixel corresponding to the integer coordinate based on the gradients in the x-direction and the y-direction of all third pixels in the second pixel matrix; and using the direction value and direction reliability of the pixel corresponding to the integer coordinate as the direction value and direction reliability of the first pixel.

[0030] In some exemplary embodiments, calculating the gradient of the third pixel in the x-direction and the gradient in the y-direction includes: multiplying the pixel values ​​of all eighth pixels in the third pixel matrix centered on the third pixel in the original image by the gradient operator in the x-direction and then summing the results to obtain the gradient of the third pixel in the x-direction. M represents the gradient of the i-th third pixel in the x-direction. ijLet oper_x be the pixel value of the j-th eighth pixel in the third pixel matrix centered at the i-th third pixel. j Let be the j-th element value of the gradient operator in the x-direction; the gradient of the third pixel in the y-direction is obtained by multiplying the pixel values ​​of all eighth pixels in the third pixel matrix centered at the third pixel in the original image with the gradient operator in the y-direction, and then summing the results. M is the gradient of the i-th third pixel in the y-direction. ij Let oper_y be the pixel value of the j-th eighth pixel in the third pixel matrix centered at the i-th third pixel. j Let be the j-th element value of the gradient operator in the y-direction.

[0031] In some exemplary embodiments, the size of any one of the first pixel matrix, the second pixel matrix, and the third pixel matrix is ​​B×B, where B is 2b+1 and b is an integer greater than or equal to 1, such as B being 3, 5, 7, 9, etc.

[0032] The sizes of the first pixel matrix, the second pixel matrix, and the third pixel matrix can be the same or different.

[0033] In some exemplary embodiments, the gradient operator can be the Sobel operator, the prewiit operator, the Scharr operator, etc. For example, when B is 3, the Sobel operator in the x-direction is... The Sobel operator in the y-direction is

[0034] In some exemplary embodiments, when calculating the gradient of the third pixel in the x-direction and the gradient in the y-direction, if the third pixel is an edge pixel in the original image, the original image needs to be padded with edge pixel values.

[0035] In some exemplary embodiments, calculating the orientation value and orientation reliability of the second pixel point based on the gradients in the x-direction and y-direction of all third pixels in the first pixel matrix centered on the second pixel point in the original image includes: according to the formula Calculate the angle corresponding to the direction value of the second pixel.

[0036] According to the formula Calculate the directional reliability of the second pixel.

[0037] The direction value of the second pixel can be obtained by discretizing θ. Specifically, the direction value of a pixel can be set to 4, 8, 16, 32, etc. The following example illustrates the calculation of the direction value using 32 direction values.

[0038] make Therefore, a, b, and c satisfy different conditions and correspond to different direction values, as shown in Table 1.

[0039] In some exemplary embodiments, if the directional reliability of the second pixel is less than 0 or greater than 1, the directional reliability of the second pixel is truncated to between 0 and 1. That is, if the directional reliability of the second pixel is less than 0, the directional reliability of the second pixel is modified to 0; if the directional reliability of the second pixel is greater than 1, the directional reliability of the second pixel is modified to 1.

[0040] In some exemplary embodiments, calculating the orientation value and orientation reliability of the pixel corresponding to the integer coordinate based on the gradients of all third pixel points in the second pixel matrix in the x-direction and the y-direction includes: according to the formula Calculate the angle corresponding to the direction value of the pixel at the integer coordinates.

[0041] According to the formula Calculate the directional reliability of the pixel points corresponding to integer coordinates.

[0042] By discretizing θ, the direction value of the pixel corresponding to the integer coordinates can be obtained. Specifically, the direction value of a pixel can be set to 4, 8, 16, 32, etc. The following example illustrates the calculation of the direction value using 32 direction values.

[0043] make Therefore, a, b, and c satisfy different conditions and correspond to different direction values, as shown in Table 1.

[0044] In some exemplary embodiments, if the directional reliability of the pixel corresponding to the integer coordinate is less than 0 or greater than 1, the directional reliability of the pixel corresponding to the integer coordinate is truncated to between 0 and 1. That is, if the directional reliability of the pixel corresponding to the integer coordinate is less than 0, the directional reliability of the pixel corresponding to the integer coordinate is modified to 0; if the directional reliability of the pixel corresponding to the integer coordinate is greater than 1, the directional reliability of the pixel corresponding to the integer coordinate is modified to 1.

[0045] Table 1

[0046]

[0047] Figure 2 This is a schematic diagram of 16 sub-directions when the slope is positive, as shown in the embodiments of this application. Figure 2 As shown, each gradient direction can be discretized to a pixel in the neighborhood within a 5×5 interval. For the line corresponding to each direction, the directions in the third and fourth quadrants are the same as those in the first and second quadrants. Therefore, it is only necessary to calculate the pixel in the direction of the first and second quadrants.

[0048] In some exemplary embodiments, determining the direction value and direction reliability of the first pixel point based on the direction value and direction reliability of each second pixel point in the original image includes: taking the direction value of the second pixel point with the second coordinate in the original image as the direction value of the first pixel point, and taking the direction reliability of the second pixel point with the second coordinate in the original image as the direction reliability of the first pixel point.

[0049] In some exemplary embodiments, determining the direction value and direction reliability of a first pixel based on the direction value and direction reliability of each second pixel in the original image includes: when the second coordinate is an integer, using the direction value of the second pixel with the second coordinate in the original image as the direction value of the first pixel, and using the direction reliability of the second pixel with the second coordinate in the original image as the direction reliability of the first pixel; when the second coordinate is not an integer, converting the second coordinate to an integer coordinate, using the direction value of the second pixel with the integer coordinate in the original image as the direction value of the first pixel, and using the direction reliability of the second pixel with the integer coordinate in the original image as the direction reliability of the first pixel.

[0050] In some exemplary embodiments, "the second coordinate is an integer" means that both the x-coordinate and y-coordinate in the second coordinate are integers.

[0051] In some exemplary embodiments, "the second coordinate is not an integer" means that the x-coordinate in the second coordinate is not an integer, or the y-coordinate is not an integer, or both the x-coordinate and the y-coordinate are not integers.

[0052] In some exemplary embodiments, converting the second coordinate to an integer coordinate includes: rounding the second coordinate down to obtain an integer coordinate; or, rounding the second coordinate up to obtain an integer coordinate; or, rounding the second coordinate to obtain an integer coordinate.

[0053] In some exemplary embodiments, when the x-coordinate in the second coordinate system is not an integer, converting the second coordinate system to an integer coordinate system includes converting the x-coordinate in the second coordinate system to an integer; when the y-coordinate in the second coordinate system is not an integer, converting the second coordinate system to an integer coordinate system includes converting the y-coordinate in the second coordinate system to an integer; when both the x-coordinate and y-coordinate in the second coordinate system are not integers, converting the second coordinate system to an integer coordinate system includes converting both the x-coordinate and y-coordinate in the second coordinate system to integers.

[0054] Step 102: Determine the final pixel value of the pixel to be interpolated based on the direction value and direction reliability of the first pixel.

[0055] In some exemplary embodiments, determining the final pixel value of the pixel to be interpolated based on the orientation value and orientation reliability of the first pixel includes: determining the original pixel value of the pixel to be interpolated based on the orientation value of the first pixel; correcting the original pixel value of the pixel to be interpolated to obtain the intermediate pixel value of the pixel to be interpolated in the target image; and determining the final pixel value of the pixel to be interpolated based on the orientation reliability of the first pixel, the intermediate pixel value of the pixel to be interpolated, and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method.

[0056] In some exemplary embodiments, such as Figure 3 As shown, determining the original pixel value of the pixel to be interpolated based on the direction value of the first pixel includes: determining the slope and first intercept Theta of the first straight line L2 passing through the first pixel (x1, y1) based on the direction value of the first pixel; determining the second intercept Theta[0] of the second straight line L1 with the same slope as the first straight line L2 and the third intercept Theta[1] of the third straight line L3 based on the slope and first intercept Theta of the first straight line L2; and determining the slope and fourth intercept theta' of the perpendicular line L4 passing through the first pixel (x1, y1) and perpendicular to the first straight line L2; wherein, the second straight line L1 and the third straight line L3 are located at the first pixel (x1, y1) and the first straight line L2. On both sides of a straight line L2; determine the pixel value of the first intersection point (x[0], y[0]) of the second straight line L1 and the perpendicular line L4 based on the slope and second intercept Theta[0] of the second straight line L1, and the slope and fourth intercept theta' of the perpendicular line L4; determine the pixel value of the second intersection point (x[1], y[1]) of the third straight line L3 and the perpendicular line L4 based on the slope and third intercept Theta[1] of the third straight line L3, and the slope and fourth intercept theta' of the perpendicular line L4; determine the original pixel value of the pixel to be interpolated based on the pixel value of the first intersection point (x[0], y[0]) and the pixel value of the second intersection point (x[1], y[1]).

[0057] In some exemplary embodiments, the slope and first intercept Theta of the first straight line L2, the slope and second intercept Theta[0] of the second straight line L1, the slope and third intercept Theta[1] of the third straight line L3, and the slope and fourth intercept theta' of the perpendicular line L4 can be the slope and intercept in the target coordinate system. The target coordinate system can be the original image coordinate system or a coordinate system in which the origin of the original image coordinate system is translated to a coordinate system with the integer part (x0_int, y0_int) of the second coordinate as the origin.

[0058] In some exemplary embodiments, determining the slope and first intercept Theta of the first straight line L2 passing through the first pixel (x1, y1) based on the direction value of the first pixel includes: finding the slope corresponding to the direction value of the first pixel (x1, y1) as the slope of the first straight line L2 in a pre-set correspondence between direction values ​​and slopes; and determining the first intercept Theta based on the coordinates (x1, y1) of the first pixel (x1, y1) in the target coordinate system and the slope of the first straight line.

[0059] In some exemplary embodiments, the correspondence between direction values ​​and slopes can be preset. For example, the slopes corresponding to direction values ​​of 1-32 can be set as [0, 1], [1, 5], [1, 4], [1, 3], [2, 5], [1, 2], [2, 3], [3, 4], [1, 1], [4, 3], [3, 2], [2, 1], [5, 2], [3, 1], [4, 1], [5, 1], [1, 0], [5, -1], [4, -1], [3, -1], [5, -2], [2, -1], [3, -2], [4, -3], [1, -1], [3, -4], [2, -3], [1, -2], [2, -5], [1, -3], [1, -4], [1, -5]. The slope is represented by two values, m and n. Therefore, the slope can be calculated from m and n as follows: The values ​​of m and n can be adjusted according to the actual effect. The values ​​of m and n should, as far as possible, satisfy the angle corresponding to the corresponding direction value.

[0060] In some exemplary embodiments, determining the first intercept Theta based on the coordinates (x1, y1) of the first pixel point (x1, y1) in the target coordinate system and the slope of the first straight line includes: according to the formula Determine the first intercept; where (x1, y1) are the coordinates of the first pixel in the target coordinate system, and Theta is the first intercept.

[0061] In some exemplary embodiments, the second intercept can be obtained by rounding up the first intercept, i.e. The third intercept can be obtained by rounding down the first intercept, i.e. Where Theta[0] is the second intercept and Theta[1] is the third intercept.

[0062] In some exemplary embodiments, the second intercept can be obtained by rounding up the first intercept and adding a first constant, i.e. The third intercept can be obtained by taking the first intercept down and subtracting the second constant, i.e. Where Theta[0] is the second intercept, d1 is the first constant, Theta[1] is the third intercept, and d2 is the second constant.

[0063] In some exemplary embodiments, the slope of the perpendicular line is The fourth intercept is

[0064] In some exemplary embodiments, determining the pixel value of the first intersection point (x[0], y[0]) of the second line L1 and the perpendicular line L4 based on the slope and second intercept Theta[0] of the second line L1, and the slope and fourth intercept theta' of the perpendicular line L4, includes: determining the coordinates of the fourth and fifth pixel points located on the second line L1 in the target coordinate system based on the slope and second intercept Theta[0] of the second line L1; wherein the fourth and fifth pixel points are located at the first intersection point (x[0]). , y[0]) on both sides; determine the coordinates (x[0], y[0]) of the first intersection point in the target coordinate system based on the slope and second intercept Theta[0] of the second straight line L1, and the slope and fourth intercept theta' of the perpendicular line L4; determine the pixel values ​​of the fourth and fifth pixels based on the coordinates of the fourth and fifth pixels in the target coordinate system; determine the pixel value of the first intersection point based on the pixel values ​​of the fourth and fifth pixels, and the coordinates (x[0], y[0]) of the first intersection point in the target coordinate system.

[0065] In some exemplary embodiments, when the target coordinate system is the original image coordinate system, the pixel value of the fourth pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the fourth pixel, and the pixel value of the fifth pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the fifth pixel. When the target coordinate system is a coordinate system in which the origin of the original image coordinate system is translated to a coordinate system with the integer part of the second coordinate (x0_int, y0_int) as the origin, the pixel value of the fourth pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the pixel in the target coordinate system converted to coordinates in the original image coordinate system; the pixel value of the fifth pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the pixel in the target coordinate system converted to coordinates in the original image coordinate system.

[0066] In some exemplary embodiments, determining the coordinates of the fourth and fifth pixels in the original image located on the second line L1 in the target coordinate system based on the slope and the second intercept Theta[0] of the second line L1 includes: converting the coordinates of each pixel in the original image in the original image coordinate system to coordinates in the target coordinate system, and sequentially substituting the coordinates of each pixel in the target coordinate system into the expression of the second line L1 to verify whether the expression of the second line L1 is satisfied; wherein, the expression of the second line L1 is determined based on the slope and the second intercept Theta[0] of the second line L1, that is, the expression of the second line L1 is

[0067] The pixel points whose coordinates satisfy the expression of the second line L1 can be used as candidate pixel points for the fourth and fifth pixel points. After determining the coordinates (x[0], y[0]) of the first intersection point in the target coordinate system based on the slope and second intercept Theta[0] of the second line L1, and the slope and fourth intercept theta' of the perpendicular line L4, two pixel points located on both sides of the first intersection point on the second line L1 are selected from the candidate pixel points for the fourth and fifth pixel points as the fourth and fifth pixel points.

[0068] In some exemplary embodiments, when determining the coordinates (x[0], y[0]) of the first intersection point in the target coordinate system based on the slope and second intercept Theta[0] of the second line L1, and the slope and fourth intercept theta' of the perpendicular line L4, the expression of the second line L1 is determined based on the slope and second intercept Theta[0] of the second line L1, that is, the expression of the second line L1d is: The expression for perpendicular line L4 is determined based on its slope and fourth intercept theta', i.e., the expression for perpendicular line L4 is: Solving the system of equations using the expressions for the second line L1 and the perpendicular line L4 yields the coordinates of the first intersection point in the target coordinate system.

[0069] In some exemplary embodiments, determining the coordinates of the fourth and fifth pixels in the target coordinate system located on the second line L1 in the original image according to the slope and the second intercept Theta[0] of the second line L1 includes: determining the coordinates of the candidate pixels in the target coordinate system according to the slope and the second intercept Theta[0] of the second line L1; and determining the coordinates of the fourth and fifth pixels in the target coordinate system according to the coordinates of the candidate pixels in the target coordinate system.

[0070] In some exemplary embodiments, determining the coordinates of a candidate pixel in the target coordinate system based on the slope and the second intercept Theta[0] of the second line L1 includes: determining the coordinates of a first candidate pixel in the target coordinate system based on the slope and the second intercept Theta[0] of the second line L1, and determining the coordinates of a second candidate pixel and a third candidate pixel in the target coordinate system based on the coordinates of the first candidate pixel in the target coordinate system.

[0071] In some exemplary embodiments, determining the coordinates of the first candidate pixel in the target coordinate system based on the slope of the second straight line L1 and the second intercept Theta[0] includes at least one of the following:

[0072] If at least one of the slopes m and n in the second straight line L1 is 1, and the absolute value of m is greater than the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (0, c1); where c1 = abs(n) × y1 + sign(n) × m × x1.

[0073] If at least one of m and n in the slope of the second line L1 is 1, and the absolute value of m is less than or equal to the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined to be (c1×sign(n), 0).

[0074] If the absolute value of the difference between the absolute values ​​of m and n in the slope of the second straight line L1 is 1, and the absolute value of m is greater than the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (c1×sign(n), -c1).

[0075] If the absolute value of the difference between the absolute values ​​of m and n in the slope of the second straight line L1 is 1, and the absolute value of m is less than or equal to the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (-c1×sign(n), c1).

[0076] If the absolute value of the difference between the absolute values ​​of m and n in the slope of the second straight line L1 is 3, the coordinates of the first candidate pixel in the target coordinate system are determined according to the pre-configured coordinate table.

[0077] In some exemplary embodiments, determining the coordinates of the first candidate pixel in the target coordinate system according to a pre-configured coordinate table includes:

[0078] If the absolute value of m in the slope of the second line L1 is greater than the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined as (the sign bit of LUT[ln1+7]×ln1, the sign bit of LUT[ln1+22]×ln1×nn1×n).

[0079] If the absolute value of m in the slope of the second line L1 is less than the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined as (LUT[ln1+22]×ln1 sign bit, LUT[ln1+7]×ln1 sign bit×n sign bit).

[0080] In some exemplary embodiments, the pre-configured coordinate table is: LUT = [1,2,1,2,1,2,1,0,1,2,1,2,1,0,1,-1,-2,0,-3,-1,-4,-2,0,-2,-4,-1,-3,0,3,1].

[0081] In some exemplary embodiments, LUT[ln1+7] refers to the (ln1+7)th element in the coordinate table, and LUT[ln1+22] refers to the (ln1+22)th element in the coordinate table.

[0082] In some exemplary embodiments, when ln1 is a positive number, the sign bit of ln1 is 1; when ln1 is a negative number, the sign bit of ln1 is -1; and when ln1 is 0, the sign bit of ln1 is 1.

[0083] In some exemplary embodiments, ln1 is obtained by shifting ln0 to the right by A bits, and ln0 = abs(n) × vertical phase + m × n sign bit × horizontal phase; where A is an integer greater than or equal to 1.

[0084] In some exemplary embodiments, the values ​​of the vertical phase and the horizontal phase range from 2. A .

[0085] In some exemplary embodiments, when n is a positive number, the sign bit of n is 1; when n is a negative number, the sign bit of n is -1; and when n is 0, the sign bit of n is 1.

[0086] In some exemplary embodiments, determining the coordinates of the second and third candidate pixels in the target coordinate system based on the coordinates of the first candidate pixel in the target coordinate system includes: shifting the coordinates of the first candidate pixel in the target coordinate system by (n, -m) units to obtain the coordinates of the second candidate pixel in the target coordinate system, and shifting the coordinates of the first candidate pixel in the target coordinate system by (-n, m) units to obtain the coordinates of the third candidate pixel in the target coordinate system.

[0087] Assuming the first candidate pixel has coordinates (x, y) in the target coordinate system, then the second candidate pixel has coordinates (x+n, ym) in the target coordinate system, and the third pixel has coordinates (xn, y+m) in the target coordinate system.

[0088] In some exemplary embodiments, determining the coordinates of the fourth and fifth pixels in the target coordinate system based on the coordinates of the candidate pixels in the target coordinate system includes: determining the coordinates of the fourth pixel in the target coordinate system based on the coordinates of the first, second, and third candidate pixels in the target coordinate system; and determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth pixel in the target coordinate system.

[0089] In some exemplary embodiments, when determining the coordinates of the fourth and fifth pixels in the target coordinate system based on the coordinates of the candidate pixels in the target coordinate system, the pixel closest to the origin of the target coordinate system can be selected as the fourth pixel from the candidate pixels. That is, the pixel closest to the origin of the target coordinate system is selected from the first, second, and third candidate pixels as the fourth pixel.

[0090] In some exemplary embodiments, determining the coordinates of the fourth pixel in the target coordinate system based on the coordinates of the first candidate pixel, the second candidate pixel, and the third candidate pixel in the target coordinate system includes at least one of the following:

[0091] If the absolute values ​​of the second coordinates are all less than the absolute values ​​of the first and third coordinates, the coordinates of the fourth pixel in the target coordinate system are determined to be the coordinates of the second candidate pixel in the target coordinate system. Specifically, the absolute value of the first coordinate is the sum of the absolute values ​​of the x and y coordinates of the first candidate pixel in the target coordinate system; the absolute value of the second coordinate is the sum of the absolute values ​​of the x and y coordinates of the second candidate pixel in the target coordinate system; and the absolute value of the third coordinate is the sum of the absolute values ​​of the x and y coordinates of the third candidate pixel in the target coordinate system.

[0092] If the absolute values ​​of the third coordinates are all less than the absolute values ​​of the first and second coordinates, the coordinates of the fourth pixel in the target coordinate system are determined to be the coordinates of the third candidate pixel in the target coordinate system.

[0093] If the absolute value of the first coordinate is greater than the absolute value of the second coordinate, or if the absolute value of the first coordinate is greater than the absolute value of the third coordinate, the coordinates of the fourth pixel in the target coordinate system are determined to be the coordinates of the first candidate pixel in the target coordinate system.

[0094] In some exemplary embodiments, determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth pixel in the target coordinate system includes: shifting the coordinates of the fourth pixel in the target coordinate system by (n, -m) units to obtain the coordinates of the fourth candidate pixel in the target coordinate system; shifting the coordinates of the fourth pixel in the target coordinate system by (-n, m) units to obtain the coordinates of the fifth candidate pixel in the target coordinate system; and determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system.

[0095] In some exemplary embodiments, when determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system, the pixel closer to the origin of the target coordinate system can be selected from the fourth and fifth candidate pixels as the fifth pixel.

[0096] In some exemplary embodiments, determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system includes at least one of the following:

[0097] If the absolute value of the fourth coordinate is greater than the absolute value of the fifth coordinate, the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fifth candidate pixel in the target coordinate system; where the absolute value of the fourth coordinate is the sum of the absolute values ​​of the x-coordinate and y-coordinate of the fourth candidate pixel in the target coordinate system, and the absolute value of the fifth coordinate is the sum of the absolute values ​​of the x-coordinate and y-coordinate of the fifth candidate pixel in the target coordinate system.

[0098] If the absolute value of the fourth coordinate is less than the absolute value of the fifth coordinate, the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fourth candidate pixel in the target coordinate system.

[0099] If the absolute value of the fourth coordinate is equal to the absolute value of the fifth coordinate, and the maximum value of the first coordinate is greater than the maximum value of the second coordinate, then the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fifth candidate pixel in the target coordinate system; wherein, the maximum value of the first coordinate is the maximum value of the x and y coordinates of the fourth candidate pixel in the target coordinate system, and the maximum value of the second coordinate is the maximum value of the x and y coordinates of the fifth candidate pixel in the target coordinate system.

[0100] If the absolute value of the fourth coordinate is equal to the absolute value of the fifth coordinate, and the maximum value of the first coordinate is less than the maximum value of the second coordinate, then the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fourth candidate pixel in the target coordinate system.

[0101] In some exemplary embodiments, determining the pixel values ​​of the fourth pixel and the fifth pixel based on their coordinates in the target coordinate system includes: converting the coordinates of the fourth pixel in the target coordinate system to coordinates in the original image coordinate system; converting the coordinates of the fifth pixel in the target coordinate system to coordinates in the original image coordinate system; taking the pixel value of the pixel in the original image whose coordinates are the same as those of the fourth pixel in the original image coordinate system as the pixel value of the fourth pixel; and taking the pixel value of the pixel in the original image whose coordinates are the same as those of the fifth pixel in the original image coordinate system as the pixel value of the fifth pixel.

[0102] In some exemplary embodiments, determining the pixel value of the first intersection point based on the pixel values ​​of the fourth and fifth pixels and the coordinates (x[0], y[0]) of the first intersection point in the target coordinate system includes: converting the coordinates of the first intersection point in the target coordinate system to coordinates in the original image coordinate system; and interpolating the pixel values ​​of the fourth and fifth pixels based on the coordinates of the fourth and fifth pixels in the original image coordinate system and the coordinates of the first intersection point in the original image coordinate system to obtain the pixel value of the first intersection point.

[0103] In some exemplary embodiments, the pixel value of the first intersection point can be obtained by bilinear interpolation based on the coordinates of the fourth pixel point in the original image coordinate system, the coordinates of the fifth pixel point in the original image coordinate system, and the coordinates of the first intersection point in the original image coordinate system.

[0104] In some exemplary embodiments, determining the pixel value of the second intersection point (x[1], y[1]) of the third line L3 and the perpendicular line L4 based on the slope and third intercept Theta[1] of the third line L3, and the slope and fourth intercept theta' of the perpendicular line L4 includes: determining the coordinates of the sixth and seventh pixels located on the third line L3 in the target coordinate system based on the slope L3 and the third intercept Theta[1] of the third line; wherein the sixth and seventh pixels are located at the second intersection point (x[1]). , y[1]) on both sides; determine the coordinates (x[1], y[1]) of the second intersection point in the target coordinate system based on the slope of the third line L3 and the third intercept Theta[1], and the slope of the perpendicular line L4 and the fourth intercept theta'; determine the pixel values ​​of the sixth and seventh pixels based on the coordinates of the sixth and seventh pixels in the target coordinate system; determine the pixel value of the second intersection point based on the pixel values ​​of the sixth and seventh pixels, and the coordinates (x[1], y[1]) of the second intersection point in the target coordinate system.

[0105] In some exemplary embodiments, when the target coordinate system is the original image coordinate system, the pixel value of the sixth pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the sixth pixel, and the pixel value of the seventh pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the seventh pixel. When the target coordinate system is a coordinate system in which the origin of the original image coordinate system is translated to a coordinate system with the integer part of the second coordinate (x0_int, y0_int) as the origin, the pixel value of the sixth pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the pixel in the target coordinate system converted to coordinates in the original image coordinate system; the pixel value of the seventh pixel is the pixel value of the pixel in the original image whose coordinates are the same as those of the pixel in the target coordinate system converted to coordinates in the original image coordinate system.

[0106] In some exemplary embodiments, determining the coordinates of the sixth and seventh pixels in the target coordinate system of the original image located on the third line L3 according to the slope and the third intercept Theta[1] of the third line L3 includes: converting the coordinates of each pixel in the original image in the original image coordinate system to coordinates in the target coordinate system, and substituting the coordinates of each pixel in the target coordinate system into the expression of the third line L3 to verify whether the expression of the third line L3 is satisfied; wherein, the expression of the third line L3 is determined according to the slope and the third intercept Theta[1] of the third line L3, that is, the expression of the third line L3 is

[0107] The pixel points whose coordinates satisfy the expression of the third line L3 can be used as candidate pixel points for the sixth and seventh pixel points. After determining the coordinates (x[1], y[1]) of the second intersection point in the target coordinate system based on the slope and third intercept Theta[1] of the third line L3, and the slope and fourth intercept theta' of the perpendicular line L4, two pixel points located on both sides of the second intersection point on the third line L3 are selected from the candidate pixel points for the sixth and seventh pixel points as the sixth and seventh pixel points.

[0108] In some exemplary embodiments, when determining the coordinates (x[1], y[1]) of the second intersection point in the target coordinate system based on the slope and third intercept Theta[1] of the third line L3, and the slope and fourth intercept theta' of the perpendicular line L4, the expression of the third line L3 is determined based on the slope and second intercept Theta[1] of the third line L3, that is, the expression of the third line L3 is: The expression for perpendicular line L4 is determined based on its slope and fourth intercept theta', i.e., the expression for perpendicular line L4 is: Solving the system of equations using the expressions for the third line L3 and the perpendicular line L4 yields the coordinates of the second intersection point in the target coordinate system.

[0109] In some exemplary embodiments, determining the coordinates of the sixth and seventh pixels in the target coordinate system located on the third line L3 in the original image based on the slope and the third intercept Theta[1] of the third line L3 includes: determining the coordinates of the candidate pixels in the target coordinate system based on the slope and the third intercept Theta[1] of the third line L3; and determining the coordinates of the sixth and seventh pixels in the target coordinate system based on the coordinates of the candidate pixels in the target coordinate system.

[0110] In some exemplary embodiments, determining the coordinates of a candidate pixel in the target coordinate system based on the slope of the third line L3 and the third intercept Theta[1] includes: determining the coordinates of a first candidate pixel in the target coordinate system based on the slope of the third line L3 and the third intercept Theta[1], and determining the coordinates of a second candidate pixel and a third candidate pixel in the target coordinate system based on the coordinates of the first candidate pixel in the target coordinate system.

[0111] In some exemplary embodiments, determining the coordinates of the first candidate pixel in the target coordinate system based on the slope of the third line L3 and the third intercept Theta[1] includes at least one of the following:

[0112] If at least one of the slopes m and n in the third straight line L3 is 1, and the absolute value of m is greater than the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (0, c1); where c1 = abs(n) × y1 + sign(n) × m × x1.

[0113] If at least one of m and n in the slope of the third line L3 is 1, and the absolute value of m is less than or equal to the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined to be (c1×sign(n), 0).

[0114] If the absolute value of the difference between the absolute values ​​of m and n in the slope of the third straight line L3 is 1, and the absolute value of m is greater than the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (c1×sign(n), -c1).

[0115] If the absolute value of the difference between the absolute values ​​of m and n in the slope of the third straight line L3 is 1, and the absolute value of m is less than or equal to the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (-c1×sign(n), c1).

[0116] If the absolute value of the difference between the absolute values ​​of m and n in the slope of the third straight line L3 is 3, the coordinates of the first candidate pixel in the target coordinate system are determined according to the pre-configured coordinate table.

[0117] In some exemplary embodiments, determining the coordinates of the first candidate pixel in the target coordinate system according to a pre-configured coordinate table includes:

[0118] If the absolute value of m in the slope of the third line L3 is greater than the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined as (sign bit of LUT[ln2+7]×ln2, sign bit of LUT[ln2+22]×ln2×n).

[0119] If the absolute value of m in the slope of the third line L3 is less than the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined as (sign bit of LUT[ln2+22]×ln2, sign bit of LUT[ln2+7]×ln2×n).

[0120] In some exemplary embodiments, the pre-configured coordinate table is: LUT = [1,2,1,2,1,2,1,0,1,2,1,2,1,0,1,-1,-2,0,-3,-1,-4,-2,0,-2,-4,-1,-3,0,3,1].

[0121] In some exemplary embodiments, LUT[ln2+7] refers to the ln2+7th element in the coordinate table, and LUT[ln2+22] refers to the ln2+22th element in the coordinate table.

[0122] In some exemplary embodiments, when ln2 is positive, the sign bit of ln2 is 1; when ln2 is negative, the sign bit of ln2 is -1; and when ln2 is 0, the sign bit of ln2 is 1.

[0123] In some exemplary embodiments, ln2 = ln1 + 1, ln1 is obtained by shifting ln0 to the right by A bits, and ln0 = abs(n) × vertical phase + m × n sign bit × horizontal phase; where A is an integer greater than or equal to 1.

[0124] In some exemplary embodiments, the values ​​of the vertical phase and the horizontal phase range from 2. A .

[0125] In some exemplary embodiments, when n is a positive number, the sign bit of n is 1; when n is a negative number, the sign bit of n is -1; and when n is 0, the sign bit of n is 1.

[0126] In some exemplary embodiments, determining the coordinates of the second and third candidate pixels in the target coordinate system based on the coordinates of the first candidate pixel in the target coordinate system includes: shifting the coordinates of the first candidate pixel in the target coordinate system by (n, -m) units to obtain the coordinates of the second candidate pixel in the target coordinate system, and shifting the coordinates of the first candidate pixel in the target coordinate system by (-n, m) units to obtain the coordinates of the third candidate pixel in the target coordinate system.

[0127] Assuming the first candidate pixel has coordinates (x, y) in the target coordinate system, then the second candidate pixel has coordinates (x+n, ym) in the target coordinate system, and the third pixel has coordinates (xn, y+m) in the target coordinate system.

[0128] In some exemplary embodiments, determining the coordinates of the sixth and seventh pixels in the target coordinate system based on the coordinates of the candidate pixels in the target coordinate system includes: determining the coordinates of the sixth pixel in the target coordinate system based on the coordinates of the first, second, and third candidate pixels in the target coordinate system; and determining the coordinates of the seventh pixel in the target coordinate system based on the coordinates of the sixth pixel in the target coordinate system.

[0129] In some exemplary embodiments, when determining the coordinates of the fourth and fifth pixels in the target coordinate system based on the coordinates of the candidate pixels in the target coordinate system, the pixel closest to the origin of the target coordinate system can be selected as the fourth pixel from the candidate pixels. That is, the pixel closest to the origin of the target coordinate system is selected from the first, second, and third candidate pixels as the fourth pixel.

[0130] In some exemplary embodiments, determining the coordinates of the sixth pixel in the target coordinate system based on the coordinates of the first candidate pixel, the second candidate pixel, and the third candidate pixel in the target coordinate system includes at least one of the following:

[0131] If the absolute values ​​of the second coordinates are all less than the absolute values ​​of the first and third coordinates, the coordinates of the sixth pixel in the target coordinate system are determined to be the coordinates of the second candidate pixel in the target coordinate system. Specifically, the absolute value of the first coordinate is the sum of the absolute values ​​of the x and y coordinates of the first candidate pixel in the target coordinate system; the absolute value of the second coordinate is the sum of the absolute values ​​of the x and y coordinates of the second candidate pixel in the target coordinate system; and the absolute value of the third coordinate is the sum of the absolute values ​​of the x and y coordinates of the third candidate pixel in the target coordinate system.

[0132] If the absolute values ​​of the third coordinates are all less than the absolute values ​​of the first and second coordinates, the coordinates of the sixth pixel in the target coordinate system are determined to be the coordinates of the third candidate pixel in the target coordinate system.

[0133] If the absolute value of the first coordinate is greater than the absolute value of the second coordinate, or if the absolute value of the first coordinate is greater than the absolute value of the third coordinate, the coordinates of the sixth pixel in the target coordinate system are determined to be the coordinates of the first candidate pixel in the target coordinate system.

[0134] In some exemplary embodiments, determining the coordinates of the seventh pixel in the target coordinate system based on the coordinates of the sixth pixel in the target coordinate system includes: shifting the coordinates of the sixth pixel in the target coordinate system by (n, -m) units to obtain the coordinates of the fourth candidate pixel in the target coordinate system; shifting the coordinates of the sixth pixel in the target coordinate system by (-n, m) units to obtain the coordinates of the fifth candidate pixel in the target coordinate system; and determining the coordinates of the seventh pixel in the target coordinate system based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system.

[0135] In some exemplary embodiments, when determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system, the pixel closer to the origin of the target coordinate system can be selected from the fourth and fifth candidate pixels as the fifth pixel.

[0136] In some exemplary embodiments, determining the coordinates of the seventh pixel in the target coordinate system based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system includes at least one of the following:

[0137] If the absolute value of the fourth coordinate is greater than the absolute value of the fifth coordinate, the coordinates of the seventh pixel in the target coordinate system are determined to be the coordinates of the fifth candidate pixel in the target coordinate system; where the absolute value of the fourth coordinate is the sum of the absolute values ​​of the x-coordinate and y-coordinate of the fourth candidate pixel in the target coordinate system, and the absolute value of the fifth coordinate is the sum of the absolute values ​​of the x-coordinate and y-coordinate of the fifth candidate pixel in the target coordinate system.

[0138] If the absolute value of the fourth coordinate is less than the absolute value of the fifth coordinate, the coordinates of the seventh pixel in the target coordinate system are determined to be the coordinates of the fourth candidate pixel in the target coordinate system.

[0139] If the absolute value of the fourth coordinate is equal to the absolute value of the fifth coordinate, and the maximum value of the first coordinate is greater than the maximum value of the second coordinate, then the coordinates of the seventh pixel in the target coordinate system are determined to be the coordinates of the fifth candidate pixel in the target coordinate system; wherein, the maximum value of the first coordinate is the maximum value of the x and y coordinates of the fourth candidate pixel in the target coordinate system, and the maximum value of the second coordinate is the maximum value of the x and y coordinates of the fifth candidate pixel in the target coordinate system.

[0140] If the absolute value of the fourth coordinate is equal to the absolute value of the fifth coordinate, and the maximum value of the first coordinate is less than the maximum value of the second coordinate, then the coordinates of the seventh pixel in the target coordinate system are determined to be the coordinates of the fourth candidate pixel in the target coordinate system.

[0141] In some exemplary embodiments, determining the pixel values ​​of the sixth and seventh pixels based on their coordinates in the target coordinate system includes: converting the coordinates of the sixth pixel in the target coordinate system to coordinates in the original image coordinate system; converting the coordinates of the seventh pixel in the target coordinate system to coordinates in the original image coordinate system; taking the pixel value of the pixel in the original image whose coordinates are the same as those of the sixth pixel in the original image coordinate system as the pixel value of the sixth pixel; and taking the pixel value of the pixel in the original image whose coordinates are the same as those of the seventh pixel in the original image coordinate system as the pixel value of the seventh pixel.

[0142] In some exemplary embodiments, determining the pixel value of the second intersection point based on the pixel values ​​of the sixth and seventh pixels and the coordinates (x[1], y[1]) of the second intersection point in the target coordinate system includes: converting the coordinates of the second intersection point in the target coordinate system to coordinates in the original image coordinate system; and interpolating the pixel values ​​of the sixth and seventh pixels based on the coordinates of the sixth and seventh pixels in the original image coordinate system, the coordinates of the seventh pixel in the original image coordinate system, and the coordinates of the second intersection point in the original image coordinate system to obtain the pixel value of the second intersection point.

[0143] In some exemplary embodiments, the pixel value of the sixth pixel and the pixel value of the seventh pixel can be interpolated using bilinear interpolation based on the coordinates of the sixth pixel in the original image coordinate system, the coordinates of the seventh pixel in the original image coordinate system, and the coordinates of the second intersection point in the original image coordinate system to obtain the pixel value of the second intersection point.

[0144] In some exemplary embodiments, determining the original pixel value of the pixel to be interpolated based on the pixel value of the first intersection point (x[0], y[0]) and the pixel value of the second intersection point (x[1], y[1]) includes: interpolating the pixel value of the first intersection point and the pixel value of the second intersection point based on the coordinates of the first intersection point in the original image coordinate system, the coordinates of the second intersection point in the original image coordinate system, and the second coordinates of the pixel to be interpolated in the original image coordinate system to obtain the original pixel value of the pixel to be interpolated.

[0145] In some exemplary embodiments, the pixel values ​​of the first intersection point and the second intersection point can be interpolated using bilinear interpolation based on the coordinates of the first intersection point in the original image coordinate system, the coordinates of the second intersection point in the original image coordinate system, and the second coordinates of the pixel to be interpolated in the original image coordinate system to obtain the original pixel value of the pixel to be interpolated.

[0146] In some exemplary embodiments, correcting the original pixel value of the pixel to be interpolated to obtain the intermediate pixel value of the pixel to be interpolated in the target image includes: comparing the original pixel value of the pixel to be interpolated with the pixel value of the pixel to be interpolated calculated using a conventional interpolation method; if the difference between the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method is greater than or equal to a preset threshold, determining the intermediate pixel value of the pixel to be interpolated based on the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method; and if the difference between the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method is greater than or equal to a preset threshold, determining the intermediate pixel value of the pixel to be interpolated based on the original pixel value of the pixel to be interpolated.

[0147] In some exemplary embodiments, determining the intermediate pixel value of the pixel to be interpolated based on the original pixel value and the pixel value of the pixel to be interpolated calculated using a traditional interpolation method includes: determining the intermediate pixel value of the pixel to be interpolated according to the formula result1 = weight1 × dir + (1 - weight1) × tradition; where result1 is the intermediate pixel value of the pixel to be interpolated, weight1 is the first weight, dir is the original pixel value of the pixel to be interpolated, and tradition is the pixel value of the pixel to be interpolated calculated using a traditional interpolation method.

[0148] In some exemplary embodiments, weight1 is proportional to the absolute value of the difference between the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method.

[0149] In some exemplary embodiments, determining the intermediate pixel value of the pixel to be interpolated based on the original pixel value of the pixel to be interpolated includes: using the original pixel value of the pixel to be interpolated as the intermediate pixel value of the pixel to be interpolated.

[0150] In some exemplary embodiments, determining the final pixel value of the pixel to be interpolated based on the directional reliability of the first pixel, the intermediate pixel value of the pixel to be interpolated, and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method includes: using the directional reliability of the first pixel as a weight, calculating the weighted average of the intermediate pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method as the final pixel value of the pixel to be interpolated.

[0151] In some exemplary embodiments, using the directional reliability of the first pixel as a weight, the weighted average of the intermediate pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the traditional interpolation method is used as the final pixel value of the pixel to be interpolated. This includes determining the final pixel value of the pixel to be interpolated according to the formula result2 = weight2 × result1 + (1 - weight2) × tradition; where result2 is the intermediate pixel value of the pixel to be interpolated, weight2 is the second weight, result1 is the intermediate pixel value of the pixel to be interpolated, and tradition is the pixel value of the pixel to be interpolated calculated using the traditional interpolation method.

[0152] In some exemplary embodiments, conventional interpolation methods such as bilinear interpolation, bicubic interpolation, and Lanczos interpolation are used.

[0153] The image interpolation method provided in this application embodiment interpolates based on the direction value and direction reliability of the first pixel corresponding to the pixel to be interpolated in the original image. Compared with traditional interpolation methods, the image interpolation method in this application embodiment recovers the edge detail information of the image better, and the interpolated image has fewer jagged edges and higher subjective quality. Compared with deep learning algorithms, the image interpolation method in this application embodiment has a simpler mathematical model, is easier to deploy on the terminal, and has better generalization effect.

[0154] Figure 4 A block diagram of an image interpolation apparatus provided for another embodiment of this application.

[0155] Secondly, referring to Figure 4Another embodiment of this application provides an image interpolation apparatus, including: a coordinate transformation module 401, used to convert the first coordinate of the pixel to be interpolated in the target image coordinate system into the second coordinate in the original image coordinate system; a direction calculation module 402, used to determine the direction value and direction reliability of the first pixel corresponding to the second coordinate in the original image; and an interpolation module 403, used to determine the final pixel value of the pixel to be interpolated based on the direction value and direction reliability of the first pixel.

[0156] In some exemplary embodiments, the orientation calculation module 402 is specifically used to: calculate the orientation value and orientation reliability of each second pixel in the original image; and determine the orientation value and orientation reliability of the first pixel based on the orientation value and orientation reliability of each second pixel in the original image.

[0157] In some exemplary embodiments, the direction calculation module 402 is specifically used to calculate the direction value and direction reliability of each second pixel in the original image in the following manner: calculate the gradient in the x-direction and the gradient in the y-direction of each third pixel in the original image; for each second pixel in the original image, calculate the direction value and direction reliability of the second pixel based on the gradient in the x-direction and the gradient in the y-direction of all third pixels in the first pixel matrix centered on the second pixel in the original image.

[0158] In some exemplary embodiments, the interpolation module 403 is specifically configured to determine the final pixel value of the pixel to be interpolated based on the direction value and direction reliability of the first pixel in the following manner: determining the original pixel value of the pixel to be interpolated based on the direction value of the first pixel; correcting the original pixel value of the pixel to be interpolated to obtain the intermediate pixel value of the pixel to be interpolated in the target image; and determining the final pixel value of the pixel to be interpolated based on the direction reliability of the first pixel, the intermediate pixel value of the pixel to be interpolated, and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method.

[0159] In some exemplary embodiments, the interpolation module 403 is specifically configured to determine the original pixel value of the pixel to be interpolated based on the direction value of the first pixel in the following manner: determining the slope and first intercept of a first straight line passing through the first pixel based on the direction value of the first pixel; determining the second intercept of a second straight line with the same slope as the first straight line and the third intercept of a third straight line, as well as the slope and fourth intercept of a perpendicular line passing through the first pixel and perpendicular to the first straight line, based on the slope and first intercept of the first straight line; wherein the second straight line and the third straight line are located on both sides of the first straight line; determining the pixel value of the first intersection point of the second straight line and the perpendicular line based on the slope and second intercept of the second straight line, and the slope and fourth intercept of the perpendicular line; determining the pixel value of the second intersection point of the third straight line and the perpendicular line based on the slope and third intercept of the third straight line, and the slope and fourth intercept of the perpendicular line; and determining the original pixel value of the pixel to be interpolated based on the pixel value of the first intersection point and the pixel value of the second intersection point.

[0160] In some exemplary embodiments, the interpolation module 403 is specifically configured to determine the pixel value of the first intersection point of the second straight line and the perpendicular line based on the slope and second intercept of the second straight line, and the slope and fourth intercept of the perpendicular line, in the target coordinate system by: determining the coordinates of a fourth pixel point and a fifth pixel point located on the second straight line in the original image in the target coordinate system based on the slope and second intercept of the second straight line; wherein the fourth pixel point and the fifth pixel point are located on both sides of the first intersection point; determining the coordinates of the first intersection point in the target coordinate system based on the slope and second intercept of the second straight line, and the slope and fourth intercept of the perpendicular line; determining the pixel value of the fourth pixel point and the fifth pixel point based on the coordinates of the fourth pixel point and the fifth pixel point in the target coordinate system; and determining the pixel value of the first intersection point based on the pixel values ​​of the fourth pixel point and the fifth pixel point, and the coordinates of the first intersection point in the target coordinate system.

[0161] In some exemplary embodiments, the interpolation module 403 is specifically configured to determine the pixel value of the second intersection point of the third straight line and the perpendicular line based on the slope and third intercept of the third straight line, and the slope and fourth intercept of the perpendicular line, in the target coordinate system by: determining the coordinates of a sixth pixel and a seventh pixel in the original image located on the third straight line in the target coordinate system based on the slope and third intercept of the third straight line; wherein the sixth pixel and the seventh pixel are located on both sides of the second intersection point; determining the coordinates of the second intersection point in the target coordinate system based on the slope and third intercept of the third straight line, and the slope and fourth intercept of the perpendicular line; determining the pixel value of the sixth pixel and the seventh pixel based on the coordinates of the sixth pixel and the seventh pixel in the target coordinate system; and determining the pixel value of the second intersection point based on the pixel values ​​of the sixth pixel and the seventh pixel and the coordinates of the second intersection point in the target coordinate system.

[0162] In some exemplary embodiments, the interpolation module 403 is specifically configured to correct the original pixel value of the pixel to be interpolated to obtain the intermediate pixel value of the pixel to be interpolated in the target image in the following manner: comparing the original pixel value of the pixel to be interpolated with the pixel value of the pixel to be interpolated calculated using the conventional interpolation method; if the difference between the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the conventional interpolation method is greater than or equal to a preset threshold, determining the intermediate pixel value of the pixel to be interpolated based on the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the conventional interpolation method; if the difference between the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the conventional interpolation method is greater than or equal to a preset threshold, determining the intermediate pixel value of the pixel to be interpolated based on the original pixel value of the pixel to be interpolated.

[0163] In some exemplary embodiments, the interpolation module 403 is specifically configured to determine the final pixel value of the pixel to be interpolated based on the directional reliability of the first pixel, the intermediate pixel value of the pixel to be interpolated, and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method, by using the directional reliability of the first pixel as a weight, and calculating the weighted average of the intermediate pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using a conventional interpolation method as the final pixel value of the pixel to be interpolated.

[0164] The specific implementation process of the above-described image interpolation device is the same as that of the image interpolation method in the above embodiments, and will not be repeated here.

[0165] Thirdly, referring to Figure 5 Another embodiment of this application provides an electronic device, including: at least one processor 501; and a memory 502, on which at least one program is stored, which, when executed by at least one processor 501, implements any of the above-described image interpolation methods.

[0166] In some exemplary embodiments, the electronic device further includes one or more I / O interfaces 503 connected between the processor 501 and the memory 502, configured to enable information interaction between the processor 501 and the memory 502.

[0167] Among them, processor 501 is a device with data processing capabilities, including but not limited to central processing unit (CPU); memory 502 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); I / O interface (read-write interface) 503 is connected between processor 501 and memory 502, and can realize information interaction between processor 501 and memory 502, including but not limited to data bus (Bus).

[0168] In some embodiments, the processor 501, memory 502, and I / O interface 503 are interconnected via bus 504, and thus connected to other components of the computing device.

[0169] Fourthly, another embodiment of this application provides a computer-readable medium storing a computer program that, when executed by a processor, implements any of the above-described image interpolation methods.

[0170] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above 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 collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media 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 technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0171] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this application as set forth by the appended claims.

Claims

1. An image interpolation method, comprising: Transform the first coordinate of the pixel to be interpolated in the target image coordinate system into the second coordinate in the original image coordinate system; Determine the orientation value and orientation reliability of the first pixel point corresponding to the second coordinate in the original image; The final pixel value of the pixel to be interpolated is determined based on the direction value and direction reliability of the first pixel. The step of determining the final pixel value of the pixel to be interpolated based on the direction value and direction reliability of the first pixel includes: determining the original pixel value of the pixel to be interpolated based on the direction value of the first pixel; correcting the original pixel value of the pixel to be interpolated to obtain the intermediate pixel value of the pixel to be interpolated in the target image; and determining the final pixel value of the pixel to be interpolated based on the direction reliability of the first pixel, the intermediate pixel value of the pixel to be interpolated, and the pixel value of the pixel to be interpolated calculated using a traditional interpolation method.

2. The image interpolation method according to claim 1, wherein, The determination of the direction value and direction reliability of the first pixel point corresponding to the second coordinate in the original image includes: Calculate the orientation value and orientation reliability of each second pixel in the original image; The direction value and direction reliability of the first pixel are determined based on the direction value and direction reliability of each second pixel in the original image.

3. The image interpolation method according to claim 2, wherein, The step of calculating the orientation value and orientation reliability of each second pixel in the original image includes: Calculate the gradient in the x-direction and the gradient in the y-direction for each third pixel in the original image; For each second pixel in the original image, the orientation value and orientation reliability of the second pixel are calculated based on the gradients in the x-direction and y-direction of all third pixels in the first pixel matrix centered on the second pixel in the original image.

4. The image interpolation method according to claim 1, wherein, Determining the original pixel value of the pixel to be interpolated based on the direction value of the first pixel includes: The slope and first intercept of the first straight line passing through the first pixel are determined based on the direction value of the first pixel. The second intercept of a second line with the same slope as the first line and the third intercept of a third line are determined based on the slope and the first intercept of the first line; the slope and the fourth intercept of a perpendicular line passing through the first pixel and perpendicular to the first line are also determined; wherein the second line and the third line are located on both sides of the first line. The pixel value of the first intersection point of the second line and the perpendicular line is determined based on the slope and second intercept of the second line, as well as the slope and fourth intercept of the perpendicular line. The pixel value of the second intersection point of the third line and the perpendicular line is determined based on the slope and third intercept of the third line, and the slope and fourth intercept of the perpendicular line. The original pixel value of the pixel to be interpolated is determined based on the pixel value of the first intersection point and the pixel value of the second intersection point.

5. The image interpolation method according to claim 4, wherein, The step of determining the pixel value of the first intersection point of the second line and the perpendicular line based on the slope and second intercept of the second line, and the slope and fourth intercept of the perpendicular line, includes: The coordinates of the fourth and fifth pixels in the original image located on the second straight line in the target coordinate system are determined based on the slope and the second intercept of the second straight line; wherein the fourth and fifth pixels are located on both sides of the first intersection point; The coordinates of the first intersection point in the target coordinate system are determined based on the slope and second intercept of the second straight line, as well as the slope and fourth intercept of the perpendicular line. The pixel values ​​of the fourth pixel and the fifth pixel are determined based on their coordinates in the target coordinate system. The pixel value of the first intersection point is determined based on the pixel values ​​of the fourth and fifth pixels, and the coordinates of the first intersection point in the target coordinate system.

6. The image interpolation method according to claim 5, wherein, Determining the pixel values ​​of the fourth pixel and the fifth pixel in the target coordinate system based on their coordinates includes: The coordinates of the fourth pixel in the target coordinate system are converted to coordinates in the original image coordinate system, and the coordinates of the fifth pixel in the target coordinate system are converted to coordinates in the original image coordinate system. The pixel value of the fourth pixel is taken as the pixel value of the original image whose coordinates are the same as those of the fifth pixel in the original image coordinate system.

7. The image interpolation method according to claim 5, wherein, Determining the pixel value of the first intersection point based on the pixel values ​​of the fourth pixel point and the fifth pixel point, and the coordinates of the first intersection point in the target coordinate system, includes: Convert the coordinates of the first intersection point in the target coordinate system to the coordinates in the original image coordinate system; The pixel value of the first intersection point is obtained by interpolating the pixel values ​​of the fourth pixel point and the fifth pixel point in the original image coordinate system based on the coordinates of the fourth pixel point, the fifth pixel point in the original image coordinate system, and the coordinates of the first intersection point in the original image coordinate system.

8. The image interpolation method according to claim 4, wherein, Determining the coordinates of the fourth and fifth pixels in the target coordinate system of the original image, which are located on the second straight line, based on the slope and second intercept of the second straight line includes: The coordinates of each pixel in the original image in the original image coordinate system are converted to coordinates in the target coordinate system. The coordinates of each pixel in the target coordinate system are then substituted into the expression of the second line to verify whether the expression of the second line is satisfied. The expression of the second line is determined based on the slope and the second intercept of the second line. The pixel points corresponding to the coordinates that satisfy the expression of the second straight line are selected as candidate pixel points for the fourth pixel point and the fifth pixel point. From the candidate pixels of the fourth pixel and the fifth pixel, select two pixels on the second straight line located on both sides of the first intersection point as the fourth pixel and the fifth pixel.

9. The image interpolation method according to claim 5, wherein, Determining the coordinates of the fourth and fifth pixels in the original image located on the second straight line in the target coordinate system based on the slope and second intercept of the second straight line includes: The coordinates of the candidate pixel in the target coordinate system are determined based on the slope of the second line and the second intercept. The coordinates of the fourth and fifth pixels in the target coordinate system are determined based on the coordinates of the candidate pixels in the target coordinate system.

10. The image interpolation method according to claim 9, wherein, The step of determining the coordinates of the candidate pixel in the target coordinate system based on the slope of the second line and the second intercept includes: determining the coordinates of the first candidate pixel in the target coordinate system based on the slope of the second line and the second intercept, and determining the coordinates of the second candidate pixel and the third candidate pixel in the target coordinate system based on the coordinates of the first candidate pixel in the target coordinate system. Determining the coordinates of the fourth and fifth pixels in the target coordinate system based on the coordinates of the candidate pixels in the target coordinate system includes: determining the coordinates of the fourth pixel in the target coordinate system based on the coordinates of the first, second, and third candidate pixels in the target coordinate system; and determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth pixel in the target coordinate system.

11. The image interpolation method according to claim 10, wherein, Determining the coordinates of the first candidate pixel in the target coordinate system based on the slope of the second straight line and the second intercept includes at least one of the following: If at least one of the slopes m and n in the second straight line is 1, and the absolute value of m is greater than the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined to be (0, c1); where c1 = abs(n) × y1 + sign(n) × m × x1; (x1, y1) are the coordinates of the first pixel in the target coordinate system. If at least one of m and n in the slope of the second straight line is 1, and the absolute value of m is less than or equal to the absolute value of n, the coordinates of the first candidate pixel in the target coordinate system are determined to be (c1×sign(n), 0). If the absolute value of the difference between the absolute values ​​of m and n in the slope of the second straight line is 1, and the absolute value of m is greater than the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (c1×sign(n),-c1). If the absolute value of the difference between the absolute values ​​of m and n in the slope of the second straight line is 1, and the absolute value of m is less than or equal to the absolute value of n, then the coordinates of the first candidate pixel in the target coordinate system are determined to be (-c1×sign(n), c1). If the absolute value of the difference between the absolute values ​​of m and n in the slope of the second straight line is 3, the coordinates of the first candidate pixel in the target coordinate system are determined according to a pre-configured coordinate table.

12. The image interpolation method according to claim 10, wherein, Determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth pixel in the target coordinate system includes: The coordinates of the fourth pixel in the target coordinate system are translated by (n, -m) units to obtain the coordinates of the fourth candidate pixel in the target coordinate system. The coordinates of the fourth pixel in the target coordinate system are then translated by (-n, m) units to obtain the coordinates of the fifth candidate pixel in the target coordinate system. The coordinates of the fifth pixel in the target coordinate system are determined based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system.

13. The image interpolation method according to claim 12, wherein, Determining the coordinates of the fifth pixel in the target coordinate system based on the coordinates of the fourth candidate pixel in the target coordinate system and the coordinates of the fifth candidate pixel in the target coordinate system includes at least one of the following: If the absolute value of the fourth coordinate is greater than the absolute value of the fifth coordinate, the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fifth candidate pixel in the target coordinate system; wherein, the absolute value of the fourth coordinate is the sum of the absolute values ​​of the x-coordinate and y-coordinate of the fourth candidate pixel in the target coordinate system, and the absolute value of the fifth coordinate is the sum of the absolute values ​​of the x-coordinate and y-coordinate of the fifth candidate pixel in the target coordinate system; If the absolute value of the fourth coordinate is less than the absolute value of the fifth coordinate, the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fourth candidate pixel in the target coordinate system. When the absolute value of the fourth coordinate is equal to the absolute value of the fifth coordinate, and the maximum value of the first coordinate is greater than the maximum value of the second coordinate, the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fifth candidate pixel in the target coordinate system; wherein, the maximum value of the first coordinate is the maximum value of the x and y coordinates of the fourth candidate pixel in the target coordinate system, and the maximum value of the second coordinate is the maximum value of the x and y coordinates of the fifth candidate pixel in the target coordinate system; If the absolute value of the fourth coordinate is equal to the absolute value of the fifth coordinate, and the maximum value of the first coordinate is less than the maximum value of the second coordinate, then the coordinates of the fifth pixel in the target coordinate system are determined to be the coordinates of the fourth candidate pixel in the target coordinate system.

14. The image interpolation method according to claim 4, wherein, The step of determining the pixel value of the second intersection point of the third line and the perpendicular line based on the slope and third intercept of the third line, and the slope and fourth intercept of the perpendicular line includes: The coordinates of the sixth and seventh pixels in the original image located on the third line in the target coordinate system are determined based on the slope and the third intercept of the third line; wherein the sixth and seventh pixels are located on both sides of the second intersection point; The coordinates of the second intersection point in the target coordinate system are determined based on the slope and third intercept of the third straight line, and the slope and fourth intercept of the perpendicular line. The pixel values ​​of the sixth pixel and the seventh pixel are determined based on their coordinates in the target coordinate system. The pixel value of the second intersection point is determined based on the pixel values ​​of the sixth and seventh pixels and the coordinates of the second intersection point in the target coordinate system.

15. The image interpolation method according to claim 1, wherein, The step of correcting the original pixel values ​​of the pixel to be interpolated to obtain the intermediate pixel values ​​of the pixel to be interpolated in the target image includes: The original pixel value of the pixel to be interpolated is compared with the pixel value of the pixel to be interpolated calculated using the traditional interpolation method. If the difference between the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the traditional interpolation method is greater than or equal to a preset threshold, the intermediate pixel value of the pixel to be interpolated is determined based on the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the traditional interpolation method. If the difference between the original pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the traditional interpolation method is greater than or equal to a preset threshold, the intermediate pixel value of the pixel to be interpolated is determined based on the original pixel value of the pixel to be interpolated.

16. The image interpolation method according to claim 1, wherein, The step of determining the final pixel value of the pixel to be interpolated based on the directional reliability of the first pixel, the intermediate pixel value of the pixel to be interpolated, and the pixel value of the pixel to be interpolated calculated using a traditional interpolation method includes: Using the directional reliability of the first pixel as a weight, the weighted average of the intermediate pixel value of the pixel to be interpolated and the pixel value of the pixel to be interpolated calculated using the traditional interpolation method is used as the final pixel value of the pixel to be interpolated.

17. An image interpolation apparatus, comprising: The coordinate transformation module is used to convert the first coordinate of the pixel to be interpolated in the target image coordinate system into the second coordinate in the original image coordinate system. The orientation calculation module is used to determine the orientation value and orientation reliability of the first pixel point corresponding to the second coordinate in the original image; The interpolation module is used to determine the final pixel value of the pixel to be interpolated based on the direction value and direction reliability of the first pixel. The step of determining the final pixel value of the pixel to be interpolated based on the direction value and direction reliability of the first pixel includes: determining the original pixel value of the pixel to be interpolated based on the direction value of the first pixel; correcting the original pixel value of the pixel to be interpolated to obtain the intermediate pixel value of the pixel to be interpolated in the target image; and determining the final pixel value of the pixel to be interpolated based on the direction reliability of the first pixel, the intermediate pixel value of the pixel to be interpolated, and the pixel value of the pixel to be interpolated calculated using a traditional interpolation method.

18. An electronic device comprising: At least one processor; A memory storing at least one program that, when executed by the at least one processor, implements the image interpolation method according to any one of claims 1-16.

19. A computer-readable medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the image interpolation method according to any one of claims 1-16.

Citation Information

Patent Citations

  • An image enlargement method and an image enlargement apparatus

    CN109325909A

  • High-spatial-resolution remote sensing image processing method and system and storage medium

    CN115187545A