Abstract:
A method of scaling up an image. The method converts a source image with M*N pixels into a target image with KM*HN pixels and includes the steps of: choosing a pixel from the source image as a processing pixel; analyzing the character of the processing pixel according to values of a plurality of pixels neighboring the processing pixel, and choosing a tilt pattern as a characteristic pattern; calculating a pixel compensation matrix according to the characteristic pattern, the pixel value of the processing pixel, and the values of the pixels neighboring the processing pixel; calculating K*H target pixel values as the target image according to the pixel value of the processing pixel and its corresponding pixel compensation matrix; and repeating the above-mentioned steps until all the pixels of the source image are processed.

Description:
[0001]     This application claims the benefit of the filing date of Taiwan Application Ser. No. 092130173, filed on Oct. 30, 2003, the content of which is incorporated herein by reference.  
       BACKGROUND OF THE INVENTION  
       [0002]     1. Field of the Invention  
         [0003]     The invention relates to an image processing method, and more particularly to a method for scaling up an image.  
         [0004]     2. Description of the Related Art  
         [0005]     The video technology has been widely used in various electrical products. Generally speaking, when the compression/decompression modules utilize the standard video encoder/decoder, such as JPEG, MPEG, MPEG-2, MPEG-4, H.263, H.264, and the like, to process the image frame, the modules have to store the image data in the memory temporarily or permanently for the processing necessity.  
         [0006]     However, in the system having ultra-large frame and ultra-high frame rates, the frame consumes a lot memory space and the system bus bandwidth, and thus tends to increase the system loading. For example, in a HDTV (High-Definition Television), each frame needs the memory space for 1920*1088*1.5=3.13 Mbytes, wherein 1920*1088 is the frame resolution.  
         [0007]     Because the resolution of the frame of HDTV can reach 1920×1088, two problems should be considered. The first problem is that the memory required by the system is too large. The second problem is that the bandwidth consumed by the data transmission of the system is too large. In order to reduce the consumption of the bandwidth and the memory space without changing the architecture of the conventional decoder, the frame data should be compressed before the data is written in the memory or inputted to the bus, and returned to the original condition after the data is read or before the data is inputted to the micro-controller. Hence, the memory space and the transmission bandwidth can be reduced by using the compression unit and decompression unit.  
         [0008]      FIG. 1  is a diagram showing that four points are compressed into one point. Some simple compression methods in the pixel domain will be described in the following.  
         [0009]     1. Average of four points: four points in a 2×2 block of  FIG. 1  are averaged into a point as the compression value of four points. That is,  
         y   ⁡     (     m   ,   n     )       =       1   4     ⁢       ∑     k   =   0     1     ⁢       ∑     h   =   0     1     ⁢       x   ⁡     (       i   +   h     ,     j   +   k       )       .               
 
         [0010]     2. Take the point at the upper-left corner: the upper-left point of the block is directly taken as the compression value of the four points. That is, 
 
 y ( m,n ) =x ( i,j ). 
 
         [0011]     If the compression value is going to be returned to the original shape, one of the following methods may be applied.  
         [0012]     1. Duplicate into four points: the four points in the block use duplicated average.  
         [0013]     2. Bilinear interpolation: take a linear interpolation of two adjacent points to obtain the value of the point between the two adjacent points.  
         [0014]     It is known in the art that the frame compression and decompression methods greatly influence the frame quality. The designer needs to choose a proper method so as to prevent the frame quality from deterioration.  
       SUMMARY OF THE INVENTION  
       [0015]     It is therefore an object of the invention to provide a method for scaling up an image without consuming a lot of memory space.  
         [0016]     An object of the invention is to provide a method for scaling up an image without consuming a lot of transmission bandwidth.  
         [0017]     An object of the invention is to provide a method for scaling up an image without greatly deteriorating image quality.  
         [0018]     To achieve the above-mentioned object, the invention provides a method for scaling up an image. The method scales up a source image (low-resolution image) with the resolution of M*N to a target image (high-resolution image region) with the resolution of KM*HN. The method includes the steps of: choosing a pixel from a source image as a processing pixel; analyzing the characteristic of the processing pixel according to the values of a plurality of neighboring pixels close to the processing pixel and choosing a tilt pattern as a characteristic pattern; generating a pixel compensation matrix according to the characteristic pattern, the value of the processing pixel, and the values of the neighboring pixels; generating K*H target pixels as the target image according to the value of the processing pixel and the pixel compensation matrix; and repeating the above-mentioned steps until all of the pixels of the source image are processed. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0019]      FIG. 1  is a diagram showing that a high-resolution image with 2×2 points is compressed into one point.  
         [0020]      FIG. 2  is a diagram showing that an original pixel point P is scaled up to 2×2 points.  
         [0021]      FIG. 3  shows a flow chart showing the method of the invention for scaling up an image.  
         [0022]      FIG. 4  shows five possible tilt patterns after the original pixel point is scaled up. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0023]      FIG. 2  is a diagram showing that an original pixel point P is scaled up to 2×2 target pixel points P[ 1 ], P[ 2 ], P[ 3 ], and P[ 4 ] according to a embodiment of the invention. The original pixel point P is defined as a processing pixel and chosen from a source image region. On the source image region, the processing pixel P has eight neighboring pixel points, which are the points (A˜H) having the pixel values A to H, respectively.  
         [0024]      FIG. 3  shows a flow chart showing an embodiment of the method of the invention for scaling up an image. The steps of the method of the present invention will be described with reference to  FIG. 2 ,  FIG. 3 , and  FIG. 4 .  
         [0025]     Step S 302 : Choose a pixel from the source image region as the processing pixel P.  
         [0026]     Step S 304 : Analyze the characteristic according to the values of the neighboring pixels close to the processing pixel P and choose a characteristic pattern. The characteristic analyzing is performed to determine the tilt direction of the values of the neighboring pixels. In general, the tilt direction is substantially divided into a vertical direction, a horizontal direction, and two diagonal directions. Hence, the tilt direction of the target pixels is obtained by the characteristic analyzing procedure. Please refer to  FIG. 4 , wherein  FIG. 4 ( a ) shows the vertical tilt direction,  FIG. 4 ( b ) shows the horizontal tilt direction,  FIG. 4 ( c ) shows the left-to-right diagonal tilt direction,  FIG. 4 ( d ) shows the right-to-left diagonal tilt direction, and  FIG. 4 ( e ) shows the smooth pattern.  
         [0027]     To determine which characteristic pattern match the pixel values of the target image region being scaled up, the following weighted summation procedures may be used to calculate eight weighted pixel values (v A  to v H ). 
 
 v   A =2 A+B+D  
 
 v   B =2 B+A+C  
 
 v   C =2 C+B+E  
 
 v   D =2 D+A+F  
 
 v   E =2 E+C+H  
 
 v   F =2 F+D+G  
 
 v   G =2 G+F+H  
 
 v   H =2 H+E+G  
 
         [0028]     wherein v A  to v H  represent the weighted value around the processing pixel P in eight directions. For example, v A  represents the value corresponding to the upper-left direction.  
         [0029]     Next, the tilt direction is determined according to v A  to v H . Usually, the pixel values at two opposite sides along the tilt direction are quite different. That is, the larger the difference between the pixel values in one direction, the more likely the direction being the tilt direction. The tilt direction may be determined according to the following equations: 
 
 d   0   =v   D   −v   E  
 
 d   1   =v   B   −v   G  
 
 d   2   =v   C   −v   F  
 
 d   3   =v   A   −v   H  
 
dir=arg max i  {|d i |}
 
         [0030]     wherein “dir” is the direction value of the tilt direction. That is, when d 0  is the maximum among d i , the characteristic pattern is the horizontal characteristic pattern; when d 1  is the maximum among d i , the characteristic pattern is the vertical characteristic pattern; when d 2  is the maximum among d i , the characteristic pattern is the positive-slope tilt characteristic pattern; and when d 3  is the maximum among d i , the characteristic pattern is the negative-slope tilt characteristic pattern. Accordingly, a characteristic pattern may be chosen according to the direction value dir.  
         [0031]     Step S 306 : Identify whether or not the characteristic pattern meets the above-mentioned assumption which indicates that the value of the processing pixel P ranges between the high point and low point in the tilt direction. This assumption must be correct so as to avoid the error tilt. In other words, it is possible check whether or not the original pixel value and its corresponding neighboring pixel values in the tilt direction satisfy the assumption. For example, if the up and down points in the tile direction are D and E, then D, E and P must satisfy the following relationship: 
 
 D≦P≦E  
 
or 
 
 D≧P≧E  
 
         [0032]     If the above-mentioned relationship is not satisfied, it means that the position of the processing pixel P does not correspond to the assumption of the tilt direction. At this time, it is possible to assume that the 2×2 block including four points P[ 1 ], P[ 2 ], P[ 3 ], and P[ 4 ] is a smooth pattern, or choose a tilt direction corresponding to a second large direction value dir as the characteristic pattern and repeating the identifying procedure. The equations for identifying various direction values dir are as follows: 
 
 dir= 0 D≦P≦E  or  E≦P≦D  
 
 dir= 1 B≦P≦G  or  G≦P≦B  
 
 dir= 2 C≦P≦F  or  F≦P≦C  
 
 dir= 3 A≦P≦H  or  H≦P≦A  
 
         [0033]     Step S 308 : Calculate the pixel compensation matrix. If the direction value dir and the processing pixel P match the above-mentioned conditions, the tilt direction assumption is satisfied and the procedure of calculating the compensation matrix of the tilt direction may be started. In this embodiment, if the compression method represents that four points are compressed into one point, the value of the processing pixel P and the values A to H of the neighboring pixels may be used to generate the p[0:3]. That is,  
           p   ⁡     [   i   ]       =         f   i     ⁡     (     A   ,   B   ,   …   ⁢           ,   H   ,   P     )       +   P       ,     
     ⁢     i   =     0   ~   3           
                             P   =       [           p   ⁡     [   0   ]             p   ⁡     [   1   ]                 p   ⁡     [   2   ]             p   ⁡     [   3   ]             ]     =       [             f   0     ⁡     (     A   ,   …   ⁢           ,   H   ,   P     )               f   1     ⁡     (     A   ,   …   ⁢           ,   H   ,   P     )                   f   2     ⁡     (     A   ,   …   ⁢           ,   H   ,   P     )               f   3     ⁡     (     A   ,   …   ⁢           ,   H   ,   P     )             ]     +     P   ⁡     [         1       1           1       1         ]                                     
 
         [0034]     wherein f i (A,B, . . . ,H,P) represents the compensation matrix. In this embodiment, the forms of f 0  to f 3  may be simplified by an exact matrix set and an exact function set. The exact matrix set and the exact function set may be determined according to the tilt direction. First, a plurality of 2 by 2 matrixes may be chosen as the exact matrix set S. In addition, several functions are chosen to be the exact function set U. Each element β in S corresponds to a function g i (A, . . . ,H,P) in the set U. P[i] is a multiple of one of the elements β, and the multiple is g i (A, . . . ,H,P). That is, the pixel value of the processing pixel P and the values of the corresponding neighboring pixels are substituted into the corresponding exact function set U to generate a plurality of scalar values. Thereafter, these scalar values are respectively multiplied by its corresponding exact matrix S so as to obtain the following compensation values of pixel (referred to as P 1 ).  
         S   =     {       β   0     ,   …   ⁢           ,     β     N   -   1         }       ,     U   =     {         {       g   0     ⁡     (     A   ,   …   ⁢           ,   H   ,   P     )       }     ⁢     
     ⁢     ∃   i       ,       β   i     ∈     ,           g   i     ∈   U     ⁢     
     ⇒     P   ⁡     [   i   ]         =           g   i     ⁡     (     A   ,   …   ⁢           ,   H   ,   P     )       ×     β   i       =         g   i     ⁡     (     A   ,   …   ⁢           ,   H   ,   P     )       ×     [           β     i   ,   0             β     i   ,   1                 β     i   ,   2             β     i   ,   3             ]                     
 
         [0035]     For example, the set S may be chosen as:  
       S   ⁢       {       [         1         -   1             1         -   1           ]     ,     [         1       1             -   1           -   1           ]     ,     [         0       1             -   1         0         ]     ,     [         1       0           0         -   1           ]       }     .         
 
         [0036]     The corresponding function set U is:  
       U   =     {       g   0     ,     g   1     ,     g   1     ,     g   3       }         
         g   0     =         (     B   +   E     )     -     (     D   +   G     )       8         
         g   1     =         (     B   +   D     )     -     (     E   +   G     )       8         
         g   2     =         (       2   ⁢   D     +   A   +   F     )     -     (       2   ⁢   E     +   C   +   H     )       16         
         g   3     =         (       2   ⁢   B     +   A   +   C     )     -     (       2   ⁢   G     +   F   +   H     )       16         
 
         [0037]     wherein the exact matrix set S and the exact function set U are defined in advance. Thereafter, the corresponding exact matrix and exact function are chosen according to the tilt direction. That is, a proper exact matrix and function may be selected according to the actual condition so that the optimum adjustment may be made.  
         [0038]     Step S 310 : Calculate the target pixel value. A plurality of target pixel values are obtained by adding the pixel value of the processing pixel and its corresponding pixel compensation matrix together. A target image may be obtained by properly placing the target pixel into the source image. The target image is the scaled up source image.  
         [0039]     Step S 312 : Identify whether or not the method is finished. The above-mentioned steps are repeated until all pixels to be processed are processed.  
         [0040]     While certain exemplary embodiments have been described and shown in the accompanying drawings, it is to be understood that such embodiments are merely illustrative of and not restrictive on the broad invention, and that this invention not be limited to the specific construction and arrangement shown and described, since various other modifications may occur to those ordinarily skilled in the art.