WO2009076816A1 - 一种对数字图像进行插值的方法及装置 - Google Patents

一种对数字图像进行插值的方法及装置 Download PDF

Info

Publication number
WO2009076816A1
WO2009076816A1 PCT/CN2008/073122 CN2008073122W WO2009076816A1 WO 2009076816 A1 WO2009076816 A1 WO 2009076816A1 CN 2008073122 W CN2008073122 W CN 2008073122W WO 2009076816 A1 WO2009076816 A1 WO 2009076816A1
Authority
WO
WIPO (PCT)
Prior art keywords
interpolation
matrix
spline
digital image
order
Prior art date
Application number
PCT/CN2008/073122
Other languages
English (en)
French (fr)
Inventor
Zhe Huang
Yi Wang
Yupeng Hu
Shuzhan Xu
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Publication of WO2009076816A1 publication Critical patent/WO2009076816A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for interpolating digital images. Background technique
  • a digital signal is a discrete representation of a continuous signal.
  • a digital image is luminance and chrominance digital information formed by continuous image information in nature, by means of sampling and quantization. The process transforms a continuous signal into a finite and determined signal. Discrete signals, the application of this digital technology to images, facilitates the storage and propagation of images.
  • the size of the image is different from the continuous signal, which is measured in units of pixels, that is, measured in units of image resolution. For example, 1024*768 usually means that the width of the image is 1024 pixels, and the height is 768. Pixels, if an image with this resolution is displayed on the display, each pixel corresponds to a display element in the display, so the image can be reproduced well.
  • Such a display usually has a serious drawback. If the display resolution of the display is different from the resolution of the image, a part of the displayed image may not be displayed or the displayed image may not occupy the screen of the display. For example: If the display resolution of the display is greater than the image resolution, the image cannot fill the screen of the display; if the display resolution of the display is less than the image resolution, a portion of the displayed image will not be displayed. In order to overcome these two problems, it is necessary to change the resolution of the image to the display image resolution of the display, which becomes an interpolation process of the digital image.
  • the interpolation processing of digital images is a kind of method which is widely used in digital image processing and has important application value.
  • the research on such methods has important engineering significance and application significance.
  • Interpolation of digital images can be analyzed from a variety of angles. The following is a one-dimensional case, from the perspective of numerical analysis.
  • the interpolation process is based on the coordinates and quantized values of the discrete signals, and is connected into a continuous curve. If the curve is re-sampled, the operation of ascending or descending samples can be completed, that is, the interpolation process is completed.
  • interpolation can enhance the corresponding digital image, and many of the samples are completed after the sample is removed. Therefore, the interpolation process can be processed as a variable sample rate process of the signal.
  • the first step is to represent the discrete signal as a continuous signal; the second step is to adjust the bandwidth of the signal; the third step is to sample the continuous signal at a new frequency, so that the signal becomes new.
  • a discrete signal of the sample frequency For the adjustment of the channel bandwidth in the second step, it is usually only for the signal with a reduced sample rate.
  • This patent application mainly relates to the discussion of the first step, that is, the discrete signal is converted into a continuous signal.
  • the interpolation involved in the patent application refers to the direct comparison of the continuous signal according to a certain frequency, and the interpolation process is a new sampling point. Numerical calculation method.
  • the discrete signal is represented as a mathematical form for analysis, and the signal sequence can be expressed as a function, wherein the abscissa represents the sequence order in which the signal appears, and the ordinate represents the amplitude of the signal, as shown in equation (1), where the formula (1)
  • the form is a discrete functional form, the first is the sequence order of the signal, and the second is the magnitude of the signal.
  • the first step of the interpolation process is to express the discrete value of the formula (1) by a continuous function (that is, as a sample point of the continuous function), which requires the following restrictions, that is, the interpolation is required to make the original
  • a continuous function that is, as a sample point of the continuous function
  • Equation (3) will be chosen as a polynomial or piecewise polynomial curve.
  • a polynomial has N+1 unknowns, which need to be determined by N+1 points. If a polynomial is determined from all the signals on the digital image, this operation is very large. For example, for 72 0 samples, a multiplication of 72 0X 72 0 is required, and all signal points need to be reread. Large amount;
  • polynomial interpolation has an essential defect: the oscillating Runge phenomenon, the high-order interpolation polynomial does not converge to the inserted function.
  • Equation (4) where each represents a function defined above and other intervals are 0. If the function is a cubic polynomial, it can determine the polynomial according to the four interpolation points of [ ⁇ ''- ⁇ ' ⁇ '' ⁇ ''+ ⁇ ' ⁇ '+ 2] , so that it can be obtained by successive calculations. The entire piecewise polynomial, this interpolation method is the Lagrangian interpolation principle.
  • each discontinuous cubic polynomial of Lagrangian interpolation is completely a function of the interpolation point function value [ l, Hl, ⁇ +2 ] , so if the interpolation position is determined, the shape of this function
  • the formula can be completely multiplied by a set of coefficients by [ -i ' Hi ' 2 ], which can be easily designed into the form of FIR (Finite Impulse Response) filter when signal processing is implemented. If we know the W different points of the polynomial and determine that a polynomial 3 "is the same as /( x ) at these points, then equation (4 ) can be uniquely written in the form of equation (5):
  • Equation (5) represents a -I order polynomial through a point The only way to determine the polynomial is to solve the above equation. You can use ( X ', ) to represent the coefficient. Actually, we can write the continuous polynomial into the form of equation (6) and formula (7): , formula (6)
  • Equation ( 7) According to the formula (6) and the formula (7), a polynomial curve through which the interpolation point is determined can be obtained.
  • This interpolation method also has some inherent defects: First, its overall piecewise polynomial can only guarantee continuity, and the derivative of the function may be discontinuous, which means that the obtained function may even be non-smooth, that is, a polynomial higher than 3 times. It is also impossible to avoid this defect.
  • the function in each segment of the interpolation is uniquely determined by many points around it. Especially in the high order, the function can guarantee a good overall characteristic. However, when the signal is unstable, it is not The combination of many related signals into a function is meaningless. It does not guarantee the local characteristics of the signal.
  • high-order Lagrangian interpolation also has an oscillation phenomenon called the Runge phenomenon. The reason is still that a ⁇ -order polynomial can be completely determined by W + 1 points. Compared to high-order Lagrangian interpolation, low-order spline insertion Values can alleviate these problems.
  • third-order spline and B-spline interpolation are considered when discussing spline interpolation, because spline interpolation is used to avoid the disadvantages of high-order Lagrangian interpolation, but it is not needed in practice. Too much high-order spline interpolation is used. Of course, another reason for using third-order spline interpolation is that it has a fast calculation method, chasing. On the basis of the Lagrangian interpolation of the cubic polynomial, in order to better reflect the local characteristics of the signal and ensure the smoothness of the image, the polynomial obtained three times at two points adjacent to the signal, plus the condition of the second derivative continuous, obtains three Order spline interpolation.
  • Equation (9) For the sake of simplicity, it is assumed that the processed signals are equally spaced, that is, for any interval, the interval is calculated by the second order of the interpolation signal at the interpolation point, and the formula (10) and the formula are obtained. 11) and formula (12) ⁇
  • Equation (21) uses the first-order continuous, for the piecewise function, the left and right limits for each interpolation point are the same, ie, equation (22):
  • Equation ( 22 ) applies the condition of equation (19) to the standard form, then gives the formula (23):
  • Equation ( 23 ) Equation (23) is the key formula for the third-order interpolation of the spline. It establishes the relationship between the derivative point and the signal value. The second derivative value can be obtained from the signal value. Therefore, the interpolation polynomial can be completely determined, and the formula (23) can be further reduced to obtain the formula (24).
  • formula (26) can be abbreviated as formula (27):
  • the B-spline interpolation calculation can use the recursive method, and the specific steps are as follows.
  • the ⁇ -order B _ spline is only non-zero in the L 2 ' 2 ′ interval; with zero as the symmetry function, the maximum at 0 is exponentially decayed to both sides; the integral of ( x ) is 1, J° ⁇ 2 ;
  • the matrix P can be quickly generated for interpolation calculation.
  • Use ⁇ ⁇ to perform interpolation that is, piecewise linear interpolation.
  • the basis function of the B-spline is shown in Figure 1.
  • the order is 1, 2, 3, and 4, the least rounded curve is the order 1, and so on.
  • the most rounded curve is the order n.
  • Lagrangian interpolation has a very efficient calculation method, the convergence is poor, especially the Runge phenomenon caused by high-order polynomial interpolation limits the application.
  • the use of third-order spline and B-spline interpolation can solve the problems of Lagrangian interpolation well, so it has a wider application.
  • third-order spline interpolation can be quickly used by catching method.
  • the operation, and B-spline interpolation can be quickly calculated using the pre-filtering method.
  • the spline function can also be used to perform fitting and interpolation calculation.
  • a method of least square fitting using B-spline is introduced.
  • k m
  • the least squares method is to make: take the smallest.
  • s is The least squares solution on m+1 nodes. Let... be a linearly independent function group, belonging to a polynomial whose order is less than or equal to n, and express s as: , ⁇ , --,
  • the algorithm for calculating the ⁇ -spline fitting or interpolation can be performed by the pre-filtering method, the calculation is simple, and the precision is guaranteed.
  • the exact fitting coefficient can be calculated.
  • the calculation steps can be used as follows:
  • the Lagrangian interpolation algorithm uses the Farrow structure for fast calculation.
  • An interpolation filter structure commonly used in interpolation algorithms is called # ⁇ Farrow structure.
  • the interpolation formula is as shown in (38). :
  • each interpolation polynomial ' ( x ) in equation (38) is a polynomial, they have the same form, such as four interpolation points of a cubic polynomial :
  • J (3 ⁇ 4 ⁇ ) c. + + c 2 x 2 + c 3 x 3
  • the fast calculation of interpolation can be performed using the catch-up method, as described in detail below.
  • Equation (42) notes that in the remaining equations, only the second equation contains the variable xl, so the elimination process can be simplified. Use equation (42) to convert the second equation to
  • Equation (43) sequentially processes each of the equations in equation (41) step by step, setting the first equation to have become
  • Equation (48) This system of equations is called a two-diagonal system of equations, and the non-zero elements in the coefficient matrix are step-by-step.
  • the fast calculation of B-spline interpolation is realized by the pre-filtering process, which is described in detail below.
  • the pre-filtering method can be used for efficient calculation; before this, when the interpolation calculation " X _ ⁇ , k ⁇ is performed by B-spline ⁇ - ⁇ , the linear equation is also solved.
  • the method of grouping because according to the nature of B-spline, a finite bandwidth matrix can be obtained, which can be calculated by traditional numerical analysis methods such as Gaussian elimination, LU decomposition, and iterative method.
  • this problem The solution can be performed in the form of pre-filtering. To introduce this method in detail, the discrete B-spline kernel is introduced first.
  • the B-spline fitting is first introduced to introduce the principle of the least squares method, which is the theoretical basis of the fitting method.
  • the least squares method is to make:
  • Guan Jian has inversion in solving ⁇ : ⁇ 1 ⁇ , because according to the nature of B-spline, the obtained ⁇ is a finite bandwidth matrix, using traditional numerical analysis methods, such as Gaussian elimination, LU decomposition, iteration The method can be calculated.
  • the chasing method can be used for fast calculation, but the chasing method itself can only be applied to the tridiagonal matrix, and the matrix generated by other high-order interpolation is not practical. It limits its scope of application. In addition, the chasing method still needs to read in and store a large amount of data before it can get the calculation result, and the consumption of resources (especially memory) is still relatively large.
  • a method and apparatus for interpolating digital images is provided, which enables fast interpolation of digital images and reduces computational effort.
  • a method of interpolating a digital image comprising:
  • An apparatus for interpolating digital images comprising:
  • a matrix equation group generating module configured to generate a matrix equation group according to the digital image signal, and send the signal to the FIR filter module;
  • a FIR filtering module configured to receive the matrix equations, filter the matrix equations by using a linear system decomposition algorithm and a Demko lemma FIR filtering method to obtain interpolation, and insert the obtained interpolation into a corresponding digital image signal. in.
  • the method and apparatus provided by the embodiments of the present invention use the FIR filtering method based on the linear system decomposition algorithm and the Demko lemma to perform FIR filtering on the matrix equations generated by the digital image signal, thereby eliminating the need for
  • the complex inverse transform is solved according to the matrix equations obtained from the signals of the digital image for interpolation, so that the digital image can be quickly interpolated and the amount of calculation can be reduced.
  • FIG. 1 is a schematic structural view of a basis function of a prior art B-spline
  • FIG. 2 is a schematic diagram of a prior art B-Spline function
  • FIG. 3 is a schematic diagram of a third-order spline approximation of a FIR filter coefficient according to an embodiment of the present invention
  • FIG. 4a is a schematic diagram of a third-order B-spline approximation of a FIR filter coefficient according to an embodiment of the present invention
  • FIG. 4b is an embodiment of the present invention
  • FIG. 5 is a flowchart of a method for interpolating a digital image according to an embodiment of the present invention
  • FIG. 6 is a flowchart of a method for interpolating a data image by using a third-order spline interpolation method according to an embodiment of the present invention.
  • FIG. 7 is a flow chart of a method for interpolating a data image by using a B-spline interpolation method according to an embodiment of the present invention.
  • FIG. 8 is a flow chart showing a method for interpolating a data image by using a B-spline fitting method according to an embodiment of the present invention
  • FIG. 9 is a schematic diagram of an apparatus for interpolating a digital image according to an embodiment of the present invention. detailed description
  • the existing third-order spline interpolation chasing method, B-spline interpolation filter method and B-spline fitting interpolation method in the process of interpolating digital images all need matrix equations based on signals of digital images.
  • the group performs a complicated inversion process, so the interpolation process is time consuming and computationally intensive, and consumes more resources.
  • the inversion process of the matrix equations obtained from the signals of the digital image needs to be performed in other ways, and the embodiment of the present invention is implemented by the FIR filtering method based on the linear system decomposition algorithm and the Demko lemma. Simple implementation and good stability, as described in detail below.
  • the method for approximating the third-order spline interpolation and the B-spline interpolation using the FIR filter method based on the linear system decomposition algorithm and the Demko lemma provided by the embodiment of the present invention in the direct solution process of the linear equations,
  • the approximate interpolation calculation is implemented by the FIR filtering method (different from the B-spline IIR filter implementation method).
  • Control by adjusting the size of the window that is, a large system of linear equations can be decomposed into many small linear equations to solve the variables one by one, and only need to calculate some solution variables and apply parallel calculations to obtain high-speed solution.
  • This algorithm provides a very efficient calculation method. Based on the Demko lemma, a symmetric matrix case with a principal diagonal outward exponential decay can be further considered, ie
  • the calculation here is a convolution in the sense of truncation (accurate calculation according to matrix multiplication), which makes it clear that the theoretical basis of the spline interpolation algorithm using the FIR filter method is obtained, because according to the sequence) ::.
  • the exponential decay characteristic of 1 can take advantage of the truncated sequence. For approximate calculation, the calculation error can be controlled by the selected size.
  • the matrix based on Demko lemma is exponentially attenuated along the main diagonal.
  • This matrix can be calculated by linear system decomposition algorithm. The whole process of calculating this matrix is based on the decomposition algorithm of linear system.
  • the process of performing third-order spline interpolation is as follows: First, all data to be interpolated, that is, a signal read into a digital image, is read at a time, and a vector is obtained according to formula (24); The inverse of ⁇ , after the solution is solved, the matrix operation is performed according to the formula (26), and the second derivative point vector M and the polynomial coefficient are obtained. Finally, the expression of the piecewise polynomial is calculated according to the formula (17), and interpolation is performed. Since the matrix ⁇ is a three-diagonal matrix with fixed coefficients, only the order cannot be determined. Therefore, it is possible to read the interpolation data of a fixed length at one time, completely determine the matrix, and find the inverse of the matrix A in advance. Calculated amount.
  • the matrix has some features, providing the possibility of rapid inversion.
  • it is a three-diagonal matrix.
  • its diagonal coefficient is completely determined.
  • its diagonal coefficient is rapidly attenuated on both sides of the diagonal. According to Demko's lemma, if the matrix decays exponentially outward along the main diagonal, then its inverse matrix is also Exponentially decay outward in the direction of the main diagonal with the same amplitude.
  • Each row of the matrix to be solved is centered on the main diagonal element (4 is the element on the main diagonal) is [ Q 1 4 1 °], and its inverse matrix can be found to have the same elements of each row of its inverse matrix. Moreover, it also exponentially decays outward along the main diagonal direction, so in the inverse matrix, 13 non-zero elements are taken centering on the main diagonal element to obtain [0.0001 -0.0004 0.0015 -0.0056 0.0207 -0.0774 0.2887 -0.0774 0.0207 -0.0056 0.0015 -0.0004 0.0001] , ie inverse matrix 1
  • FIG. 3 is a schematic diagram of the third-order spline approximation of the FIR filter coefficients according to an embodiment of the present invention, which can be obtained according to the Demko lemma.
  • Fig. 3 is a view showing the center line after inverting the matrix of the digital image of 72 0x 72 0. Due to the characteristics of the diagonal matrix, the line other than the center line is the value of the horizontal movement of the line. Seeing the four values on each side of the near intercept center, the value has been attenuated to 0.001 4 , which will only affect the signal amplitude of 0.36 for an 8 -bit signal processing, and will be ignored after rounding. After analysis, when the order of ⁇ is increasing, the center line changes very little and can be ignored. Thus, a process of finding M in equation (26) becomes a direct calculation process with a limited length.
  • the B-spline interpolation process is essentially the same as the third-order spline, except that the selected basis functions are different, so the B-spline interpolation process also faces how to quickly find the matrix.
  • the problem of the reverse Due to the symmetrical nature of the B-spline function, the matrix that controls the vertices is still a diagonal matrix of finite bandwidth and decays rapidly toward both sides of the symmetry, as in equation (37).
  • the B-spline also satisfies the conditions of Demko's lemma and directly inverts it.
  • the center coefficient of the inverse matrix is shown in Table 1.
  • Table 1 also experimentally validates the Demko lemma because the B-spline basis function decays exponentially to both sides. Then P is a diagonal matrix (exponential decay) that decays rapidly outward in the main diagonal. According to Demko's lemma, its inverse matrix 1 is also a diagonal matrix, and its elements are also rapidly outward along the main diagonal. decline Subtraction (exponential decay). With a precise description, for the ⁇ -splines of different orders, refer to Table 2.
  • the embodiment of the present invention does not need to calculate the inverse matrix, and the approximate calculation result of the B-spline interpolation can be obtained by using the linear system decomposition algorithm and the Demko lemma FIR filtering method, and the direct application table is directly applied.
  • This set of data of the inverse matrix of 2 (can be calculated in advance in one time) finds the value of the control vertex M. It can be seen from equation (30) that after obtaining the control vertex, the form of the entire piecewise polynomial can be obtained, and the interpolation of the B-spline is completed, thus eliminating the continuous condition of the function derivative.
  • Embodiments of the present invention show two B-spline filter coefficients in Figures 3a and 3b, wherein the coefficients shown in Figure 3a correspond to third-order B-spline interpolation, and the system shown in Figure 3b corresponds to Fourth-order B-spline interpolation.
  • FIG. 5 a flowchart of a method for interpolating a digital image provided by an embodiment of the present invention is shown in FIG. 5, and specific steps thereof include:
  • Step 501 Acquire a digital image signal, and generate a matrix equation group
  • Step 502 Filter the obtained matrix equations by using a linear system decomposition algorithm and a Demko lemma FIR filtering method to obtain interpolation, and insert the obtained interpolation into the corresponding digital image signal.
  • performing FIR filtering actually implements two FIR operations, and the first time is to obtain a piecewise polynomial of the matrix equation group and each interpolated pixel value, to obtain a current interpolated control vertex M, the second basis
  • the next interpolated pixel value operation controls the vertex M.
  • the control vertices participating in the calculation are updated according to each newly interpolated pixel value until the interpolation process ends.
  • the control vertex of the current interpolation is the control vertex M in the formula (26) obtained by passing the inverse matrix of ⁇ through the FIR filter.
  • FIG. 6 is a flowchart of a method for interpolating a data image by using a third-order spline interpolation method according to an embodiment of the present invention, and the specific steps thereof include:
  • Step 601 Read a digital image signal, and generate a matrix equation group according to formula (24).
  • Step 602 Pass the matrix equations through a linear filter based on a linear system decomposition algorithm and a Demko lemma, and use the filter coefficients as the central element of the inverse matrix 1 of the matrix ⁇ , and record the result of the approximate calculation as M.
  • the embodiment can control the calculation error by controlling the coefficients of the FIR filter, for example, taking 13 coefficients.
  • Step 603 substituting M into formula (17), obtaining a piecewise polynomial and each interpolated pixel value.
  • Step 604 Save a part of the control vertex M according to the order of the FIR filtering (since the FIR filter of M is fourth order, so only the four adjacent ''s are saved), and continue to perform the step on the pixel value of the next interpolation.
  • FIG. 7 is a flow chart of a method for interpolating a data image by using a B-spline interpolation method according to an embodiment of the present invention, and the specific steps thereof include:
  • Step 701 Read a digital image signal to generate a matrix equation.
  • Step 702 Pass the matrix equations through a FIR filter based on a linear system decomposition algorithm and a Demko lemma, and select coefficients of the FIR filter according to the order of the B-spline to obtain a filtering result.
  • step 703 the filtering result is recorded as ⁇ '', and the filtering result is substituted into the formula according to the prior art to obtain a final interpolation polynomial.
  • step 704 According to the interpolation polynomial, the calculation result of each interpolation point " 1 - 1 h can be obtained.
  • Step 705 save the control vertex M (for the third-order B-spline, only need to save the adjacent four ''), continue to perform the steps 701-704 for the next interpolated pixel value; update according to the position of the next interpolated pixel value
  • the vertex sequence is controlled until the end of the interpolation process, and the interpolation of the digital image is completed.
  • the specific steps include:
  • Step 802 Select a matrix ⁇ whose order is n*n, sufficiently large, calculate ⁇ - 1 in advance, take the L" /2 " line in between, and L" denotes the rounding operation, and take the middle K of the line.
  • a coefficient as a coefficient of the fixed coefficient FIR filter, using the linear system decomposition algorithm and the Demko lemma based on the FIR filter to filter the result of step 801 to obtain the obtained coefficient;
  • Step 803 Selecting the middle four from the coefficient ⁇ corresponds to four splines - 3 ' - 2 ' -!
  • the coefficient of ' can fit the interpolation of the [ ⁇ ! ' ⁇ !+ ⁇ ] interval.
  • a program instructing corresponding hardware may be completed by a program instructing corresponding hardware, and the program may be stored in a computer readable storage medium, and when the program is executed, Some or all of the steps of the digital watermark embedding method and the digital watermark detecting method provided by the embodiments of the present invention are included.
  • a readable storage medium such as a read only memory (ROM), a random access memory (RAM), a magnetic disk, a compact disk, or the like can be read.
  • FIG. 9 is a schematic diagram of an apparatus for performing interpolation on a digital image according to an embodiment of the present invention, including: a matrix equation group generation module 910 and a FIR filtering module 920, where
  • the matrix equations generating module 910 is configured to generate a matrix equation group according to the digital image signal, and send it to the FIR filtering module 920;
  • the FIR filtering module 920 is configured to receive the matrix equations, filter the matrix equations by using a linear system decomposition algorithm and a Demko lemma FIR filtering method to obtain interpolation, and insert the obtained interpolation into corresponding digital images. In the signal.
  • the FIR filtering module 920 includes a first FIR filtering module 921 and a second FIR filtering module 922, where
  • the first FIR filtering module 921 is configured to filter the obtained matrix equations to obtain a segmentation multiple And the value of each interpolated pixel to obtain the current interpolated control vertex;
  • the second FIR filter module 922 is configured to calculate a control vertex according to a pixel value of the next interpolation in the piecewise polynomial obtained by the first FIR filter module 921, and the control vertex participating in the operation is updated according to each interpolated pixel value. Until the interpolation process ends.
  • the clustering of matrix equations is filtered by a FIR filtering method based on a linear system decomposition algorithm and a Demko lemma, and the interpolation process can be applied to a third-order spline interpolation method and a B-spline interpolation method. And B-spline fitting interpolation method.
  • a digital system signal is interpolated based on a linear system decomposition algorithm and a Demko lemma FIR filtering method, and the interpolation method can be applied to a third-order spline interpolation method, B.
  • the spline interpolation method and the B-spline fitting interpolation method can be controlled by the order of the corresponding FIR filter during the error processing.
  • the memory, the calculation amount, and the hardware required for the implementation of the algorithm are superior to the chasing method, and for the B-spline interpolation calculation, the FIR filtering method of the embodiment of the present invention Compared with the existing method of solving matrix equations, a large amount of budget is saved. On the other hand, the FIR filtering method of the embodiment of the present invention saves stability, linear phase and calculation amount compared with the existing IIR filtering implementation. , can be similarly extended to the interpolation algorithm of B-spline fitting.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Complex Calculations (AREA)
  • Image Processing (AREA)

Description

一种对数字图像进行插值的方法及装置
本申请要求了 2007年 12月 17日提交的、 申请号为 CN 200710195391.7、 发明名称为 "一种对数字图像进行插值的方法及装置" 的中国申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及图像处理技术领域, 特别涉及一种对数字图像进行插值的方 法及装置。 背景技术
数字信号是连续信号的离散化表示, 如数字图像是由自然界连续的图像 信息, 经过釆样和量化的手段形成的亮度和色度数字信息, 该过程把一个连 续信号变为了一个有限且确定的离散信号, 将这种数字技术运用到图像上 , 对图像的存储和传播都提供了便利。 对于数字图像来说, 图像的大小不同于 连续信号, 其是以像素数目为单位计量, 即以图像分辨率为单位计量, 如 1024*768通常指图像的宽度为 1024个像素, 高度有 768个像素, 如果将具有 该分辨率的图像显示在显示器上, 每一个像素对应显示器中一个显示元素, 因此可以把图像良好的重现出来。 然而这种显示通常也有一个严重的缺陷, 如果显示器的显示分辨率和图像的分辨率不同, 就会使显示的图像有一部分 显示不出来或显示的图像无法占满显示器的屏幕。 例如: 显示器的显示分辩 率大于图像分辨率, 则图像无法占满显示器的屏幕; 如果显示器的显示分辩 率小于图像分辨率, 则显示的图像会有一部分显示不出来。 为了克服这两个 问题, 就需要将图像的分辨率更改为显示器的显示图像分辨率, 这个过程成 为数字图像的插值过程。
此外, 在数字图像的传输和存储过程中, 因为制式的改变或者存储的方 便(例如图像压缩), 也需要不断地改变数字图像的釆样分辨率, 这一过程也 需要对数字图像进行插值处理。 进一步地, 在常规的图像处理后和图像质量 加强的过程中, 也会经常用到图像的插值处理。 还有有些用以做图像处理的 硬件也需要在设计中用到对数字图像的插值处理。
因此, 数字图像的插值处理是在数字图像处理中运用广泛而且具有重要 应用价值的一类方法, 对这类方法的研究具有十分重要的工程意义和应用意 义。
对数字图像的插值处理可以从多种角度进行分析, 以下以一维情况, 从 数值分析的角度来说明。 插值处理是根据离散信号的坐标和量化值, 连接成 一条连续的曲线, 如果对该曲线重新釆样, 则可以完成升釆样或降釆样的操 作, 即完成插值处理。 具体到信号的处理领域里的应用, 插值可以将对应的 数字图像进行升釆样, 而很多降釆样是在升釆样后后再进行釆样点的删除而 完成。 因此, 可以将插值过程处理为信号的变釆样率过程。
在具体的插值处理过程中, 第一步将离散的信号表示为连续的信号; 第 二步对信号的带宽进行调整; 第三步对连续信号以新频率进行釆样, 使信号 成为具有新的釆样频率的离散信号。 对于第二步对信道带宽的调整, 通常只 针对釆样率下降的信号。 本专利申请主要涉及第一步的讨论, 即离散信号转 变为连续信号, 本专利申请涉及的插值均指对该连续信号直接按照某种频率 釆样, 而插值过程就是对新的釆样点的数值计算方法。
首先, 将离散信号表示为数学形式以便于分析, 信号序列可以以函数形 式表示, 其中横坐标代表信号出现的序列顺序, 纵坐标代表信号的幅度, 如 公式(1 ) 所示, 其中公式(1 ) 的形式是离散的函数形式, 第一项是信号的 序列顺序, 第二项是信号的幅度大小。 那么插值处理的第一步就是将公式(1 ) 的离散数值, 用一个连续函数来表述(即表示为该连续函数的釆样点), 其需 要有如下的限制条件, 即要求插值后使得原有离散信号点分布在连成的函数 曲线上。 如公式(1 )所示, 假设有 n + 1个离散点,
(^ i = fi (^ )\ i = ,... ,n 公式( 1 ) 而插值的目的就是寻找函数 即得到满足公式(2) 的函数曲线, p» f" i = Q"'"n. 公式(2) 插值就是釆用不同类型的函数 3 "来实现这一过程, 为了实现插值, 需要 釆用一种方法获得连续函数 , 现有技术釆用多项式的方式获取到, 如公式
(3)所示:
Ρη(Χ) = Ρθ +ΡΐΧ + Ρ2χ2+--- +
Figure imgf000005_0001
公式(3) 将 选择为多项式或者分段多项式形式的曲线, 根据多项式的代数基本 定理, 一个 阶多项式有 N+1个未知数, 它需要由 N+1个点来确定。 如果根 据数字图像上的所有信号确定一个多项式, 这个运算过程非常巨大, 例如对 于 720个釆样点的信号, 需要作 720X720规模的乘法运算, 并且还需要重读所 有的信号点, 计算量大; 此外多项式插值还具有本质缺陷: 震荡龙格现象, 高阶插值多项式并不收敛到被插函数。 因此, 实际上只能釆取多段多项式拼 接为整个多项式函数的形式, 通常只在每个釆样点区间定义一个连续函数, 并把所有区间的函数连接起来, 这个多项式 就是分段多项式, 被统一称为 样条函数或多项式样条。 由于每个区间的多项式连续并且它的左右边界值大 小与插值点相同, 那么可以保证至少 Ρ "是连续的。 将多样条函数定义为公式
(4) :
^ 公式( 4 ) 其中每个 代表定义在 上, 其他区间为 0的一个函数。 如果这个 函数为三次多项式, 它可以根据 ''-ι'Χ''Χ''+ι'Χ'+2]四个插值点确定该多项式, 这样 一来, 就可以通过逐次计算而得到整个分段多项式, 这种插值方法就是拉格 朗日插值原理。 根据理论分析, 拉格朗日插值的每个间断三次多项式完全是 插值点函数值 [ l,Hl,^+2]的函数, 因此如果确定插值位置, 这个函数的形 式可以完全由 [ -i ' Hi ' 2 ]分别乘以一组系数得到, 它在信号处理实现时, 可以非常方便地设计成 FIR (Finite Impulse Response ,有限冲击响应)滤波器的 形式。如果知道多项式的 W个不同的点,确定一个多项式 3 "在这些点与 /(x)相 同, 那么公式(4 )可以唯一的写成公式(5 ) 的形式:
cQ -- οχ + c2 + c3 χ + · · · + cN_ χ ― j
,N-\ cQ + ^ 3 + c2 x3 + c3 x3 + · · · + cN3 ― f- 3i,
C。 + C + C2 4 + C3X4 "I" ... "I" ^TV-I -^"4 /4 4
C0 + C\XN + C2XN + C3XN + · · · + CM-\ XN = N , 公式 ( 5 ) 公式(5 )表现了一个 -I阶多项式通过 个点可以唯一的确定该多项式 的形式, 求解上面的方程, 可以用(X', )表示系数 实际上, 我们可以把连 续多项式写成公式(6)和公式(7 ) 的形式: , 公式 (6)
,
Figure imgf000006_0001
公式(7 ) 按照公式(6 )和公式(7 )就可以得到确定通过插值点的多项式曲线。 这种插值方法也有一些本身固有的缺陷: 首先, 它的总体分段多项式只能保 证连续, 函数的导数可能不连续, 这说明所得到函数甚至可能是不光滑的, 就是高于 3 次的多项式也不可能避免这个缺陷; 其次, 插值每一个段内的函 数由周围很多点唯一的确定, 尤其在高阶时, 函数可以保证一个良好的整体 特性, 然而当信号不平稳时, 由前后互不相关的许多信号组合成一个函数其 实是毫无意义的, 它不能保证信号在局部的特性; 最后, 高阶拉格朗日插值 也存在着振荡现象,称为龙格现象,这一现象的产生原因仍然是由于一个 ^阶 多项式可以完全被 W + 1个点确定。 而相对于高阶拉格朗日插值, 低阶样条插 值则可以緩解这些问题。
为简单起见, 在讨论样条插值时只考虑三阶样条和 B-样条插值, 因为样 条插值是为了避免高阶拉格朗日插值的缺点而釆用, 而在实际中并不需要太 多地采用高阶样条插值。 当然, 釆用三阶样条插值的另外一个原因是由于其 有一个快速计算方法, 即追赶法。 在三次多项式的拉格朗日插值基础上, 为 了更好反映信号的局部特性并保证图像光滑, 对信号临近间隔两点上得出三 次的多项式, 加上二阶导数连续的条件, 就得到三阶样条插值。
三阶样条插值计算过程
首先定义信号间隔和每个插值点上的二阶导数值,如公式( 8 )和公式( 9 ) 所示:
hi = x^ -xi , 公式(8)
Μ Ρ» , 公式(9) 为简单起见, 假定处理的信号是等间隔釆样的, 即对于任意区间它的间 隔都是 计算信号在插值点二阶导连续, 得到公式(10)、 公式(11 )和公 式( 12 )··
x-x
1 1 h 1+1 h , eL +iJ , 公式(10) 加上一阶导数和原来的函数值, 得到
Ρ(χλ = -Μ^ ~~ -+ ί+1-——— + At yprr r -, ,
}' 1 2h +1 2h 1 , xeLx x +iJ , 公式(11) ( )= , ( j+1~Y) +M ( ~ j) +Al(x-xi) + Bi
]J 1 6h ]+l 6h 1 , L J, 公式(12) 至此, 得到了分段多项式在满足二阶导数连续条件的形式, 即满足公式 ( 13) 〜公式( 16):
h2
1 e 1 J 公式( 13 )
Figure imgf000008_0001
公式( 14 ) h2
B =f M 公式( 15 ) =
h 6 公式( 16 ) 由于三阶样条是多项式形式, 其标准形式为公式(17):
P(x) = aj + βί (x -Xj) + Yj (x - Xj )2 + δί (x - χ )3 公式( 17 ) 利用等效表达, 得到了插值系数的如公式(18) (21 ):
公式 (18)
2 公式( 19 ) h 公式( 20 )
M -M]
δ
6h 公式(21 ) 利用一阶导连续, 对于分段函数 对于每个插值点的左右极限相同, 即 公式( 22 ):
= , 公式(22 ) 将公式(19) 的条件应用到标准形式, 则得到公式(23):
2h u h u f]+1 -f, f, - f,^
—M, , +— M, +— M, - 1 1 1 1
6 3 J 6 1+1 h h , 公式( 23 ) 公式(23)是样条三阶插值的关键公式, 它建立了导数点和信号值之间 的关系, 可以根据信号值求出二阶导数值, 因此可以完全确定插值多项式, 进一步化简公式( 23 )得到公式( 24 )
. , , . , 6(fJ+i +fj-i -2fj)
M . , +4M. +M. , =—— ― - =d.
] J J+l h2 公式( 24 ) 对于不能完整计算的信号点取如下值, 即边界条件选取, 在此意义所使 用的三阶样条有自然边界条件, 即 P" = /" = O,P"( +1) = /"( +1) = O, 在实 际应用中可以釆取引入边界误差的方法实现这一条件, 如公式(25):
M。 =0, MN+l =0, /。 =0, +1 =0 , 公式(25) 最终得到公式(26) 的三阶样条插值求解公式:
4 1 … 0 d1
1 4 1 … M2
... 1 4 1
0 … 4 1 公式( 26 )
6(/ + _「 2 )
其中 , 公式(26)可以最终简写成公式(27):
AM = D 公式( 27 ) 那么, 综上所述, 得到 M就可以完全确定分段多项式的形式。 所以, 如 何求解公式(28) 的线性方程组就是实现三阶样条插值算法的关键。
M = A~lD 公式( 28 ) 由上述的拉格朗日插值和三阶样条插值, 总结插值的一般过程就是组合 一个分段多项式, 要求这个多项式的形式由具体插值点数值大小决定, 同时 限制多项式导数的连续性。 根据公式(6)和公式(26), 将插值过程公式化。 根据函数理论, 可以把一个连续函数用一组函数基的线性组合逼近, 那么这 组函数基叫做基函数, 记作 ^, 其中 代表该基函数的阶数, 则是基函数的 位置变量。 根据上述定义, 可以用该基函数的线性组合逼近插值需要的分段 多项式 如公式(29)
Pn(X) = YJ m lPl,k(X)
公式( 29 ) 其中 ^是常数,在这里代表分段多项式的线性组合权重。显然,公式(29) Pn (XJ k (Xj ) = fj . . . . Λ,
还需满足插值的条件 ) = Σ miPi,
- , 0 ≤ J≤ N 公式( 30 ) 考虑矩阵形式, 令
M = [m0...mN]
Figure imgf000010_0001
」 , 公式(31 ) 则 PM = , 公式 (32) 由此可以看到, 插值问题在这里实际上转换成为了寻找基函数, 而此后 的运算统一为求解控制点集 M的过程, 其实就是求解一个线性方程组, 当然
ΡοΑχο ■■■ ΡΝΛΧΟ 插值函数存在并且唯一的充分必要条件是矩阵 。 ½) … P (½;)」非奇异 下面介绍 B-样条插值过程。
B-样条插值计算可以釆用递推式, 其具体步骤过程如下所述。
首先给出普通 B-样条插值计算的定义, 再给出递推式 B-样条插值计算定 义, 假设节点集合为 {"Lz, —阶 B-样条定义如公式(33 )所示:
1, c [」 2,丄 2)
B0(x) = Zr 1 , W =
0,x€ [- )
公式( 33 ) 在次基础上, 利用递推式定义高阶 B-样条为公式(34):
(x) = (Bk_, *B0)(x) = (Β0 *···*50)(χ)
k-copy 公式( 34 ) x" (_iy「 i k+ι
定义 k\
Figure imgf000010_0002
(X+ 2 , 显然 (X)是 一个分段 多项式, 为计算 B-样条的值, 可以利用递推公式(35 )
k + l Λ_ _丄
k l , -) + 2 ¾ ,(x _— )
k k~l 2 k k~l 2 公式( 35 ) 此公式即表明 AW为 A-l阶分段多项式, 其实, 利用一阶样条的定义和 公式(35)也可以反过来定义 B-样条。 B-样条基函数具有以下的性质:
. ω
sin— f Jo,ll _e_j(oll k+l
_ 2_
ω
^ 的 Fourier变换 2
「- ¾
具有紧支集, ^阶 B_样条 只在 L 2'2」区间内为非零值; 以零点为对称函数, 在 0点为最大值, 向两侧指数衰减; (x)的积分为 1, J° ^ 2 ; 的 _1阶导数连续, dx k、, k~l 2} k~A 2 ¾(x_") = l 以 B-样条为基作函数插值计算, 不失一般性, 假设节点集合为
X
所用基函数为 ^_ , 考虑在 +1个插值点 ,···, } = {0Α···, }的情 r n w _ f jp (x-n N P(x) = YmB (X_lh
形, 用 N+i个函数 丁"。的线性组合 ' k、 h ;作插值, 假设被插函数值为 ^^[^'…' ], 据 B-样条函数性质和公式 (31 ), 矩阵
ΡοΛχο ■■■ ΡΝΛΧΟ
Ρ =
Po,k (½ ) … ΡΝ, ΧΝ) 成为
Figure imgf000011_0001
, 公式 ( 36 ) 对 称 性 Bk(-x) = Bk(x) 保 证 p 为 对 称 矩 阵 , 由 k + l
Figure imgf000012_0001
或者利用 B-样条插值递推公式, 可以计算
("
Figure imgf000012_0002
个值不等于 零且对于 "作指数衰减, 在此仅列举最常用的 ^^的数值结果如下:
{0, 1, 0},^ = 1
{0.125, 0.75, 0.125},^ = 2
{ (")} = {0, 0.167, 0.667, 0.167, 0},Λ = 3
[{0.0026, 0.1979, 0.599, 0.1979, 0.0026}, Λ = 4 ? 公式 ( 37 )
由这些值, 就可以很快地产生矩阵 P进行插值计算。 利用 ^ ~ 进 行插值即分段线性插值。 B样条的基函数如图 1所示, 其阶数分别为 1、 2、 3 和 4, 最不圓滑的曲线为阶数 1 , 以此类推, 最圓滑的曲线为阶数 n。
目前, 衡量插值算法优劣的标准有很多的方面, 从数值逼近方面看主要 是三点: 1. 稳定性, 即被插函数的值有微小变化时, 插值函数的变化也很小; 2. 收敛性, 即插值函数(当阶数升高或节点加细时)收敛于被插函数; 3. 计 算量, 即插值算法的速度、 有效性和实现复杂性。
尽管拉格朗日插值有很有效的计算方法, 但收敛性比较差, 特别是由高 阶多项式插值所引起的 Runge现象限制了应用。 而利用三阶样条和 B-样条插 值可以很好地解决拉格朗日插值所出现的问题, 因此有着更广泛的应用; 根 据已有研究, 三阶样条插值可以用追赶法作快速运算, 而 B-样条插值可以用 预滤波的方法作快速计算。
在现有技术中, 使用样条函数也可以进行拟合, 实现插值计算, 这里介 绍釆用 B-样条进行最小二乘拟合的方法。
首先介绍最小二乘法的原理。 设/为在 m+1个节点上给定的离散函数,
Figure imgf000012_0003
k = m , 最小二乘法为求 使得: 取最小。 s是 在 m+1个节点上的最小二乘解。 设 … 为线性无关函数组, 属于阶数小 于等于 n 的多项式, 将 s表达为:
Figure imgf000013_0001
,^^,…",
使得
Figure imgf000013_0002
J的二次 一 = 0, k = 0X...,n 函数, 利用 多 元函数求极值必要条件有: d , 即
Figure imgf000013_0003
= ο,ι,···", 由于%'^···Α'线性无关, 所以 V^'1' "的系数矩阵非奇异, 有唯 一解。 使用三阶 Β-样条进行拟合时, 期望釆用三阶 Β-样条的函数组合 six ) = Ύ αίφί (χ 1 j - 0,1, .. m 来在 m+1 个节点上拟合一个函数, 表示为: ^。 , 其中 是三阶样条函数的不同时间移位得到的结果, 如图 2所示。
n m / 、 / 、 m / 、 / 、
a!∑ (xj Wk (xj ) =∑ f(xj Wk (xj ) . Λ 1 釆用运用最小二乘法的公式: '=。 , k = ° -n, 可 以 写作矩阵形 式: ΦΑ = ΒΡ , 其 中 F =
Figure imgf000013_0004
m=10, η=7, 用三阶样条时:
Figure imgf000014_0001
2/9 1/36 0 0 0 0
1/2 2/9 1/36 0 0 0
2/9 1/2 2/9 1/36 0 0
0 1/36 2/9 1/2 2/9 1/36 0 0
Φ
0 0 1/36 2/9 1/2 2/9 1/36 0
0 0 0 1/36 2/9 1/2 2/9 1/36
0 0 0 0 1/36 2/9 1/2 2/9
0 0 0 0 0 1/36 2/9 1/2 解方程组 Φ^ = ^, 其中 /(x。)/ )的值实际没有用到, 就可以得到系数
Α = [α0 αλ
Figure imgf000014_0002
, 就可以得到拟合结 果, 虽然从图 2看, [χ^ι]区间的值只需要相关的 4个样条 -2Ί' 和他 们的系数就可以得到, 但如果方程组 Φ^ = ^的大小不够, 求得的系数精度不 够, 拟合出来误差很大, 因为实际上 S和 Φ矩阵, 应该是无穷维才能实现精确 的拟合。
可以看出,计算 Β-样条拟合或者内插的算法可以釆用预滤波的方法进行, 计算简单,而且精度保证。例如对于计算 Β-样条拟合的过程中 Φ^ = ^的求解, 因为实际上只有 S和 Φ矩阵是无穷维时才能实现精确的拟合系数的计算。为了 求解^ 4 = Φ- 可以利用计算步骤如下:
1 ) , 计算 C = , 相当于使用 3阶 FIR滤波器 [1/6 2/3 1/6], 对输入信 号进行滤波;
2)、 需要求解^ 4 = _1C, 得到 A。 3 )、从 A中选出中间的 4个分别对应 4个样条 ^^'^^Ά-" 的系数, 就可 以拟合 [χ^ ι]区间的任何值。
这种方法, 对于 Β-样条内插的运算, 仅矩阵变为 = F ,
F = fM )Γ是信号的采样值
Figure imgf000015_0001
实际上要求 = lF, 如果精确的计算, F是无穷长度的, 表示源源不断 的输入釆样数据, Ψ是无穷维的, 每一行都是 [1/6 2/3 1/6]的移位。 当 Ψ矩 阵很大时, 发现它的逆也具有这样的特性, 中间的行都是同一个向量(定义 为 V) 的不同移位的结果。 因此, 可以用 V对应的一个固定系数 FIR滤波器 来对 F滤波, 随着时间的移位得到 , 就得到了插值系数。 从 A 中选出中间 的 4个分别对应 4个样条 , -2, , 的插值系数, 就可以插值出 [x ]区间 的任何值。
以上为理论应用拉格朗日插值、 三阶样条插值、 B-样条插值以及 B-样条 拟合插值的方法, 以下从实现的方面出发, 详细论述如何应用拉格朗日插值、 三阶样条插值以及 B-样条进行快速插值计算。
拉格朗日插值快速算法过程
拉格朗日插值算法是利用 Farrow结构进行快速计算, 内插算法常用的一 种插值滤波器结构叫 #丈 Farrow结构, 对于多项式插值, 如拉格朗日插值, 插 值公式如(38) 所示:
Figure imgf000016_0001
w w , 公式 ( 38 )
在选择滤波器结构的过程当中, 应当尽量减少计算量, 注意到公式(38) 中每一个插值多项式 ' (x)都是一个多项式, 它们具有相同的形式, 如一个三 次多项式的四个插值点:
J( ) = α0 + 1χ + α2χ2 + α3χ3
L2 (χ) = b。 + bx + b2x2 + ¾ 3
J (¾·) = c。 + + c2x2 + c3x3
L4(x) = d0+ άχ + d2x2 + d3x3 公式 (39) 如果直接按照公式(38)计算插值多项式, 就需要对每一个插值节点 计 算 χ,χ2,χ3。 这样的计算量非常大, 按照 Farrow结构的方法, 将公式( 39 )上 式代入公式(38), 按照 X合并为公式(40) ρη(χ) = (/Λ + fi + + /Λ)χ3 + {Άα2 + fA + i + fA ) χ2
+ fA +
Figure imgf000016_0002
= 3+ 2+ +
= {{λ,χ + λ2)χ + λι)χ + λ0 , 公 式
(40)
按照上式的计算方式, 对于插值位置 在插值过程当中, 不需要对每一 个插值节点都计算 χχ2χ3 ,而是只计算一次,这种结构是一种高效的插值算法。
三阶样条插值的快速算法
对于三阶样条插值, 可以利用追赶法进行插值的快速计算, 以下详细论 述。
在求解插值问题时, 总会碰到解方程组^ r = ", 通常直接求解向量 的 计算量非常大, 所幸当这个问题中的矩阵 ^是一个有限带宽矩阵或稀疏矩阵 时, 一般可以设计有效的计算方法; 特别当应用三阶样条时, 矩阵 ^是一个三 对角矩阵, 对于三对角矩阵通常釆用追赶法的技术快速求解。 这里设
Χ = (χλ2,-,χη_λη) ^ DH 'c , 追赶法实际上是高斯消去法的一种简化 形式, 它同样分为消元与回代两个过程。 当 ^是三对角矩阵时, 将系统 直接展开可以得到如公式(41 )和公式(42);
公式(41 )
Figure imgf000017_0001
, 先将第一个方程中 Xl的系数化为 1, i d、 i
χι +—χ2 =— rx =— yx =—
αι ai, 记 a\ , a\ , 则有
Figure imgf000017_0002
公式(42) 注意到在剩下的方程中, 实际上只有第二个方程中含有变量 xl, 因此消 元过程可以简化。 利用公式(42)可将第二个方程化为
公式(43 ) 这样一步一步地顺序处理公式(41 )中的每个方程, 设第 个方程已经 变成
xk_x+rk_xxk =yk_x ? 公式 (44 ) 再利用公式(43 )从第 个方程中消去 ^-1 , 得到 (a\ ~rk-\ao)xk a2xk+\ = - _ 公式( 45 ) 两边同除以 _^α。), 得到
Xk
Figure imgf000017_0003
k = 2,3. 公式( 46 ) 记
Figure imgf000018_0001
这样做 n— 1步以后便 得到 X = y 公式( 47 ) -y 将公式(47)与前面方程联立, 即可解出 x"= , 其中 " , 于 是通过消元过程, 原来所给的方程组就可以归结为以下更为简单的形式
Figure imgf000018_0002
, 公式( 48 ) 这种方程组被称作二对角型方程组, 其系数矩阵中的非零元素集中分步
1 rx
1 r2
1
1 rn_
在主对角线和一条次主对角线上 1 , 对加工得到的方程组 公式(48) 自下而上逐步回代, 即可依次求出 χ"'χ"-ι'···'χι, 具体的计算公式为
Figure imgf000018_0003
公式(49) 上述这个过程就是追赶法,它的消元过程与回代过程分别称作"追"过程与 "赶"过程。 综合追与赶的过程, 得如下计算公式:
Figure imgf000018_0004
«2
α\ _ rk_i
Λ,
Figure imgf000018_0005
k = 2, 3 ,···,«
α\ _ rk 公式( 50 )
Figure imgf000018_0006
=yk k = η-Ιη-2 ···Λ 公式(51 ) 追赶法虽然简化了矩阵求逆的过程, 但是它只能适用于三对角矩阵, 并 且仍然需要读入大量数据后计算结果, 资源消耗仍然比较大。
B-样条插值快速计算过程
B-样条插值快速计算是利用预滤波过程实现的, 以下进行详细介绍。 对于 B-样条插值, 可以利用预滤波的方法进行有效计算; 在此之前, 在 利用 B-样条 ^^― ^进行插值计算 " X _ ^, k~^~时, 也利用求解线 性方程组的方法, 因为根据 B-样条的性质, 可以得到有限带宽矩阵, 利用传 统的数值分析方法, 例如高斯消元、 LU分解、迭代法都可以进行计算。但是, 随着发展, 这一问题的解法可以利用预滤波的形式进行, 为详细介绍这一方 法, 首先引入离散 B-样条核 ,
Figure imgf000019_0001
h 公式( 52 ) 其 变换为
Figure imgf000019_0002
所用基函数为 { —^)}"", 考虑在 +1个插值点 ,···, } = {0Α···, }的情 f η -,Ν _ (o (x-nh Ν Ρ(χ)= Υ mB (x~lh\
形, 用 N+i个函数 。 _ "了"。的线性组合 "、 ) h 1 k、 h ;作插值,
Figure imgf000019_0003
公式( 53 ) 如果定义反卷积算子 A(z), 上面插值问题的解, 可以利用下面 的逆滤波给出 imi l.z = ϊ )~λ * {ft , 公式( 54 ) 其中
Figure imgf000020_0001
是被插值点。 根据 B_样条性质, 是一个 FIR滤波器, 的逆滤波是一个 IIR ( Infinite Impulse Response, 无限脉沖响应)滤波器, 但 所谓的直接 B-样条滤波器 是全极点系统, 这一 IIR滤波器可以用一个因 果滤波器和一个非因果滤波器的级联方法来有效实现。 IIR滤波方法是在数值 计算意义下稳定的, 而且可以很容易地利用各种数值计算技巧而实现, 因而 是一种非常有效的计算方法。
其次叙述 B-样条拟合 首先介绍最小二乘法的原理, 这是拟合方法的理论基础。 设 为在 m+1 个节点上给定的离散函数, d/k) = ( ' ' '™, 最小二乘法为求 使得:
Figure imgf000020_0002
取最小。 s是/在 m+1个节点上的最小二乘解。 设 ,为
Figure imgf000020_0003
线性无关函数组, 属于阶数小于等于 n的多项式, 将 表达为 ∑ X
则我们的问题就是求
Figure imgf000020_0004
最小 可以看出, 其为^ 0'1'…"的二次函数, 利用多元函数求极值必要条件有: k = 0X.. n
Figure imgf000020_0005
, 于 是
a,∑p, (XJ K (XJ ) =∑ f(xj k (XJ
, k = 0X.. ir , 由于 … A'线性无关, 所以 a'J = ° - η的系数矩阵非奇异, 有唯一解。
最后讨论使用三阶 B-Spline 进行拟合, 采用三阶 B-Spline 的函数组合
Figure imgf000020_0006
来在 m+1个节点上拟合一个函数,表示为: , 其中 是三阶样条函数的不同时间移位得到的结果, 如图 2所示。 运用最小二乘法的公式: k = 0X..n 可以 写作矩阵形式: A = BF, 其中 F =
Figure imgf000021_0001
m=10, n=7, 用三阶样条时:
0 1/6 2/3 1/6 0 0 0 0 0 0 0 0
0 0 1/6 2/3 1/6 0 0 0 0 0 0 0
0 0 0 1/6 2/3 1/6 0 0 0 0 0 0
0 0 0 0 1/6 2/3 1/6 0 0 0 0 0
B:
0 0 0 0 0 1/6 2/3 1/6 0 0 0 0
0 0 0 0 0 0 1/6 2/3 1/6 0 0 0
0 0 0 0 0 0 0 1/6 2/3 1/6 0 0
0 0 0 0 0 0 0 0 1/6 2/3 1/6 0
Figure imgf000021_0002
解方程组
Figure imgf000021_0003
的值实际没有用到, 就可以得到系数 =^。" 2... , 再将系数代入 , 就可以得到拟合结 果, 虽然从图 2看, [χ^ ι]区间的值只需要相关的 4个样条 -2Ί' 和它 们的系数就可以得到, 但如果方程组 Φ^ = ^的大小不够, 求得的系数精度不 够, 拟合出来误差很大, 因为实际上 S和 Φ矩阵, 应该是无穷维才能实现精确 的拟合。
如前面所述, 进行样条拟合主要是求解 = SF , 得到^ 4 = Φ- 就可以 s(x) = a^j (x)
用系数 ^实现拟合运算 !=。 , 关健是在求解 ^: ―1^ 中有求逆运算, 因为根据 B-样条的性质, 得到的 Φ是有限带宽矩阵, 利用传统的数值分析方 法, 例如高斯消元、 LU分解、 迭代法都可以进行计算。
从上述叙述可以看出, 现有的三阶样条插值追赶法、 B-样条插值滤波器 在实现上都有优缺点。
对于由三阶样条插值形成的三对角矩阵, 可以利用追赶法进行快速计算, 但追赶法本身只能适用于三对角矩阵, 而对于其他高阶插值所产生的矩阵并 不实用, 因而限制了其应用范围, 另外, 追赶法仍然需要读入并存储大量数 据后才能得出计算结果, 对资源 (特别是内存) 消耗仍然比较大。
对于 B-样条插值, 利用传统的解线性方程组的方法, 计算量很大; 而利 用滤波器的方法实现 B-样条插值计算, 用到的是 IIR滤波, 尽管计算也较为 简洁, 但就滤波的性质而论, 却无法做到线性相位。 另外, B-样条拟合插值 计算的过程中, 由于关键是求解 Φ^ = ^的方程, 在三阶样条拟合中的关键是 求解该线性方程, 其中需要矩阵求逆运算, 釆用目前的不论是直接解法、 LU 分解, 还是迭代法, 计算量都很大。 发明内容
提供一种对数字图像进行插值的方法和装置, 能够实现快速的对数字图 像进行插值, 减少计算量。
一种对数字图像进行插值的方法, 该方法包括:
获取数字图像信号, 生成矩阵方程组;
对所述矩阵方程组釆用基于线性系统分解算法和 Demko引理的 FIR滤波 方式进行滤波, 得到插值, 将得到的插值插入相应的数字图像信号中。
一种对数字图像进行插值的装置, 包括:
矩阵方程组生成模块, 用于根据数字图像信号, 生成矩阵方程组, 发送 给 FIR滤波模块;
FIR滤波模块, 用于接收所述矩阵方程组,对所述矩阵方程组釆用基于线 性系统分解算法和 Demko引理的 FIR滤波方式进行滤波, 得到插值, 将得到 的插值插入相应的数字图像信号中。
从上述方案可以看出, 本发明实施例提供的方法及装置, 釆用基于线性 系统分解算法和 Demko引理的 FIR滤波方式, 对数字图像信号生成的矩阵方 程组进行 FIR滤波, 从而不需要对根据数字图像的信号得到的矩阵方程组进 行复杂的逆变换求解, 以进行插值, 从而可以实现快速的对数字图像进行插 值, 减少计算量。 附图说明
图 1为现有技术 B样条的基函数的结构示意图;
图 2为现有技术 B-Spline函数示意图;
图 3为本发明实施例的三阶样条近似计算 FIR滤波器系数的示意图; 图 4a为本发明实施例三阶 B-样条近似计算 FIR滤波器系数的示意图; 图 4b为本发明实施例四阶 B-样条近似计算 FIR滤波器系数的示意图; 图 5为本发明实施例对数字图像进行插值的方法流程图;
图 6 为本发明实施例釆用三阶样条插值方法对数据图像进行插值的方法 流程图
图 7为本发明实施例釆用 B-样条插值方法对数据图像进行插值的方法流 程图;
图 8为本发明实施例釆用 B-样条拟合方法对数据图像进行插值的方法流 程图;
图 9为本发明实施例对数字图像进行插值的装置示意图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面结合附图对本发明 实施例作进一步的详细描述。
现有的三阶样条插值追赶法、 B-样条插值滤波器法以及 B-样条拟合插值 法在实现数字图像的插值过程中, 由于都需要对根据数字图像的信号得到的 矩阵方程组进行复杂的求逆过程, 所以导致插值过程比较耗时且计算量大, 并且占用的资源也较多。 为了解决这个问题, 需要釆用其他方式对根据数字 图像的信号得到的矩阵方程组进行求逆过程, 本发明实施例釆用基于线性系 统分解算法和 Demko引理的 FIR滤波方式实现, 这种方式实现简单且稳定性 好, 以下进行详细介绍。
如何求解大的线性系统始终都是计算数学的核心问题, 因为矩阵求逆的 运算量很大, 所以几乎所有求解线性方程组的算法都是按照避开矩阵直接求 逆的思路而设计的, 从直接解法(高斯消去、 LU分解等)、 到代数多重网格 法(实质是一种多分辨率的数值计算方法), 进行了大量的研究并发展了多方 面的技术。 根据现有技术, 可以知道计算三阶样条插值和 B-样条插值的关键 就是如何求解由数字图像的信号得到的矩阵方程组, 三阶样条插值追赶法实 际上就是一种特殊的快速线性方程组解法, 但是这种方法只适用于三对角矩 阵且需要读入并存储大量数据后才能得出计算结果, B-样条插值的预滤波器 方法实际上就是避开了所用的直接求解线性方程组的计算方法, 但是该方法 无法做到线性相位。
本发明实施例所提供的用基于线性系统分解算法和 Demko引理的 FIR滤 波器方式近似计算三阶样条插值和 B-样条插值的方法, 在实现线性方程组的 直接求解过程中, 釆用 FIR滤波的方法实现近似插值计算(不同于 B-样条的 IIR滤波器实现方法)。
以下对线性系统分解算法和 Demko原理进行介绍 若矩阵 的元素是沿主对角向外作指数衰减, 该矩阵 A是
Figure imgf000025_0001
一类很重要的矩阵, 包括了工程应用中最重要的有限带宽矩阵, 即存在" >0 , ρ>0 , 下面 不等式成立 | \≤ -e~p]j-l] , 依照 Demko 引 理, 则
Α =B = 向外作指数衰减, 即存在 /?>0 , 成
Figure imgf000025_0002
立 1 1≤ e- '-'1 , 需要特别注意的是两个矩阵的衰减系数是一样的。 记
T , K,-) = max(l, i-k) , T(i, K,+) = min(", i + K) , 对于沿主对角向外作指数衰减的
矩阵的子矩阵 ^' =
Figure imgf000025_0003
'+ O) J
线性系统分解算法利用 ''' =尸'' 所求到的解 在 足够大时,与原来方程 χ = /的精确解 χ,.非常接近, 换言之 lim^^^x,. , 即计算误差可以通过调整窗 口的大小来控制, 也就是说, 一个大的线性方程组可以分解成许多小的线性 方程组来对变量逐个求解, 而对于只需要计算某些解变量和应用并行计算来 获得高速求解时, 此算法提供了非常有效的计算方法。 在 Demko引理的基础 上, 可以进一步考虑对称的具有主对角线向外指数衰减的矩阵情形, 即
£ , 根据 Demko 引
Figure imgf000025_0004
中的证明, 其逆矩阵 b =b 有 且 \ hi \ -e~P" 这是 Demko 引理的特殊情况。 本发明实施例需要的是如何利用 Demko 引 理 的 特 殊 情 况 来 完 成 插值 的 近似 计 算 , 其 中
^ ^/ {Wio1 这里的计算是在截断意义下的卷积(准确计算按 照矩阵乘法), 由此可以清楚地得出用 FIR滤波器方法实现样条插值算法的理 论基础, 因为根据序列 )::。1的指数衰减特性, 可以利用截断的序列 。来作 近似计算, 计算误差完全可以通过选取 的大小来控制。
以下对釆用基于线性系统分解算法和 Demko引理的 FIR滤波器方式在三 阶样条进行插值、 B-样条插值滤波器法以及 B-样条拟合插值法进行详细的说 明。
釆用基于线性系统分解算法和 Demko引理的 FIR滤波器方式在三阶样条 进行插值的过程
其中, 基于 Demko引理的矩阵沿主对角向外作指数衰减, 这种矩阵就可 以釆用基于线性系统分解算法进行计算, 整个计算这个矩阵的过程就是基于 线性系统的分解算法。
在现有技术中, 进行三阶样条插值的过程为: 首先, 一次性读入所有待 插值数据, 即读入数字图像的信号, 根据公式(24 )得出向量"; 然后, 求 出矩阵 ^的逆, 计算求解 再后, 根据公式(26 )进行矩阵运算, 求出二 阶导数点向量 M及多项式系数; 最后, 根据公式(17 ), 算出分段多项式的表 达式, 从而进行插值。 由于矩阵 ^是系数固定的三对角矩阵, 仅有阶数不能确 定, 因此, 可以釆用一次性读入固定长度的插值数据, 完全确定矩阵 , 提前 求出矩阵 A的逆。 这样可以减小计算量。
由上所述,三阶样条插值计算最困难的步骤是矩阵 ^的求逆过程,但是矩 阵 有一些特点, 提供能快速求逆的可能性。 首先它是一个三对角矩阵, 其次 它的对角系数完全确定, 最后它的对角系数向跨对角线两面快速衰减。 根据 Demko 引理, 如果矩阵沿主对角线方向向外成指数衰减, 那么它的逆矩阵也 以同样的幅度沿主对角线方向向外成指数衰减。 需要求解的矩阵的每一行以 主对角线元素为中心(4是主对角线上元素)是 [Q 1 4 1 °] , 计算它的逆矩 阵可以发现其逆矩阵每一行的元素相同, 而且也是沿主对角线方向向外成指 数衰减, 因此在其逆矩阵中以主对角线元素为中心截取 13个非零元素, 得到 [0.0001 -0.0004 0.0015 -0.0056 0.0207 -0.0774 0.2887 -0.0774 0.0207 -0.0056 0.0015 -0.0004 0.0001] ,即逆矩阵 1
··· K
b 、 ■■■ b
A- 表达式为 其中, = 0.2887 -0.0774 b2 = b_2 = 0.0207 b3 = b_3 = -0.0056 b = b^ = 0.0015 b5 = b_5 = -0.0004 b6 = b_6 = 0.0001 这些元素从主对角线开始向外衰减的速度非常快 (指数衰减), 如图 3所示, 图 3 为本发明实施例的三阶样条近似计算 FIR 滤波器系数的示意图, 根据 Demko引理可以得知,取 13个元素以 FIR滤波近似计算就可以得到很准确的 结果, 而为了得到更精确的近似, 可以选择更长的滤波器系数, 实际上, 指 数衰减的特性保证了截断、 FIR滤波和近似插值计算的可行性。 因此, 这种衰 减的逆矩阵元素,在跨对角线方向也成同样的强度衰减。 ^的逆矩阵在跨对角 线方向迅速衰减到 0。 即使不是 0 , 那么它的绝对值也是极小的数, 在有限带 宽的滤波器处理中, 几乎可以忽略不计, 而误差则可以通过截断长度的选取 来控制, 就是对 ^的逆矩阵的截取长度加长。
图 3就是把 720x 720的数字图像的 矩阵求逆以后的中心一行提取出来的 显示, 由于对角矩阵的特性, 中心行以外的行是这一行的水平移动后数值的 大小。 看到近截取中心两边各 4个值, 数值已经衰减到了 0.0014 , 这对于一个 8位的信号处理, 最多仅会造成 0.36的信号幅度影响, 取整后忽略不计。 经过 分析,对于 ^的阶数不断增大时,这个中心行变化极小,可以忽略不计。 由此, 一个求公式(26 ) 中的 M的过程, 成为了一个长度有限的直接计算过程。 如 取中心行周围各 4点, 组成一个九阶的数组 则有公式 M = */; , 这是一个 FIR滤波过程, 因为通过 M求出插值点也是一个 FIR滤波线性过程, 因此整 个三阶样条插值求解过程简化成一个 FIR滤波器求解过程, 而且根据以上所 述 9阶 FIR滤波器已基本可以满足需要。
釆用基于线性系统分解算法和 Demko引理的 FIR滤波器方式在 B-样条进 行插值计算的过程
根据公式(31 )和公式(32 ) 所示, B-样条插值过程实质上和三阶样条 相同, 只是所选取的基函数不同, 因此 B-样条插值过程同样面临如何快速求 得矩阵逆的问题。 由于 B-样条函数对称的特性, 求控制顶点的矩阵依然是一 个有限带宽的对角矩阵, 并且向对称的两边迅速衰减, 如公式(37 )。 B-样条 也满足 Demko引理的条件, 直接对其求逆, 逆矩阵中心系数如表 1。
B-样条阶数 逆矩阵系数
1阶 1
2阶 -0.0002 0.0012 -0.0071 0.0416 -0.2426
1.4142 -0.2426 0.0416 -0.0071 0.0012
-0.0002
3阶 -0.0002 0.0006 - 0.0024 0.0090
-0.0335 0.1248 -0.4649 1.7321
-0.4649 0.1248 -0.0335 0.0090 -0.0024
0.0006 -0.0002
4阶 0.0001 -0.0002 0.0007 -0.0018 0.0051
-0.0141 0.0390 -0.1079 0.2986 -0.8255
2.2123 -0.8255 0.2986 -0.1079 0.0390
-0.0141 0.0051 -0.0018 0.0007 -0.0002
0.0001 表 1也从实验上验证了 Demko引理,因为 B-样条基函数向两边指数衰减, 则 P是沿主对角线向外方向迅速衰减的对角矩阵(指数衰减), 根据 Demko 引理, 它的逆矩阵 1也是对角矩阵, 且其元素也沿主对角线向外方向迅速衰
Figure imgf000029_0001
减 (指数衰减)。 用精确的描述, 则是 , 对于不同阶 数的 Β-样条, 可以参考表 2。
表 2:
Figure imgf000029_0002
仿照三阶样条插值的做法, 本发明实施例不需要计算逆矩阵, 就可以利 用基于线性系统分解算法和 Demko引理的 FIR滤波方式得到 B-样条插值的近 似计算结果, 而直接应用表 2的逆矩阵的这一组数据(可以提前一次性算出) 求出控制顶点 M的值。 并由公式(30 )可知在求得控制顶点后, 可以得到整 个分段多项式的形式, 完成 B-样条的插值, 这样免去了对函数导数连续条件 的计算, 由于样条基函数的特性, 保证了对于它导函数的连续性, 如三阶 B- 样条得到的分段多项式, 它的二阶导函数必然是连续的。 本发明实施例在图 3a和图 3b中示出了两个 B-样条滤波器系数, 其中, 图 3a所示的系数对应于 三阶的 B-样条插值 , 图 3b所示的系统对应四阶的 B-样条插值。
综上, 本发明实施例提供的对数字图像进行插值的方法流程图如图 5 所 示, 其具体步骤包括:
步骤 501、 获取数字图像信号, 生成矩阵方程组;
步骤 502、 对得到的矩阵方程组釆用基于线性系统分解算法和 Demko引 理的 FIR滤波方式进行滤波, 得到插值, 将得到的插值插入相应的数字图像 信号中。
在本发明实施例, 进行 FIR滤波实际上为实现两次 FIR运算, 第一次为 得到矩阵方程组的分段多项式和每个插值的像素值, 得到当前插值的控制顶 点 M , 第二次根据下一个插值的像素值运算控制顶点 M , 对于第二次 FIR运 算, 参加计算的控制顶点根据每一个新插值的像素值进行更新, 直到插值过 程结束。
当前插值的控制顶点就是 ^的逆矩阵经过 FIR滤波器后得到的公式 ( 26 ) 中的控制顶点 M。
图 6 为本发明实施例釆用三阶样条插值方法对数据图像进行插值的方法 流程图, 其具体步骤包括:
步骤 601、 读入数字图像信号, 根据公式(24 )生成矩阵方程组 。 步骤 602、 将矩阵方程组 通过基于线性系统分解算法和 Demko引理的 FIR 滤波器, 釆用的滤波器系数为矩阵 ^的逆矩阵 1的中心元素, 将近似计 算的结果记为 M。
在本步骤中, 该实施例可以通过控制 FIR滤波器的系数来控制计算误差, 比如取 13个系数。 在该实施例中, 选取的系数越多, 计算误差精度也越高, 但是一般根据 Demko引理选取 13个系数。 步骤 603、 将 M代入公式(17 ), 得到分段多项式以及每一个插值的像素 值。
在本步骤中, 由于此分段多项式所有系数均由 M和像素值 组成, 因此 可以得到准确的分段多项式形式, 从而对每一插值点给出像素值。
步骤 604、 根据 FIR滤波的阶数保存部分控制顶点 M (由于 M的 FIR滤 波为四阶, 因此只保存临近四个 '' ), 对下一插值的像素值 继续执行步骤
601 - 604;根据下一插值的像素值 的位置, 更新控制顶点序列直至插值过程 结束(由于 M的 FIR滤波为四阶, 因此只保存临近四个 ^ ), 完成数字图像的 插值处理。
图 7为本发明实施例釆用 B-样条插值方法对数据图像进行插值的方法流 程图, 其具体步骤包括:
步骤 701、 读入数字图像信号, 生成矩阵方程组。
步骤 702、将矩阵方程组通过基于线性系统分解算法和 Demko引理的 FIR 滤波器, 该 FIR滤波器的系数根据 B-样条的阶数选取表 2所示的系数, 得到 滤波结果。
步骤 703、将滤波结果记为'' ,按照现有技术将滤波结果代入到公式中计 算, 得到最终插值多项式。 步骤 704、 根据插值多项式可以得到每一插值点 " '一 1 h 的计 算结果。
在该步骤中, 实际上是对每一控制顶点 M做 FIR滤波处理。 步骤 705、 保存控制顶点 M (对于三阶 B样条, 只需保存临近四个 '' ), 对下一插值的像素值继续执行步骤 701 ~ 704; 根据下一个插值的像素值的位 置, 更新控制顶点序列直至插值过程结束, 完成数字图像的插值处理。
图 8为本发明实施例釆用 B-样条拟合方法对数据图像进行插值的方法流 程图, 在该方法中, 进行插值实际上就是如何求解矩阵方程组 Φ^ = ^, 具体 步骤包括:
步骤 801、 计算 C = ^, 相当于使用 3FIR滤波器 [1/6 2/3 I/6] , 对输 入信号 F作滤波;
步骤 802、 选择一个阶数为 n*n, 充分大的矩阵 Φ ,预先计算 Φ—1 , 取其中 间的第 L"/2」行, L」表示取整运算, 取此行的正中间 K个系数, 作为固定系数 FIR滤波器的系数, 使用该线性系统分解算法和 Demko引理的基于 FIR滤波 器对步骤 801的结果进行滤波, 得到所求的系数 ;
步骤 803、 从系数 ^中选出中间的 4个分别对应 4个样条 -3' -2' -! ' 的 系数, 就可以拟合 [χ! ' χ!+ι ]区间的插值。
本领与普通技术人员可以理解, 上述各实施例中的全部或部分可以通过 程序来指令相应的硬件来完成, 该程序可以存储于一计算机可读取的存储介 质中, 在该程序执行时, 可以包括本发明实施例提供的数字水印嵌入方法、 数字水印检测方法的部分或全部步骤。 其中可读取存储介质例如只读存储器 (简称 ROM )、 随机存取存储器(简称 RAM )、 磁盘、 光碟等。
图 9 为本发明实施例对数字图像进行插值的装置示意图, 包括: 矩阵方 程组生成模块 910和 FIR滤波模块 920 , 其中,
矩阵方程组生成模块 910, 用于根据数字图像信号, 生成矩阵方程组, 发 送给 FIR滤波模块 920;
FIR滤波模块 920, 用于接收所述矩阵方程组, 对所述矩阵方程组釆用基 于线性系统分解算法和 Demko引理的 FIR滤波方式进行滤波, 得到插值, 将 得到的插值插入相应的数字图像信号中。
在本发明实施例中 , FIR滤波模块 920包括第一 FIR滤波模块 921和第二 FIR滤波模块 922, 其中,
第一 FIR滤波模块 921 ,用于对得到矩阵方程组进行滤波,得到分段多项 式和每个插值的像素值, 得到当前插值的控制顶点;
第二 FIR滤波模块 922,用于根据第一 FIR滤波模块 921得到的所述分段 多项式中的下一个插值的像素值运算控制顶点, 参加运算的控制顶点根据每 一个插值的像素值进行更新, 直到插值过程结束。
在本发明实施例中, 这种对矩阵方程簇釆用基于线性系统分解算法和 Demko引理的 FIR滤波方式进行滤波, 完成插值处理可以应用在三阶样条插 值方法、 B-样条插值方法以及 B-样条拟合插值方法。
从本发明实施例提供的方法及装置, 提出了基于线性系统分解算法和 Demko引理的 FIR滤波方式对数字图像信号进行插值, 且确定这种插值方式 可以应用在三阶样条插值方法、 B-样条插值方法以及 B-样条拟合插值方法中 , 在误差处理过程中可以通过相应的 FIR滤波器的阶数来控制。 对于三阶样条 插值方法, 本发明实施例所需要的内存、 计算量和算法实现所要求的硬件方 面都优于追赶法, 而对于 B-样条插值计算, 本发明实施例的 FIR滤波方式比 现有的求解矩阵方程组的方式节省了大量的预算, 另一方面, 本发明实施例 的 FIR滤波方式比现有的 IIR滤波实现方式,在稳定性、线性相位和计算量上 都有节省, 可以被类似地推广到 B-样条拟合的插值算法。
以上是对本发明具体实施例的说明, 在具体的实施过程中可对本发明的 方法进行适当的改进, 以适应具体情况的具体需要。 因此可以理解, 根据本 发明的具体实施方式只是起示范作用, 并不用以限制本发明的保护范围。

Claims

权 利 要求 书
1、 一种对数字图像进行插值的方法, 其特征在于, 该方法包括: 获取数字图像信号, 生成矩阵方程组;
对所述矩阵方程组釆用基于线性系统分解算法和 Demko引理的 FIR滤波方 式进行滤波, 得到插值, 将得到的插值插入相应的数字图像信号中。
2、 如权利要求 1所述的方法, 其特征在于, 所述釆用基于线性系统分解算 法和 Demko引理的 FIR滤波方式进行滤波包括:
进行第一次 FIR运算, 得到矩阵方程组的分段多项式和当前插值的控制顶 点;
进行第二次 FIR运算, 根据所述分段多项式中的下一个插值的像素值运算 控制顶点, 所述参加运算的控制顶点根据每一个插值的像素值进行更新, 直到 插值过程结束。
3、 如权利要求 1所述的方法, 其特征在于, 所述进行滤波釆用的系数为矩 阵方程组的逆矩阵的中心元素值。
4、 如权利要求 1所述的方法, 其特征在于, 所述矩阵方程组为跨对角线收 敛的矩阵方程组。
5、 如权利要求 2所述的方法, 其特征在于, 釆用三阶样条进行插值时, 所 述进行滤波的方法包括:
A、 根据 6(/^' + f _2 ) =dj生成矩阵方程组 , 其中, h为所述数字图像信
h
号的釆样间隔, f为所述数字图像的离散点;
B、 将矩阵方程组 通过基于线性系统分解算法和 Demko引理的 FIR滤波 器, 釆用的滤波器系数为矩阵 的逆矩阵 的中心元素, 得到控制顶点 M , 所 述^ = /), 其中, D为所述数字图像的离散点的矩阵方程组;
C、 将 M代入三阶样条函数, 得到分段多项式以及每一个插值的像素值 ; D、 根据 FIR滤波的阶数保存部分控制顶点 M , 对下一插值的像素值 继 续执行步骤 A ~ C; 根据下一插值的像素值 的位置, 更新控制顶点序列直至插 值过程结束。
6、 如权利要求 2所述的方法, 其特征在于, 釆用 B-样条进行插值时, 所述 进行滤波的方法包括:
A1、将矩阵方程组通过基于线性系统分解算法和 Demko引理的 FIR滤波器, 该 FIR滤波器的系数根据 B-样条的阶数选取, 得到滤波结果 ^;
Bl、 根据滤波结果 ^得到插值多项式, 根据插值多项式得到每一插值点
'一 h 的计算结果, 其中, h 为所述数字图像信号的釆样间隔, f 为所述数字图像的离散点, A(x)为 B-样条下的所述数字图像信号的离散点, mi 为所述数字图像的离散点的二阶导数值, mi的集合为控制顶点 M;
Cl、 保存控制顶点 M , 对下一插值的像素值继续执行步骤 Al ~ B 1 ; 根据 下一个插值的像素值的位置, 更新控制顶点序列直至插值过程结束。
7、如权利要求 6所述的方法,其特征在于,当釆用三阶 B-样条进行插值时, 所述 '为邻近控制顶点 M的四个 ^。
8、 如权利要求 1所述的方法, 其特征在于, 釆用 B-样条拟合进行插值时, 所述进行滤波的方法包括:
所述生成矩阵方程组为 C = , 其中 F为所述数字图像信号的离散函数, B 为三阶样条函数在不同时间位移值, 使用 3阶 FIR滤波器 [1/ 6 2/3 1/ 6] , 对输 入信号 F作滤波, 得到 C;
计算 = Φ_^, 其中 Φ为所选择的阶数为 η*η的矩阵, η为自然数, 得到 ^; 从 中选出中间的 4个分别对应 4个样条 ^,^^,^,^的系数, 得到数字图 像信号的 ',χ'+ι ]区间的插值。
9、 一种对数字图像进行插值的装置, 其特征在于, 包括: 矩阵方程组生成模块(910 ), 用于根据数字图像信号, 生成矩阵方程组, 发送给 FIR滤波模块( 920 );
FIR 滤波模块(920 ), 用于接收所述矩阵方程组, 对所述矩阵方程组釆用 基于线性系统分解算法和 Demko引理的 FIR滤波方式进行滤波, 得到插值, 将 得到的插值插入相应的数字图像信号中。
10、 如权利要求 9所述的装置, 其特征在于, 所述 FIR滤波模块(920 ) 包 括:
第一 FIR滤波模块(921 ), 用于对得到矩阵方程组进行滤波, 得到分段多 项式和当前插值的控制顶点;
第二 FIR滤波模块(922 ), 用于根据第一 FIR滤波模块(921 )得到的所述 分段多项式中的下一个插值的像素值运算控制顶点, 参加运算的控制顶点根据 每一个插值的像素值进行更新, 直到插值过程结束。
PCT/CN2008/073122 2007-12-17 2008-11-20 一种对数字图像进行插值的方法及装置 WO2009076816A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CNB2007101953917A CN100557631C (zh) 2007-12-17 2007-12-17 一种对数字图像进行插值的方法及装置
CN200710195391.7 2007-12-17

Publications (1)

Publication Number Publication Date
WO2009076816A1 true WO2009076816A1 (zh) 2009-06-25

Family

ID=39631472

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/073122 WO2009076816A1 (zh) 2007-12-17 2008-11-20 一种对数字图像进行插值的方法及装置

Country Status (2)

Country Link
CN (1) CN100557631C (zh)
WO (1) WO2009076816A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109816590A (zh) * 2018-12-26 2019-05-28 呈像科技(北京)有限公司 图像外插处理方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100557631C (zh) * 2007-12-17 2009-11-04 华为技术有限公司 一种对数字图像进行插值的方法及装置
US8346021B2 (en) * 2009-05-05 2013-01-01 Analog Devices, Inc. Content adaptive scaler based on a farrow structure
CN102968760B (zh) * 2011-08-30 2016-08-17 富士通株式会社 图像去雾方法和系统
WO2015054901A1 (zh) * 2013-10-18 2015-04-23 华为技术有限公司 一种模拟信息转换设备和方法
CN105869131B (zh) * 2016-04-22 2018-07-17 东南大学 一种对缺失数据修补的位移场重构方法
CN109727196B (zh) * 2018-12-26 2023-06-02 呈像科技(北京)有限公司 图像内插处理方法
CN113721555B (zh) * 2021-08-27 2023-11-28 深圳数马电子技术有限公司 一种s型速度规划的目标速度的确定方法及装置
CN114237161B (zh) * 2021-11-16 2023-07-21 华南理工大学 一种基于数字滤波的工业机器人nurbs曲线插补方法
CN116777178B (zh) * 2023-07-27 2024-01-23 烟台金潮果蔬食品有限公司 一种果蔬汁生产的质量控制方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1336757A (zh) * 2000-07-27 2002-02-20 振玮科技股份有限公司 数码影像内插及清晰度增强的方法
JP2005051393A (ja) * 2003-07-31 2005-02-24 Minolta Co Ltd 撮像装置
CN1988591A (zh) * 2005-12-21 2007-06-27 比亚迪股份有限公司 一种实现异常点数值校正的色彩插值方法
CN101221655A (zh) * 2007-12-17 2008-07-16 华为技术有限公司 一种对数字图像进行插值的方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1336757A (zh) * 2000-07-27 2002-02-20 振玮科技股份有限公司 数码影像内插及清晰度增强的方法
JP2005051393A (ja) * 2003-07-31 2005-02-24 Minolta Co Ltd 撮像装置
CN1988591A (zh) * 2005-12-21 2007-06-27 比亚迪股份有限公司 一种实现异常点数值校正的色彩插值方法
CN101221655A (zh) * 2007-12-17 2008-07-16 华为技术有限公司 一种对数字图像进行插值的方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109816590A (zh) * 2018-12-26 2019-05-28 呈像科技(北京)有限公司 图像外插处理方法

Also Published As

Publication number Publication date
CN101221655A (zh) 2008-07-16
CN100557631C (zh) 2009-11-04

Similar Documents

Publication Publication Date Title
WO2009076816A1 (zh) 一种对数字图像进行插值的方法及装置
Hou et al. Cubic splines for image interpolation and digital filtering
Kim et al. Recursive high-resolution reconstruction of blurred multiframe images
Pillai et al. Blind image deconvolution using a robust GCD approach
JP4568730B2 (ja) 劣化情報復元方法と復元装置
JP3201789B2 (ja) 通信チャネル識別システム
El-Khamy et al. Efficient implementation of image interpolation as an inverse problem
JP2008541282A (ja) データ処理のための離散変換の連続拡張
Miklos Image interpolation techniques
US8224111B2 (en) Method of restoring degraded image, apparatus for restoring degraded image, and computer program product
CN109765611B (zh) 地震数据插值方法及装置
JPH0654172A (ja) 画像拡大方法
Teke et al. Node-asynchronous implementation of rational filters on graphs
JP2003116103A (ja) ディジタル映像処理装置及び方法
Gorinevsky et al. Optimization-based design and implementation of multidimensional zero-phase IIR filters
US8606835B2 (en) Efficient kernel calculation for interpolation
US8682111B2 (en) 2D ringing and overshoot control in image rescaling
JP4057503B2 (ja) 解像度変換用フィルタ係数決定方法,画像解像度変換方法,画像解像度変換装置,映像再符号化方法,映像再符号化装置,解像度変換用フィルタ係数決定プログラム,画像解像度変換プログラム,映像再符号化プログラムおよびそれらのプログラムを記録した記録媒体
Guan et al. Polynomial dictionary learning algorithms in sparse representations
Gadzhiev On the variance of a centered random value roundoff error
JP4788465B2 (ja) 復号化装置、復号化方法及びプログラム
Iwai et al. Methods for avoiding the checkerboard distortion caused by finite word length error in multirate system
CN113837967B (zh) 基于稀疏误差约束表示的野生动物图像去噪方法
JP2013254268A (ja) 画像処理装置および撮像装置
Kolonko et al. Word length optimization of 2-d wave digital filters with weighted quantization error variances

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08862474

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 08862474

Country of ref document: EP

Kind code of ref document: A1