Abstract:
An apparatus for image processing includes: an edge detection module, for performing an image edge detection for each pixel in an original image data and generating at least one edge detection result for a target pixel in the original image data; a step-wise gain controlling module, coupled to the edge detection module, for determining at least one gain coefficient of the target pixel according to the edge detection result; and a calculation module, coupled to the step-wise gain controlling module, for adjusting an original gray value of the target pixel to generate an output gray value of the target pixel according to the gain coefficient.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to image processing, and more particularly, to a method and apparatus for adjusting image sharpness by using a step-wise gain control mechanism. 
         [0003]    2. Description of the Prior Art 
         [0004]    A conventional image processing apparatus  100  shown in  FIG. 1  is provided to enhance the sharpness of image edges. The image processing apparatus  100  comprises a high-pass filter  110 , a multiplier  120 , a coring operation unit  130  and an adder  140 . The high-pass filter  110  performs a high-pass filtering operation for an original incoming image data and generates a high-pass filtering result. Then the multiplier  120  multiplies the high-pass filtering result by a parameter khp to generate an edge detection result. Afterwards, the coring operation unit  130  performs well-known coring operations for the edge detection result with an input-to-output relation as shown in  FIG. 2 . Finally, the adder  140  sums up the original image data and an operation result of the coring operation unit  130  to generate an adjusted image data. 
         [0005]    Please refer to  FIG. 2 .  FIG. 2  is a schematic diagram illustrating an input-to-output relation of a typical coring operation. When an absolute value of an input value falls within a range between zero and a threshold value th_c, the output value is set to zero, and when an absolute value of an input value is greater than the threshold value th_c, the input value is, for example, closer or equal to the output value. In the prior art apparatus shown in  FIG. 1 , the input value represents the edge detection result while the output value represents the coring operation result of the coring operation unit  130 . 
         [0006]    However, before being processed by the coring operation, the input values may vary in a range due to noise interference. Therefore, the closer the input value is to the threshold value th_c, the greater the output value variation (jumping between zero and a value near d 1 ) due to the noise interference. For example, if during a period in which the original image data are static, ideally the adjusted image data are also static; however, due to the noise influence mentioned above, some pixels of adjusted image data may have different gray values during this period, and what&#39;s worse, these different gray values of the pixels are concentrated around the value d 1  and 0. As a result, the flicker occurs and the image quality degrades greatly. 
         [0007]    On the other hand, in the image edge of the original image data, the edge detection result is large enough to make the summation of the coring operation result and the gray value of the original image data greater than 255; that is, the gray value of the adjusted image data is greater than 255 and exceeds the maximum gray value that can be displayed. Therefore white points occur at the image edge during the image processing shown in  FIG. 1  and this phenomenon is called “overshoot”. 
         [0008]    Flicker and overshoot are the side effects of the conventional image edge processing apparatus  100 , and seriously influence the image quality. 
       SUMMARY OF THE INVENTION 
       [0009]    It is therefore one of the objectives of the claimed invention to provide a method and an apparatus for adjusting image sharpness through a step-wise gain control, to solve the above-mentioned problems and enhance the image quality. 
         [0010]    According to one embodiment of the claimed invention, an image processing apparatus comprises: an edge detection module, for performing an image edge detection for each pixel in an original image data and generating at least one edge detection result for a target pixel in the original image data; a step-wise gain controlling module, coupled to the edge detection module, for determining at least one gain coefficient of the target pixel according to the edge detection result; and a calculation module, coupled to the step-wise gain controlling module, for adjusting an original gray value of the target pixel to generate an output gray value of the target pixel according to the gain coefficient. 
         [0011]    According to one embodiment of the claimed invention, an image processing method comprises: performing an image edge detection for each pixel in an original image data and generating at least one edge detection result for a target pixel in the original image data; determining at least one gain coefficient of the target pixel according to the edge detection result; and for adjusting an original gray value of the target pixel to generate an output gray value of the target pixel according to the gain coefficient. 
         [0012]    These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0013]      FIG. 1  is a prior art image processing apparatus. 
           [0014]      FIG. 2  is a schematic diagram of input-to-output relation of a typical coring operation. 
           [0015]      FIG. 3  is an image processing apparatus according to a first embodiment of the present invention. 
           [0016]      FIG. 4  illustrates a flowchart of the operations of the image processing apparatus shown in  FIG. 3 . 
           [0017]      FIG. 5  is an exemplary diagram illustrating the relationship between an absolute value of the edge detection result and a gain coefficient. 
           [0018]      FIG. 6  is an image processing apparatus according to a second embodiment of the present invention. 
           [0019]      FIG. 7  illustrates a flowchart of the operations of the image processing apparatus shown in  FIG. 6 . 
           [0020]      FIG. 8  is an image processing apparatus according to a third embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION 
       [0021]    Certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an open-ended fashion, and thus should be interpreted to mean “including, but not limited to . . . ” The terms “couple” and “couples” are intended to mean either an indirect or a direct electrical connection. Thus, if a first device couples to a second device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections. 
         [0022]    Please refer to  FIG. 3 .  FIG. 3  is an image processing apparatus  300  according to a first embodiment of the present invention. In this exemplary embodiment, the image processing apparatus  300  comprises an edge detection module  310 , a step-wise gain controller  320  and a calculation module  330 . As shown in  FIG. 3 , the edge detection module  310  comprises a high-pass filter  312  and a first multiplier  314 ; and the calculation module  330  comprises a second multiplier  332  and an adder  334 . 
         [0023]    Please refer to  FIG. 3  in conjunction with  FIG. 4 .  FIG. 4  illustrates a flowchart illustrating operations of the image processing apparatus  300  shown in  FIG. 3 . Provided that the result is substantially the same, the steps are not limited to be executed according to the exact order shown in  FIG. 4 . Referring to the flowchart, the operations of the image processing apparatus  300  are further described as follows. 
         [0024]    In Step  402 , the high-pass filter  312  performs a high-pass filtering operation on the original image data, and then in Step  404 , the first multiplier  314  multiplies a high-pass filtering result HPF of a target pixel by a first parameter kph to generate an edge detection result ΔP. In Step  406 , the step-wise gain controller  320  determines a gain coefficient Cg of the target pixel according to the edge detection result ΔP. In Step  408 , the second multiplier  332  multiplies the edge detection result ΔP by the gain coefficient Cg to generate an adjusted edge detection result ΔP′. And finally, in Step  410 , the adder  334  sums up the original gray value P of the target pixel and the adjusted edge detection result ΔP′ to generate an output gray value P′ of the target pixel. The formulas of the above operations are as follows: 
         [0000]      Δ P=khp*HPF   (1) 
         [0000]      Δ P′=ΔP*Cg   (2) 
         [0000]        P′=P+ΔP′   (3) 
         [0025]    Therefore the operation of a pixel is completed, and then the image processing apparatus  300  sequentially performs the above-mentioned operations on every pixel to generate an adjusted image data. 
         [0026]    In this embodiment, the gain coefficient Cg of the target pixel is determined according to the edge detection result (Step  406 ).  FIG. 5  is an exemplary diagram illustrating the relationship between absolute value of the edge detection result |ΔP| and the gain coefficient Cg. As shown in  FIG. 5 , absolute values of the edge detection result |ΔP| are divided into six regions, where the absolute values of edge detection result |ΔP| between two adjacent regions are th 0 , th 1 , th 2 , th 3 , and th 4  respectively. When the absolute value of the edge detection result |ΔP| falls in a range between zero and th 0 , the step-wise gain controller  320  sets the gain coefficient of the target pixel to zero to thereby prevent the flicker due to noise interference. On the other hand, in order to prevent the “overshoot” issue mentioned before, when the absolute value of the edge detection result |ΔP| is greater than th 3 , the greater the absolute value of the edge detection result |ΔP|, the less the gain coefficient Cg, therefore the gain coefficient gain_ 4  is less than gain_ 3  shown in  FIG. 5 . 
         [0027]    In the prior art coring operation unit  130 , when the absolute value of the edge detection result |ΔP| is greater than the threshold value th_c, the edge detection result is equal to the coring operation result. Compared with the step-wise gain controller  320 , the gain coefficient Cg is one. However, like the disadvantage of the image processing apparatus  100  mentioned before, the greater the difference between two gain coefficients Cg of two neighboring regions of the absolute value of the edge detection result |ΔP|, the more serious the flicker. Therefore, in the range between th 0  and th 2  shown in  FIG. 5 , the gain coefficient Cg increases as the absolute value of the edge detection result |ΔP| increases, thereby reducing the flicker. 
         [0028]    Of course, in the range of the gain coefficient Cg from zero to one, the more regions of the absolute value of the edge detection result |ΔP| there are, the more steps of the gain coefficients there will be, and thus the slighter the flicker. 
         [0029]    Please note that, the relationship between absolute value of the edge detection result |ΔP| and the gain coefficient Cg shown in  FIG. 5  is for illustrative purposes only. Without departing from the spirit of the present invention, the number of regions and the corresponding gain coefficients can be determined by the designer&#39;s considerations. These alternative designs all fall in the scope of the present invention. 
         [0030]    However, the image processing apparatus  300  can only enhance the obvious and clear edges with high contrast or severe brightness variation. If the unobvious and blurred edges with tiny brightness variations are to be enhanced, a band-pass filter is needed in the image processing apparatus. 
         [0031]      FIG. 6  is an image processing apparatus  600  according to a second embodiment of the present invention. The image processing apparatus  600  comprises an edge detection module  610 , a step-wise gain controller  620  and a calculation module  630 . As shown in  FIG. 6 , the edge detection module  610  comprises a high-pass filter  612 , a first multiplier  614 , a band-pass filter  616 , a second multiplier  618  and a first adder  619 ; and the calculation module  630  comprises a third multiplier  632  and a second adder  634 . 
         [0032]    Please refer to  FIG. 6  in conjunction with  FIG. 7 .  FIG. 7  illustrates a flowchart of the operations of the image processing apparatus  600  shown in  FIG. 6 . Provided that the result is substantially the same, the steps are not limited to be executed according to the exact order shown in  FIG. 7 . Referring to the flowchart, the operations of the image processing apparatus  600  are further described as follows. 
         [0033]    In Step  702 , the high-pass filter  612  performs a high-pass filtering operation for the original image data and the band-pass filter  616  performs band-pass filtering for the same original image data. Then in Step  704 , the first multiplier  614  multiplies a high-pass filtering result HPF of a target pixel by a first parameter kph to generate a first edge detection result, while the second multiplier  618  multiplies a band-pass filtering result BPF of a target pixel by a second parameter kbh to generate a second edge detection result. In Step  706 , the first adder  619  sums up the first edge detection result and the second edge detection result to generate an edge detection result ΔP. In Step  708 , the step-wise gain controller  620  determines a gain coefficient Cg of the target pixel according to the edge detection result ΔP. In Step  710 , the third multiplier  632  multiplies the edge detection result ΔP by the gain coefficient Cg to generate an adjusted edge detection result ΔP′. And finally, in Step  712 , the adder  634  sums up the original gray value P of the target pixel and the adjusted edge detection result ΔP′ to generate an output gray value P′ of the target pixel. The formulas of the above operations are as follows: 
         [0000]      Δ P=khp*HPF+kbp*BPF   (4) 
         [0000]      Δ P′=ΔP*Cg   (5) 
         [0000]        P′=P+ΔP′   (6) 
         [0034]    Therefore the operation of a pixel is completed, and then the image processing apparatus  600  sequentially performs the above-mentioned operations on every pixel to generate an adjusted image data. 
         [0035]      FIG. 8  is an image processing apparatus  800  according to a third embodiment of the present invention. The image processing apparatus  800  comprises an edge detection module  810 , a step-wise gain controlling module  820  and a calculation module  830 . As shown in  FIG. 8 , the edge detection module  810  comprises a high-pass filter  812 , a first multiplier  814 , a band-pass filter  816  and a second multiplier  818 ; the step-wise gain controlling module  820  comprises a first step-wise gain controller  822  and a second step-wise gain controller  824 ; and the calculation module  830  comprises a third multiplier  832 , a fourth multiplier  834  and an adder  836 . 
         [0036]    The operations of the image processing apparatus  800  are similar to perform the operations of the image processing apparatus  300  twice. In this exemplary embodiment, the image processing apparatus  800  comprises two step-wise gain controller and generates a first adjusted edge detection result and a second adjusted edge detection result. The adder  836  of the image processing apparatus  800  then sums up the original gray value of the target pixel, the first adjusted edge detection result and the second adjusted edge detection result to generate an output gray value of the target pixel. As a person skilled in this art can readily understand operations of the circuit components included in the image processing apparatus  800  after reading above disclosure, further description is omitted here for the sake of brevity. 
         [0037]    Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention.