Two-dimensional interpolation calculation method, system and terminal

By calculating the light intensity data in the frame area and building a two-dimensional array of coefficients, the problems of low efficiency and insufficient accuracy of two-dimensional interpolation calculation are solved, and efficient and accurate interpolation calculation is achieved, which is suitable for a variety of data types.

CN119379535BActive Publication Date: 2025-05-23HUAXINCHENG (HANGZHOU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411961339.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-23
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

In the prior art, the two-dimensional interpolation calculation efficiency is low and the accuracy is insufficient, especially when processing a large number of data points, the computing time and resource requirements have increased sharply, which affects the real-time nature of the algorithm and the application potential of high-resolution image processing.

Method used

By calculating the light intensity data of each pixel area in the frame area, a coefficient two-dimensional array is constructed for saving the coefficients of each pixel area. For pixel areas where coefficients have not been calculated, their coefficients are calculated and saved, and then used to accurately calculate the interpolation result of the interpolation point.

Benefits of technology

It significantly improves the efficiency and accuracy of two-dimensional interpolation calculations, ensures that the calculation performance is improved without reducing the accuracy of the original algorithm, and has good versatility and is suitable for interpolation calculation requirements of various data types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379535B_ABST
    Figure CN119379535B_ABST
Patent Text Reader

Abstract

The present invention provides a two-dimensional interpolation calculation method, system and terminal. By calculating the light intensity data of each pixel point in the frame area, and according to the matrix layout of the pixel area in the frame, a two-dimensional coefficient array is constructed to store the coefficient of each pixel area. During the processing, it is first checked whether the pixel area corresponding to the current interpolation point input has been calculated for the coefficient. If not, the coefficient of the pixel area is calculated immediately and stored in the corresponding position of the two-dimensional coefficient array. If the coefficient has been calculated, the interpolation result of the current interpolation point is accurately calculated according to the coefficient of the pixel area to which the current interpolation point belongs in the two-dimensional coefficient array. On the basis of ensuring that the accuracy of the original algorithm is not reduced, the present invention significantly improves the efficiency and accuracy of the two-dimensional interpolation calculation, and at the same time has good versatility and can adapt to the interpolation calculation requirements of various data types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of semiconductor technology, and in particular to a two-dimensional interpolation calculation method, system and terminal. Background Art

[0002] There are two important processes in the photolithography process, namely the optical process and the chemical process. The optical process is that light is irradiated on the mask and diffracted, and the diffraction orders are collected by the projection lens and converged on the surface of the photoresist. The chemical process is that the image projected on the photoresist stimulates a photochemical reaction, and after baking, the photoresist is partially soluble in the developer. Computational lithography is a technology that uses computers to simulate and simulate the optical and chemical processes in the photolithography process. Its main purpose is to increase the photolithography resolution and process window through theoretical exploration, and to guide the optimization of process parameters.

[0003] After sampling and quantizing the continuous image, it is important to calculate the value of the original continuous image at any desired coordinate. The process of calculating the value of I(x, y) at a location different from the sampling point is called interpolation. Interpolation is suitable for the choice of sampling distances Δx, Δy. Experimental results show that the maximum sampling distance is a function of the image bandwidth, and these values ​​represent an extension of Shannon's sampling theory originally introduced for time sampling. For now, we will assume that the sampling distances Δx, Δy are small enough so that such samples can represent the image well. Since the intensity function is sampled along two-dimensional coordinates, we first study the interpolation method for the next-dimensional sampling. For simplicity, we use a sampling interval of 1.

[0004] Linear interpolation is a slightly more complex interpolation, with improved results. If for nearest neighbor interpolation we need one sample, for linear interpolation we use two samples to calculate the interpolated value at a new position. In this case, the expression of the interpolation function is:

[0005] ,in ; (1)

[0006] Generalize to two dimensions. Specifically, it consists of two components: interpolation in the x direction and interpolation in the y direction. For two-dimensional linear interpolation (bilinear), we get:

[0007] ; (2)

[0008] in, and are the coordinates of the interpolation points.

[0009] However, the two-dimensional interpolation algorithm has significant shortcomings in terms of computational efficiency. When the number of data points to be processed is huge, the computational time and resources required for interpolation calculations will increase dramatically, which not only affects the real-time performance of the algorithm, but also limits its application potential in high-resolution image processing. Summary of the invention

[0010] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a two-dimensional interpolation calculation method, system and terminal, which are used to solve the technical problems of low efficiency and low accuracy of interpolation calculation based on sampling point data in the prior art.

[0011] To achieve the above-mentioned purpose and other related purposes, the present invention provides a two-dimensional interpolation calculation method, which includes: calculating the light intensity data of each pixel area in the frame area; wherein each pixel area is arranged in a matrix form in the frame area; based on the arrangement of the pixel areas in the frame area, constructing a coefficient two-dimensional array for storing the coefficients of each pixel area; determining whether the pixel area where the current interpolation point of the input is located has calculated the coefficients, and if the coefficients have not been calculated, calculating the coefficients of the corresponding pixel area and saving them to the corresponding positions of the coefficient two-dimensional array; calculating the interpolation of the current interpolation point based on the coefficients of the pixel area where the current interpolation point is located in the coefficient two-dimensional array.

[0012] In one embodiment of the present invention, based on the pixel area arrangement in the frame area, constructing a coefficient two-dimensional array for storing the coefficients of each pixel area includes: based on the pixel area arrangement in the frame area, constructing a coefficient two-dimensional array and a coefficient flag field two-dimensional array, and allocating memory for the coefficient two-dimensional array and the coefficient flag field two-dimensional array; wherein the coefficient two-dimensional array is used to store 16 coefficients of each pixel area according to the pixel area arrangement; the coefficient flag field two-dimensional array is used to store the coefficient flag value of each pixel area according to the pixel area arrangement.

[0013] In one embodiment of the present invention, the coefficient flag value is set to an uncalculated flag value when the coefficient of the corresponding pixel area has not been calculated, and is set to a calculated flag value when the coefficient of the corresponding pixel area has been calculated.

[0014] In one embodiment of the present invention, the step of determining whether the pixel region where the current interpolation point is located has calculated coefficients, and calculating the coefficients of the corresponding pixel region if the coefficients have not been calculated, and saving them to the corresponding position of the coefficient two-dimensional array includes: rounding the horizontal coordinate and the vertical coordinate of the current interpolation point to determine whether the current interpolation point is within the frame region, and if it is determined to be within the frame region, determining the pixel region where the current interpolation point is located; determining whether the pixel region where the current interpolation point is located has calculated coefficients based on the coefficient flag field two-dimensional array, and calculating the coefficients of the corresponding pixel region if the coefficients have not been calculated, and saving them to the corresponding position of the coefficient two-dimensional array, and updating the coefficient flag value of the corresponding pixel region in the coefficient flag field two-dimensional array.

[0015] In one embodiment of the present invention, the method for calculating the coefficients of the pixel area includes: defining a Left matrix and a Right matrix; calculating a derivative value based on the light intensity data of each intersection near the current interpolation point to form an F matrix; calculating the coefficient matrix corresponding to the current interpolation point based on the Left matrix, the Right matrix and the F matrix, and using it as the coefficient matrix corresponding to the pixel area; wherein the coefficient matrix is ​​a 4×4 matrix.

[0016] In one embodiment of the present invention, the interpolation of the current interpolation point is calculated based on the coefficients of the pixel points corresponding to the current interpolation point in the two-dimensional coefficient array, including: calculating the offset of the current interpolation point relative to the pixel area where it is located; based on the offset of the current interpolation point relative to the pixel area where it is located and the coefficient matrix of the corresponding pixel area, calculating the interpolation of the current interpolation point.

[0017] In one embodiment of the present invention, if interpolation calculation needs to be performed on interpolation points of multiple frame regions, a memory pool is used to store a two-dimensional array of coefficients.

[0018] In one embodiment of the present invention, calculating the light intensity data of each pixel region in the frame region includes: calculating the light intensity data of each pixel region by using an optical intensity simulation calculation formula.

[0019] To achieve the above-mentioned purpose and other related purposes, the present invention provides a two-dimensional interpolation calculation system, which includes: a light intensity calculation module, which is used to calculate the light intensity data of each pixel area in the frame area; wherein each pixel area is arranged in a matrix form in the frame area; a coefficient two-dimensional array construction module, which is connected to the light intensity calculation module and is used to construct a coefficient two-dimensional array for storing the coefficients of each pixel area based on the arrangement of the pixel areas in the frame area; a coefficient judgment and calculation module, which is connected to the coefficient two-dimensional array construction module and is used to determine whether the pixel area where the current interpolation point is input has been calculated for the coefficient, and if the coefficient has not been calculated, calculate the coefficient of the corresponding pixel area and save it to the corresponding position of the coefficient two-dimensional array; an interpolation calculation module, which is connected to the coefficient judgment and calculation module and is used to calculate the interpolation of the current interpolation point based on the coefficient of the pixel area where the current interpolation point is located in the coefficient two-dimensional array.

[0020] To achieve the above-mentioned purpose and other related purposes, the present invention provides an electronic terminal, comprising: one or more memories and one or more processors; the one or more memories are used to store computer programs; the one or more processors are connected to the memories and are used to run the computer program to execute the two-dimensional interpolation calculation method.

[0021] As described above, the present invention is a two-dimensional interpolation calculation method, system and terminal, which have the following beneficial effects: the present invention calculates the light intensity data of each pixel point in the frame area, and constructs a two-dimensional coefficient array according to the matrix layout of the pixel area in the frame to store the coefficient of each pixel area. During the processing, first check whether the pixel area corresponding to the current interpolation point input has calculated the coefficient. If not, calculate the coefficient of the pixel area immediately and store it in the corresponding position of the two-dimensional coefficient array. If the coefficient has been calculated, the interpolation result of the current interpolation point is accurately calculated according to the coefficient of the pixel area to which the current interpolation point belongs in the two-dimensional coefficient array. On the basis of ensuring that the accuracy of the original algorithm is not reduced, the present invention significantly improves the efficiency and accuracy of the two-dimensional interpolation calculation, and at the same time has good versatility and can adapt to the interpolation calculation requirements of various data types. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic flow chart of a two-dimensional interpolation calculation method in one embodiment of the present invention.

[0023] Figure 2 It is a schematic diagram showing the offset of the interpolation point in the pixel area according to an embodiment of the present invention.

[0024] Figure 3 Shown is a schematic structural diagram of a two-dimensional interpolation calculation system in one embodiment of the present invention.

[0025] Figure 4 Shown is a schematic structural diagram of an electronic terminal in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0027] It should be noted that in the following description, reference is made to the accompanying drawings, which describe several embodiments of the present invention. It should be understood that other embodiments may also be used, and that mechanical composition, structure, electrical and operational changes may be made without departing from the spirit and scope of the present invention. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present invention is limited only by the claims of the published patents. The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between an element or feature shown in the figure and another element or feature.

[0028] Throughout the specification, when a part is said to be "connected" to another part, this includes not only the case of "direct connection" but also the case of "indirect connection" by placing other elements therebetween. In addition, when a part is said to "include" a certain constituent element, unless otherwise stated, it does not exclude other constituent elements, but means that other constituent elements may be included.

[0029] The terms first, second and third mentioned herein are used to describe various parts, components, regions, layers and / or segments, but are not limited thereto. These terms are only used to distinguish a certain part, component, region, layer or segment from other parts, components, regions, layers or segments. Therefore, the first part, component, region, layer or segment described below may refer to the second part, component, region, layer or segment within the scope of the present invention.

[0030] Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless there is an indication to the contrary in the context. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "A, B or C" or "A, B and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C". Exceptions to this definition will only occur when the combination of elements, functions or operations is inherently mutually exclusive in some way.

[0031] The present invention provides a two-dimensional interpolation calculation method, which calculates the light intensity data of each pixel point in the frame area, and constructs a two-dimensional coefficient array according to the matrix layout of the pixel area in the frame to store the coefficient of each pixel area. During the processing, first check whether the pixel area corresponding to the current interpolation point input has been calculated. If not, the coefficient of the pixel area is calculated immediately and stored in the corresponding position of the two-dimensional coefficient array. If the coefficient has been calculated, the interpolation result of the current interpolation point is accurately calculated according to the coefficient of the pixel area to which the current interpolation point belongs in the two-dimensional coefficient array. On the basis of ensuring that the accuracy of the original algorithm is not reduced, the present invention significantly improves the efficiency and accuracy of the two-dimensional interpolation calculation, and at the same time has good versatility and can adapt to the interpolation calculation requirements of various data types.

[0032] The following is a detailed description of the embodiments of the present invention with reference to the accompanying drawings so that those skilled in the art can easily implement the present invention. The present invention can be embodied in many different forms and is not limited to the embodiments described herein.

[0033] like Figure 1 A schematic flow chart showing a two-dimensional interpolation calculation method in an embodiment of the present invention.

[0034] The method comprises:

[0035] Step S1: Calculate the light intensity data of each pixel area in the frame area.

[0036] In detail, first, it is necessary to clarify the size and shape of the frame area, which is usually determined by the parameters of the lithography machine and the design of the mask. The frame area can be regarded as a two-dimensional plane. The pixel areas are arranged in a matrix form in the frame area; the frame area is provided with N pixel areas in the horizontal direction and M pixel areas in the vertical direction, forming a matrix of N rows and M columns. Calculate the light intensity data of N×M pixel areas. The calculated light intensity data can be stored in a two-dimensional array, each element of which corresponds to the light intensity value of a pixel area.

[0037] In one embodiment, calculating the light intensity data of each pixel region in the frame region includes: calculating the light intensity data of each pixel region by an optical intensity simulation calculation formula; preferably, using a physical simulation method, such as finite element analysis (FEA) or finite difference time domain (FDTD) method, and simulating the propagation and interaction of light in the mask and the imaging system according to the shape of the mask, the light intensity data of each pixel region can be calculated. The simulation result is a two-dimensional light intensity distribution map, in which each pixel region has a corresponding light intensity value, and these data are usually stored in the form of a matrix or array, in which each element represents the light intensity value of a pixel region.

[0038] Step S2: Based on the arrangement of pixel regions in the frame region, a two-dimensional coefficient array for storing coefficients of each pixel region is constructed.

[0039] In one embodiment, step S2 includes: constructing a coefficient two-dimensional array and a coefficient flag field two-dimensional array based on the pixel area arrangement in the frame area, and allocating memory for the coefficient two-dimensional array and the coefficient flag field two-dimensional array; wherein the coefficient two-dimensional array is used to store 16 coefficients of each pixel area according to the pixel area arrangement; the coefficient flag field two-dimensional array is used to store the coefficient flag value of each pixel area according to the pixel area arrangement.

[0040] Specifically, first determine the number of pixel regions N in the horizontal direction and the number of pixel regions M in the vertical direction within the frame region. Define a coefficient of the template type coeff_t. This template can accept different data types as parameters when instantiated. It can be float, double, or complex. <float>Etc. By using templates, coeff_t can be used flexibly in different contexts. Whether single-precision floating-point numbers, double-precision floating-point numbers or complex numbers are required, they can be achieved by specifying specific types. Next, allocate memory for the coefficient two-dimensional array m_coefficients. Each pixel area needs to save 16 coefficients, and the total memory size is N×M×sizeof(coeff_t). Sizeof(coeff_t) contains the memory for 16 coefficients. You can choose malloc, new or memory pool to allocate memory. malloc is a memory allocation function provided by the C language standard library. It can also be used in C++, but the release of memory needs to be managed manually. new is an operator in C++ that is used to dynamically allocate memory for an object and automatically calls the object's constructor. Memory pool is a memory management technique that pre-allocates a large block of memory and allocates small blocks of memory from it to requests, which can reduce memory fragmentation and improve memory allocation efficiency.

[0041] It is also necessary to construct a two-dimensional array of coefficient flag fields. Since the frame area has N pixel areas in the horizontal direction and M pixel areas in the vertical direction, an N times M two-dimensional array is required to store the coefficient flag values. The coefficient flag value is a Boolean value used to indicate whether the coefficient of the corresponding pixel area has been calculated. Therefore, the type of each flag bit is bool. The total memory requirement of the two-dimensional array of coefficient flag fields is N times M times the size of a bool type, that is, N×M×sizeof(bool). Here, sizeof(bool) refers to the coefficient flag value of the pixel area.

[0042] In a specific embodiment, the coefficient flag value is set to an uncalculated flag value when the coefficient of the corresponding pixel area has not been calculated, and is set to a calculated flag value when the coefficient of the corresponding pixel area has been calculated; specifically, if the coefficient flag value of the pixel area is false, it means that the coefficient of the pixel area has not been calculated. If the coefficient flag value of the pixel area is true, it means that the coefficient of the pixel area has been calculated. At the beginning of the program, after the coefficient flag field two-dimensional array m_coeff_flag array is allocated memory, it needs to be initialized. All elements in the coefficient flag field two-dimensional array m_coeff_flag are set to false, which means that in the initial state, no coefficient of any pixel area has been calculated.

[0043] In one embodiment, if interpolation calculations need to be performed on multiple frame regions, a memory pool is used to store coefficients. The memory pool can reduce memory fragmentation caused by frequent memory application and release, and reduce calls to the operating system memory manager, because the memory is pre-allocated when the program starts or at a specific time, and the memory used by one frame can be quickly reused by the next frame without releasing and reapplying for memory every time.

[0044] Step S3: Determine whether the pixel area where the current interpolation point is input has calculated coefficients, and if the coefficients have not been calculated, calculate the coefficients of the corresponding pixel area and save them to the corresponding position of the coefficient two-dimensional array.

[0045] In one embodiment, step S3 includes:

[0046] Assume that the pixel step of each pixel region is 1, which can simplify the calculation. If the actual pixel step is not 1, a simple conversion can be used to adapt to this situation. The frame region is provided with N pixel regions in the horizontal direction and M pixel regions in the vertical direction, forming a matrix of N rows and M columns.

[0047] The coordinates (x, y) of the current interpolation point are rounded to the integer values ​​i and j of the horizontal coordinate x and the vertical coordinate y of the previous interpolation point. The rounded coordinates i and j are determined to be within the range of 0 to N-1 and 0 to M-1 respectively. If not within this range, it means that the current interpolation point exceeds the boundary of the frame area; if the interpolation point is within the frame area, the pixel area where it is located is determined based on i and j.

[0048] Use the coefficient flag field two-dimensional array m_coeff_flag to determine whether the coefficient of the current pixel area has been calculated. Check the value of m_coeff_flag[i][j]: If it is false, it means that the coefficient of the pixel area has not been calculated yet, and the coefficient of the pixel area needs to be calculated and saved to the corresponding position of the coefficient two-dimensional array and the coefficient flag value of the corresponding pixel area in the coefficient flag field two-dimensional array is updated to true. If it is true, it means that the coefficient of the pixel area has been calculated, and the stored coefficient can be directly used for the next interpolation calculation.

[0049] The use of two-dimensional arrays allows the interpolation algorithm of the present invention to be used in multiple threads, and the memory is allocated in advance, so that each thread does not interfere with each other. If map, vector, list and other types are used to save the coefficient list, if the amount of interpolation data is large, it is easy to cause repeated memory allocation, resulting in performance degradation. Moreover, if the memory is dynamically allocated, the problem of locks must be considered in multiple threads, which will also cause performance degradation. In order to save a little bit of memory, it is not worth the loss. After evaluation and actual testing, the memory usage is not large. For example, for a frame size of 1k×1k, the memory to be allocated is alloc_mem = 1k×1k×sizeof(coeff_t) = 1k×1k×16×sizeof(T) = 16M×sizeof(T). If the float type is used, the memory only occupies alloc_mem=16M×4 = 64M.

[0050] Once the coefficients of a pixel area are calculated and saved, these coefficients can be reused by all interpolation points in the pixel area. This means that as long as the coefficients of the pixel area are calculated once, any subsequent interpolation points in the area can directly use these coefficients for interpolation calculation without having to calculate again. When the amount of data is very large, this method avoids repeated coefficient calculations for multiple interpolation points in the same pixel area, significantly improving the calculation efficiency, especially when the interpolation points in the pixel area are dense or the amount of data is very large. If multiple interpolation points need to be interpolated, use a loop to calculate each interpolation point.

[0051] In a specific embodiment, the method of calculating the coefficient of the pixel area includes:

[0052] Define the Left matrix and the Right matrix; the Left matrix and the Right matrix are known 4×4 matrices, which are used as fixed matrices in coefficient calculation.

[0053] Among them, the Left matrix is ​​defined as:

[0054] ; (3)

[0055] The Right matrix is ​​defined as:

[0056] ; (4)

[0057] A derivative value is calculated based on the light intensity data of each intersection near the current interpolation point to form an F matrix; the F matrix is ​​a 4×4 matrix, and its elements are the derivative values ​​(derivative) calculated based on the light intensity data of each intersection near the current interpolation point.

[0058] First, determine the four intersection points near the current interpolation point. These intersection points are usually pixel points. Obtain the light intensity data of the corresponding pixel points calculated in step S1. For each intersection point, use its light intensity data to calculate the derivative value. Once the derivative value is calculated for each intersection point, these values ​​can be organized into a 4×4 F matrix. Each column of the F matrix corresponds to a derivative value vector of an intersection point.

[0059] Once the F matrix is ​​constructed, it can be used to calculate the coefficients of the interpolation points.

[0060] By multiplying the F matrix with the Left and Right matrices, the coefficient matrix of the pixel area where the current interpolation point is located can be obtained, and these coefficients will be used for interpolation calculations.

[0061] Before calculating the coefficients, you need to determine the index number of the pixel area where the current interpolation point is located: calculate its index number index in the two-dimensional array based on the horizontal coordinate i and vertical coordinate j of the current pixel area. If the number of rows in the array is N and the number of columns is M, the index number calculation formula is index=j×N+i.

[0062] The 16 coefficients finally calculated are stored in a two-dimensional array 4×4:

[0063] m_coeffients[index] = Left ×F × Right; (5)

[0064] Step S4: Calculate the interpolation value of the current interpolation point based on the coefficients of the pixel area where the current interpolation point is located in the two-dimensional coefficient array.

[0065] In one embodiment, high-order interpolation includes nearest neighbor interpolation and linear interpolation. Both methods essentially fit a 0th degree (nearest neighbor) and 1st degree (linear) polynomial to some samples. New sample values ​​are calculated as the fitted polynomial calculated at the new sample position of interest. For example, cubic interpolation refers to fitting a 3rd degree polynomial of the form:

[0066] ,in ; (6)

[0067] The bicubic interpolation algorithm that is more commonly used in the industry now belongs to cubic interpolation (which can be understood as a derivative smoothing interpolation algorithm) from the perspective of pure mathematical numerical analysis. The gray value of the sampling point is calculated based on the bilinear relationship between the 16 pixel values ​​around the sampling point and the pixel change rate.

[0068] If the interpolation algorithm used in this solution is a bicubic interpolation algorithm, the interpolation of the current interpolation point is calculated based on the coefficient of the pixel point corresponding to the current interpolation point in the coefficient two-dimensional array, including:

[0069] Calculate the offset of the current interpolation point relative to the pixel region where it is located; specifically, determine the coordinates x and y of the current interpolation point, and the integer coordinates i and j of the pixel region where it is located. Figure 2 , calculate the offset dx and dy of the current interpolation point relative to the pixel area where it is located, that is, dx = x - i and dy = y - j. Since the size of each pixel area is assumed to be 1, the values ​​of dx and dy are in the range of 0 to 1 respectively.

[0070] Based on the offset of the current interpolation point relative to the pixel region where it is located and the coefficient matrix of the corresponding pixel region, the interpolation value of the current interpolation point is calculated. Specifically, based on the adopted interpolation algorithm, offset vectors DX and DY are constructed: DX is the power vector of dx, and Dy is the power vector of dy, and the interpolation value of the current interpolation point is calculated using matrix multiplication.

[0071] The constructed power vector DX of dx and the power vector Dy of dy are:

[0072] (7)

[0073] ; (8)

[0074] Matrix multiplication methods include:

[0075] ; (9)

[0076] Where P(x, y) is the interpolation value of the current interpolation point (x, y), and m_coefficients[index] is the coefficient matrix of the pixel area where the current interpolation point is located. The bicubic interpolation algorithm can obtain a smooth and accurate interpolation result by using the values ​​of the surrounding 16 pixels and the corresponding coefficient matrix.

[0077] In a specific embodiment, based on the bicubic interpolation algorithm, some other interpolation algorithms are derived, such as the Akima interpolation algorithm, which is another method for smooth interpolation on discrete data points, especially when processing data with curvature. It was proposed by Japanese scientist Hiroshi Akima in 1970. Its core idea is to approximate the curve between data points by constructing a quartic polynomial to ensure that the first-order and second-order derivatives at each data point are continuous, thereby achieving a smooth interpolation result.

[0078] In addition to using the bicubic interpolation algorithm, this solution can also use the Akima interpolation algorithm for interpolation calculation, perform unified calculation of coefficients in advance, and accelerate interpolation performance. The present invention also supports other derivative algorithms of the bicubic interpolation algorithm.

[0079] It should be noted that the present invention can be implemented using C++ language or other development languages, without limitation thereto.

[0080] Similar to the principle of the above embodiment, the present invention provides a two-dimensional interpolation calculation system.

[0081] The following provides specific embodiments in conjunction with the accompanying drawings:

[0082] like Figure 3 A schematic structural diagram of a two-dimensional interpolation calculation system in an embodiment of the present invention is shown.

[0083] The system comprises:

[0084] The light intensity calculation module 1 is used to calculate the light intensity data of each pixel area in the frame area; wherein each pixel area is arranged in a matrix form in the frame area;

[0085] A coefficient two-dimensional array construction module 2, connected to the light intensity calculation module 1, is used to construct a coefficient two-dimensional array for storing coefficients of each pixel area based on the arrangement of pixel areas in the frame area;

[0086] A coefficient judgment and calculation module 3, connected to the coefficient two-dimensional array construction module 2, is used to determine whether the pixel area where the current interpolation point is input has been calculated with coefficients, and calculate the coefficients of the corresponding pixel area if the coefficients have not been calculated, and save them to the corresponding position of the coefficient two-dimensional array;

[0087] The interpolation calculation module 4 is connected to the coefficient judgment and calculation module 3 and is used to calculate the interpolation value of the current interpolation point based on the coefficient of the pixel area where the current interpolation point is located in the coefficient two-dimensional array.

[0088] Since the implementation principle of the two-dimensional interpolation calculation system has been described in the above-mentioned embodiment, it will not be repeated here.

[0089] The two-dimensional interpolation calculation method provided in the embodiment of the present invention can be implemented on the terminal side or the server side. As for the hardware structure of the electronic terminal, please refer to Figure 4 , is an optional hardware structure diagram of an electronic terminal 1000 provided in an embodiment of the present invention. The terminal 1000 may be a mobile phone, a computer device, a tablet device, a personal digital processing device, a factory background processing device, etc. The terminal 1000 includes: at least one processor 1001, a memory 1002, at least one network interface 10010 and a user interface 1009. The various components in the device are coupled together through a bus system 1005. It can be understood that the bus system 1005 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1005 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, in Figure 4 In the specification, various buses are labeled as bus systems.

[0090] The user interface 1009 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.

[0091] It is understood that the memory 1002 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), which is used as an external cache. By way of exemplary but not limiting explanation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.

[0092] The memory 1002 in the embodiment of the present invention is used to store various categories of data to support the operation of the terminal 1000. Examples of these data include: any executable program for operating on the terminal 1000, such as an operating system 10021 and an application 10022; the operating system 10021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 10022 may include various applications, such as a media player (MediaPlayer), a browser (Browser), etc., for implementing various application services. The two-dimensional interpolation calculation method provided in the embodiment of the present invention may be included in the application 10022.

[0093] The method disclosed in the above embodiment of the present invention can be applied to the processor 1001, or implemented by the processor 1001. The processor 1001 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 1001 or the instruction in the form of software. The above processor 1001 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 1001 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The processor 1001 may be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0094] In an exemplary embodiment, the terminal 1000 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD) to execute the aforementioned method.

[0095] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0096] In the embodiments provided in the present application, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store the desired program code in the form of an instruction or data structure and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, a server or other remote source using a coaxial cable, an optical fiber cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, optical fiber cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals, or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.

[0097] The advantages of the present invention over the prior art include the following:

[0098] 1. Significant performance improvement: According to actual application tests, the performance is more than doubled when running with a large amount of interpolation data. The larger the amount of interpolation data, the more obvious the performance improvement.

[0099] 2. Good algorithm versatility: supports bicubic interpolation algorithm and various derivative algorithms, such as Akima interpolation algorithm.

[0100] 3. After using C++ template technology, it can adapt to interpolation calculations of various data types. For example, float, double, and complex <float>,complex <double>wait.

[0101] In summary, the two-dimensional interpolation calculation method, system and terminal of the present invention calculate the light intensity data of each pixel point in the frame area, and construct a two-dimensional coefficient array according to the matrix layout of the pixel area in the frame to store the coefficient of each pixel area. During the processing, first check whether the pixel area corresponding to the current interpolation point input has calculated the coefficient. If not, the coefficient of the pixel area is calculated immediately and stored in the corresponding position of the two-dimensional coefficient array. If the coefficient has been calculated, the interpolation result of the current interpolation point is accurately calculated according to the coefficient of the pixel area to which the current interpolation point belongs in the two-dimensional coefficient array. On the basis of ensuring that the accuracy of the original algorithm is not reduced, the present invention significantly improves the efficiency and accuracy of the two-dimensional interpolation calculation, and at the same time has good versatility and can adapt to the interpolation calculation requirements of various data types. Therefore, the present invention effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0102] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.< / double> < / float> < / float>

Claims

1. A two-dimensional interpolation calculation method, characterized in that: The method comprises: Calculate the light intensity data of each pixel area in the frame area; wherein each pixel area is arranged in a matrix form in the frame area; Based on the arrangement of pixel regions in the frame region, construct a coefficient two-dimensional array for storing coefficients of each pixel region, including: based on the arrangement of pixel regions in the frame region, construct a coefficient two-dimensional array and a coefficient flag field two-dimensional array, and allocate memory for the coefficient two-dimensional array and the coefficient flag field two-dimensional array; wherein the coefficient two-dimensional array is used to store 16 coefficients of each pixel region according to the arrangement of pixel regions; the coefficient flag field two-dimensional array is used to store coefficient flag values ​​of each pixel region according to the arrangement of pixel regions; the coefficient flag value is set to an uncalculated flag value when the coefficient of the corresponding pixel region has not been calculated, and is set to a calculated flag value when the coefficient of the corresponding pixel region has been calculated; Determine whether the pixel area where the current interpolation point is input has calculated the coefficient, and if the coefficient has not been calculated, calculate the coefficient of the corresponding pixel area and save it to the corresponding position of the coefficient two-dimensional array, including: rounding the horizontal coordinate and the vertical coordinate of the current interpolation point to determine whether the current interpolation point is in the frame area, and if it is determined to be in the frame area, determine the pixel area where the current interpolation point is located; determine whether the pixel area where the current interpolation point is located based on the coefficient flag field two-dimensional array, calculate the coefficient of the corresponding pixel area if the coefficient has not been calculated, and save it to the corresponding position of the coefficient two-dimensional array and update the coefficient flag value of the corresponding pixel area in the coefficient flag field two-dimensional array; the method of calculating the coefficient of the pixel area includes: defining the Left matrix and the Right matrix; calculating a derivative value based on the light intensity data of each intersection near the current interpolation point to form an F matrix; calculating the coefficient matrix corresponding to the current interpolation point based on the Left matrix, the Right matrix and the F matrix, and using it as the coefficient matrix of the corresponding pixel area; wherein the coefficient matrix is ​​a 4*4 matrix; The interpolation value of the current interpolation point is calculated based on the coefficients of the pixel area where the current interpolation point is located in the coefficient two-dimensional array.

2. The two-dimensional interpolation calculation method according to claim 1, characterized in that: Calculating the interpolation value of the current interpolation point based on the coefficient of the pixel point corresponding to the current interpolation point in the coefficient two-dimensional array includes: Calculate the offset of the current interpolation point relative to the pixel area where it is located; The interpolation value of the current interpolation point is calculated based on the offset of the current interpolation point relative to the pixel region where the current interpolation point is located and the coefficient matrix of the corresponding pixel region.

3. The two-dimensional interpolation calculation method according to claim 1, characterized in that: If you need to perform interpolation calculations on interpolation points in multiple frame areas, use a memory pool to save a two-dimensional array of coefficients.

4. The two-dimensional interpolation calculation method according to claim 1, characterized in that: Calculating the light intensity data of each pixel region in the frame region includes: calculating the light intensity data of each pixel region by using an optical intensity simulation calculation formula.

5. A two-dimensional interpolation calculation system, characterized in that: The system comprises: A light intensity calculation module is used to calculate the light intensity data of each pixel area in the frame area; wherein each pixel area is arranged in a matrix form in the frame area; A coefficient two-dimensional array construction module is connected to the light intensity calculation module and is used to construct a coefficient two-dimensional array for storing coefficients of each pixel area based on the pixel area arrangement in the frame area, including: constructing a coefficient two-dimensional array and a coefficient flag field two-dimensional array based on the pixel area arrangement in the frame area, and allocating memory for the coefficient two-dimensional array and the coefficient flag field two-dimensional array; wherein the coefficient two-dimensional array is used to store 16 coefficients of each pixel area according to the pixel area arrangement; the coefficient flag field two-dimensional array is used to store coefficient flag values ​​of each pixel area according to the pixel area arrangement; the coefficient flag value is set to an uncalculated flag value when the coefficient of the corresponding pixel area has not been calculated, and is set to a calculated flag value when the coefficient of the corresponding pixel area has been calculated; A coefficient judgment and calculation module is connected to the coefficient two-dimensional array construction module, and is used to determine whether the pixel area where the current interpolation point is input has calculated the coefficient, and if the coefficient has not been calculated, calculate the coefficient of the corresponding pixel area, and save it to the corresponding position of the coefficient two-dimensional array, including: rounding the horizontal coordinate and the vertical coordinate of the current interpolation point to determine whether the current interpolation point is within the frame area, and if it is determined to be within the frame area, determine the pixel area where the current interpolation point is located; determine whether the pixel area where the current interpolation point is located has calculated the coefficient based on the coefficient flag field two-dimensional array, calculate the coefficient of the corresponding pixel area if the coefficient has not been calculated, and save it to the corresponding position of the coefficient two-dimensional array and update the coefficient flag value of the corresponding pixel area in the coefficient flag field two-dimensional array; the method of calculating the coefficient of the pixel area includes: defining the Left matrix and the Right matrix; calculating a derivative value based on the light intensity data of each intersection near the current interpolation point to form an F matrix; calculating the coefficient matrix corresponding to the current interpolation point based on the Left matrix, the Right matrix and the F matrix, and using it as the coefficient matrix of the corresponding pixel area; wherein the coefficient matrix is ​​a 4*4 matrix; The interpolation calculation module is connected to the coefficient judgment and calculation module and is used to calculate the interpolation value of the current interpolation point based on the coefficient of the pixel area where the current interpolation point is located in the coefficient two-dimensional array.

6. An electronic terminal, characterized in that: include: one or more memories and one or more processors; The one or more memories are used to store computer programs; The one or more processors, connected to the memory, are configured to run the computer program to perform the method according to any one of claims 1 to 4.