Abstract:
A composite method and apparatus for adjusting an image resolution are provided, which are applied for adjusting a digital image or de-interlace scanning, especially for achieving an edge enhancing effect. The composite method may include: obtaining an original image and a scaling factor for adjustment S; after that, detecting an edge of the original image and generating an edge map for the original image; then, calculating and generating an adjusted image with 2 n  newly-added pixels according to the edge map and the scaling factor for adjustment; and finally, with a bilinear algorithm, converting the adjusted image into a final image, which is S times the original one.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS  
       [0001]     This non-provisional application claims priority under 35 U.S.C. § 119(a) on Patent Application No(s). 094146855 filed in Taiwan, R.O.C. on Dec. 27, 2005 and Application No(s). 60/686,408 filed in United States on Jun. 2, 2005, the entire contents of which are hereby incorporated by reference. 
     
    
     BACKGROUND OF THE INVENTION  
       [0002]     1. Field of Invention  
         [0003]     The present invention relates to a method and apparatus for adjusting an image resolution, and more particularly to a method and apparatus for enabling a digital image still to achieve an edge enhancing effect through a composite process, even after the digital image has been scaled or de-interlace scanned.  
         [0004]     2. Related Art  
         [0005]     In recent years, due to technical breakthroughs, the yields of liquid crystal panel (LCD) manufacturers have been continuously increasing. Therefore, the LCD is not limited to be used in notebooks but has also begun to be used in desktops, and has become the mainstream of the market. What&#39;s more, LCD manufacturers have begun to manufacture large-size panels to meet the demands of high definition televisions (HDTVs).  
         [0006]     However, although by name called high definition televisions (HDTVs), the high definition quality of a frame mainly depends on the source itself. If the source signals are analog signals, when the analog signals are converted to digital signals, the frame is more likely to be distorted. Preferably, one point on the frame is directly displayed by a corresponding point on a screen, which results in the best displaying effect, i.e., directly displaying pixels. However, since resolutions of HDTVs are different due to different sizes, and even the resolutions of the sources of display frames may not be the same, HDTVs often cannot show the deserved frame quality.  
         [0007]     As shown in  FIG. 1 , it is assumed that the resolution of a source image  110  is N s ×M y , and the resolution of an HDTV image  120  is S times of that of the source image, supposing N s ×M s . Generally, the results of N y /N x  and M s /M y  cannot be multiples of 2. As shown in  FIG. 2 , it is a schematic view of the conversion of corresponding pixel values of the source image  110  and the HDTV image  120 . Provided that the resolution  210  of the source image is 4×4, and the resolution  220  of the HDTV image is 5×5, it can be seen that the corresponding pixel values are substantially different due to different resolutions. If inappropriately treated, not only does the edge become fuzzy, but also the whole frame appears unsmooth.  
       SUMMARY OF THE INVENTION  
       [0008]     In view of the above problems, an object of the present invention is to provide a composite method and apparatus for adjusting an image resolution. A frame is firstly edge detected to find out a true edge, and then the non-edge part is calculated, so as to achieve an edge enhancing effect.  
         [0009]     According to one embodiment of the present invention, the composite method for adjusting an image resolution disclosed by the present invention at least comprises the steps as follow.  
         [0010]     Firstly, the pixel values for each point of an original image are obtained from a signal source. Then, the edge of the original image is captured with an edge detection algorithm. An edge map for the original image is generated in a memory for recording the position of the edge. Next, the scaling factor for adjustment S of the original image is obtained, i.e., the multiple between the resolution of the HDTV and that of the source image. After that, according to the edge map and the scaling factor for adjustment, 2 n  newly-added pixels in the adjusted image are calculated and generated through an interpolation method. And finally, through a bilinear algorithm, the obtained adjusted image is converted into a final image, which is S times the original one.  
         [0011]     The features and practice of the present invention will be illustrated below in detail through preferred embodiments with reference to the accompanying drawings.  
         [0012]     Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0013]     The present invention will become more fully understood from the detailed description given herein below for illustration only, and which thus is not limitative of the present invention, and wherein:  
         [0014]      FIG. 1  shows an example of converting the corresponding pixel values of the source image and the HDTV;  
         [0015]      FIG. 2  is an embodiment of a newly-added pixel with four nearest points;  
         [0016]      FIG. 3  is another embodiment of a newly-added pixel with six nearest points;  
         [0017]      FIG. 4  is a flow chart of the method of one embodiment of the present invention;  
         [0018]      FIG. 5  is a decision tree of formulas for calculating a newly-added pixel in the present invention; and  
         [0019]      FIG. 6  is a method for determining whether the edge is true or false in the present invention. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0020]     The present invention discloses a composite method and apparatus for adjusting an image resolution. In the following detailed illustration of the present invention, various specific details will be described to provide an overall illustration of the present invention. However, those skilled in the art can implement the present invention without referring to the specific details, or implement the present invention with alternative elements or method. Under other circumstances, the known methods, procedures, members, and circuits will not be illustrated in detail, so as to avoid unnecessarily confusing the focus of the present invention.  
         [0021]     In order to prevent the edge of the source image from becoming fuzzy, unclear, or even unsmooth after having been adjusted according to the resolution of an HDTV, the edge of the source image is found in the present invention through an edge detection algorithm, such as a Sobel method, a Laplace method, a Robert method, or a second order method. The definition of the edge is maintained effectively through the 2 n  magnitude scaling method, and the final resolution is achieved through a bilinear algorithm, i.e., the so-called composite method for adjusting image solution, wherein the value n is determined to make the value 2 n  being closest to the image scaling factor S; and the proportion of the bilinear algorithm is equal to S/2 n .  
         [0022]     During implementation, the original image is divided into multiple blocks. The data of each block is loaded into a memory. Each block is used to read each image pixel line by line into the memory for being processed.  
         [0023]     Therefore, referring to  FIG. 5 , it is the flow chart of the method of one embodiment of the present invention. Firstly, the pixel values of each point of the original image are obtained from the signal source end by a chip processing module; and according to the resolution of the original image and the new resolution, the scaling factor for adjustment S there-between is calculated (Step  510 ). Supposing that the horizontal resolution of the original image is 720 and the vertical resolution is 480, when the horizontal resolution of the HDTV is 1920, the horizontal adjustment multiple is 2.67 (1920/720). Additionally, if the vertical resolution of the HDTV is 1080, the vertical adjustment multiple is 2.25 (1080/480).  
         [0024]     Then, the edge of the original image is captured through the edge detection algorithm (Step  520 ). Next, an edge map of the original image is generated in the memory. The edge map is a 720×480 table, taking that of the above embodiment as an example, and the internal elements are binary codes, and the internal element being marked as 1 indicates that the point with the corresponding position is located on the edge. When 2 n  times enlargement is performed, taking the prior embodiment as an example, n is set to 1, i.e., the point will be enlarged by a factor of two, and then bilinear enlargement for 2.76/2 and 2.25/2 is conducted, respectively.  
         [0025]     When two times enlargement is performed, the neighboring points of the point to be interpolated are determined first, as shown in  FIG. 3  or  FIG. 4 . As for  FIG. 3 , the flag of  FIG. 6  is set to 0, and as for  FIG. 4 , the flag of  FIG. 6  is set to 1. Therefore, subsequently, as shown in  FIG. 3  or  FIG. 4 , provided that the central point x is the newly-added pixel  430  after the image has been adjusted, whether the point x is located on the edge can be determined according to the edge map generated after the image is recorded and adjusted in Step  530  (Step  540 ). When the point x of the newly-added pixel  430  is determined not to be located in any edge, if the flag is equal to 0, the average of the ambient four points is regarded as the value of a newly-added pixel  330  through the algorithm of Formula (1) (Step  550 ); and if the flag is equal to 1, the average of the top point and bottom point is regarded as the value of the newly-added pixel  430  through the algorithm of Formula (6) (Step  550 ).  
         [0026]     As shown in  FIG. 6 , whether or not to determine an edge or an edge direction is determined by the values in the edge map of the binary codes generated through the edge detection algorithm. If the values of Point A 1  and Point B 3  in the edge map of the binary codes are both 1, then edge A 1  B 3  is 1; otherwise, edge A 1  B 3  is 0, and so forth. In  FIG. 6 , if edge A 1  B 3  or edge A 3  B 1  is 1, whether the edge is a true edge or not must be further determined, so as to determine the final interpolation method.  
         [0027]     The method for determining whether or not the edge is true is shown in  FIG. 7 . If the values of Point A 1  and Point B 3  in the edge map of the binary codes are both 1, i.e., edge A 1  B 3  is 1, with the algorithm on the right side of  FIG. 7 , that is, the average value of the differences of the pixel points on each side of the line A 1 B 3  is calculated and then compared with the difference between the values of the two points A 2  and B 2  across A 1  B 3 . Only if the difference between the values of Points A 2  and B 2  is far greater than the average value of the differences of the pixel points on each side of the line A 1 B 3  is the line between A 1  and B 3  determined to be a true edge. In a similar way, whether or not the edge A 3  B 3  is a true edge may be determined.  
         [0028]     Provided that Points A 1  and B 3  are fall in and are located at the edge  420 , the value of the newly-added pixel  430  will be calculated through the two points of pixels on the edge  420  with by interpolation. As shown in  FIG. 7 , the pixel value of x is calculated with Formula (2). If the pixel value of Point A 1  is A 1  and the pixel value of Point B 3  is B 3 , the pixel value of Point x is (A 1 +B 3 )/2. If Points A 2  and B 2  are located at the edge  420 , the pixel value of x is calculated with Formula (3). If the pixel value of Point A 2  is A 2  and the pixel value of Point B 2  is B 2 , the pixel value of Point x is (A 2 +B 2 )/2. If Points A 3  and B 1  are located at the edge  420 , the pixel value of x is calculated with Formula (4). If the pixel value of Point A 3  is A 3  and the pixel value of Point B 1  is B 1 , the pixel value of Point x is (A 3 +B 1 )/2 (Step  560 ).  
         [0029]     As mentioned above, the pixel value of each of the newly-added pixels x i  is obtained through the following determinations: 
        when more than three points among the ambient six points corresponding to the internal elements of the edge map are 1, or all of them are 0,  
           x   i     =           A     1   +       ⁢     A   3       +     B   1     +     B   3         4   ⁢                 ;       
    otherwise  
           x   i     =           (       A   1     +     B   3       )     ⁢           ⁢   edge   ⁢           ⁢     A   1     ⁢     B   3       +       (       B   1     +     A   3       )     ⁢           ⁢   edge   ⁢           ⁢     B   1     ⁢     A   3           2   ⁢     (       edge   ⁢           ⁢     A   1     ⁢     B   3       +     edge   ⁢           ⁢     B   1     ⁢     A   3         )           ;       
    wherein edge A i B j  is a binary code, indicating that whether the edge defined by Point A i  and Point B i  is located on the edge indicted by the edge map.        
 
         [0033]     As for each newly-added pixel  330  or  430 , the values of Y, U, and V or the values of R, G. and B must be calculated. If each point must be calculated three times, obviously more time is taken for calculation. Therefore, a decision mapping table is further added in the memory. When the formula used for adjusting the newly-added pixel  430  is determined for the first time, for example, supposing that after Value Y has been calculated, it is concluded that Formula (1) is required for conducting adjustment, the field corresponding to the newly-added pixel  430  in the table is marked as 0. If Formula (2) or (6) is required, the field corresponding to the newly-added pixel  430  in the table is marked as 2. If Formula (3) is required, the field corresponding to the newly-added pixel  430  in the table is marked as 1. If Formula (4) is required, the field corresponding to the newly-added pixel  430  in the table is marked as 3. As such, when the values of U and V of the newly-added pixel  330  or  430  are calculated, the formula corresponding to a marked number in the decision mapping table is directly selected without any determinations.  
         [0034]     As mentioned in the above embodiments, provided that the horizontal adjustment multiple is 2.67 and the vertical adjustment multiple is 2.25, an adjusted image with two times enlarged pixel values will be obtained through one interpolation process, i.e., the resolution becomes 1440×960. However, the vertical resolution of the HDTV is 1920×1080, such that the horizontal resolution of the adjusted image will be further adjusted to 1.335 times and the vertical resolution will be adjusted to 1.125 times through the bilinear algorithm. Therefore, a frame with the resolution required by the HDTV can be achieved, and an edge enhancing effect also can be achieved after the image has been adjusted.  
         [0035]     The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.