Abstract:
A method and apparatus for color plane interpolation are provided which interpolates the color values of pixels differently depending on an edge direction and whether a pixel is at an edge within an image. The use of the edge detection during the interpolation of each of the colors present in the color pattern helps reduce some of the disadvantages of the loss of image sharpness abundant in known demosaicing techniques.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    This application is a continuation of application Ser. No. 11/319,398, filed Dec. 29, 2005, the entirety of which is incorporated herein by reference. 
         [0002]    The present invention relates to demosacing for use on an image captured by an image sensor. 
     
    
     BACKGROUND OF THE INVENTION 
       [0003]    Image sensors, also known as imagers, were developed in the late 1960s and early 1970s primarily for television image acquisition, transmission, and display. An imager absorbs incident radiation of a particular wavelength (such as optical photons, x-rays, or the like) and generates an electrical signal corresponding to the absorbed radiation. There are a number of different types of semiconductor-based imagers, including charge coupled devices (CCDs), photodiode arrays, charge injection devices (CIDs), hybrid focal plan arrays, and CMOS imagers. 
         [0004]    These imagers typically consist of an array of pixels containing photosensors, where each pixel produces a signal corresponding to the intensity of light impinging on that element when an image is focused on the array. These signals may then be stored, for example, to display a corresponding image on a monitor or otherwise be used to provide information about the optical image. The photosensors are typically phototransistors, photoconductors or photodiodes. The magnitude of the signal produced by each pixel, therefore, is proportional to the amount of light impinging on the photosensor. 
         [0005]    To allow the photosensors to capture a color image, the photosensors must be able to separately detect, for example when using a Bayer pattern, red (R) photons, green (G) photons and blue (B) photons. Accordingly, each pixel must be sensitive only to one color or spectral band. For this, a color filter array (CFA) is typically placed in front of the pixels so that each pixel measures the light of the color of its associated filter. Thus, each pixel of a color image sensor is covered with either a red, green or blue filter, according to a specific pattern (e.g., Bayer pattern). 
         [0006]    For most low cost CMOS or CCD image sensors, the color filters are integrated with the sensors. A common example of a color filter pattern is the tiled color filter array illustrated in U.S. Pat. No. 3,971,065, (the disclosure of which is incorporated by reference herein) and commonly referred to as “the Bayer pattern” color filter. 
         [0007]    As shown in  FIG. 1 , the Bayer pattern  100  is an array of repeating red (R), green (G), and blue (B) filters causing pixels underneath the filters to be red, blue, and green pixels, respectively. In the Bayer pattern  100 , red, green and blue pixels are arranged so that alternating red and green pixels are on a first row  105  of an array, and alternating blue and green pixels are on a next row  110 . These alternating rows are repeated throughout the array. Thus, when the image sensor is read out, line by line, the pixel sequence for the first line reads GRGRGR etc., and then the alternate line sequence reads BGBGBG etc. This output is called sequential RGB or sRGB. 
         [0008]    In the Bayer pattern  100 , sampling rates for all three basic colors are adjusted according to the acuity of the human visual system. That is, green color, to which the human eye is most sensitive and responsive, is sensed with a larger number of sensors, whereas blue and red color, for which the human vision has less resolution, are sensed with a fewer number of sensors. This is why in the Bayer pattern, the green-sensitive elements occur at every other array position, while the red-sensitive elements and the blue-sensitive elements occur at every fourth array position. 
         [0009]    As shown in  FIG. 2  in a solid state image sensor, the Bayer patterned filters may be formed over an array  200  of pixel sensors  205 . Specifically, an array  200  of pixel sensors  205  is formed on a semiconductor substrate  210 . Each pixel sensor  205  has a photosensitive element  215 , which may be any photon-to-charge converting device, such as a photogate, photoconductor or photodiode. The color filter array  220  may be formed over an upper level metal layer  225  in the array  200 , separated from the photosensors  215  by various metallization and insulating layers such as an interlevel dielectric layer (ILD)  235  containing insulator metallization patterns and a passivation layer  230 . The metal layer  225  may be opaque and used to shield the areas of the pixels that are not light sensitive. Convex lenses  240  are formed over the color filters  220 . In operation, incident light is focused by the lenses  240  through the filters  220  to the photosensitive element  215 . 
         [0010]    For a Bayer pattern filter, values for red, green and blue are necessary for each pixel. Since each pixel sensor cell is only sensing one color, values for the remaining two colors are calculated by interpolation from the neighboring pixels that are sensing the missing colors. This color plane interpolation is known as demosaicing. For example, with reference to  FIG. 1 , pixel sensor cell  115  is associated with a green filter, which causes pixel sensor cell  115  to sense green light and produce a signal which represents only green light. In order to obtain an approximation of the amount of red and blue light for pixel sensor cell  115 , a value may be interpolated from the neighboring red pixel sensor cells  120  and  125  and the neighboring blue pixel sensor cells  130  and  135 , respectively. If demosaicing is not performed correctly, the resulting image may suffer from the inclusion of highly visible color artifacts. 
         [0011]    The article entitled “Color Plane Interpolation Using Alternating Projections” published in the IEEE Transactions on Image Processing, Vol. II, No. 9 in September 2002 and written by Bahadir K. Gunturk, Yucel Altunbasak and Russell M. Mersereau (the disclosure of which is incorporated by reference herein) compares several demosaicing techniques. As described each of these demosaicing techniques have their respective advantages and disadvantages. 
         [0012]    As described, for each pixel, the value used for a first color is based on a sensed color (i.e., the light sensed by the pixel&#39;s sensor  205 ) and the values for the remaining two colors are based on an interpolated value from the sensed values of corresponding neighboring pixels. Each of the sensed values are representative of the color value at the center of the pixel. Each of the interpolated color values are also representative of the value at the center of the pixel. The interpolated signal is inherently of a lower quality than the originally sensed signal. For example, an interpolated red color value at the center of a pixel would be different than a sensed red color value for the center of the same pixel. 
         [0013]    Demosaicing methods, which typically only reconstruct the missing color components, may result in artifacts such as so-called zipper effects and random color dots. Additionally, there exists a trade off between filtering for noise and the blurring of sharp edges. Interpolating a pixel using the surrounding pixel values tends to blur the image when pixels at an edge are interpolated. Furthermore, this also leads to a decrease in the sharpness of the image at the edges. This is mainly to due the averaging of pixels which are across an edge contained within the image. The demosaicing method averages pixels so that a pixel at an edge does not have the sharpness desired of an edge pixel. Accordingly, there is a desire and need for color plane interpolation that provides improved demosaicing techniques that detect and account for image edges when calculating interpolation values. 
       BRIEF SUMMARY OF THE INVENTION 
       [0014]    A method and apparatus for color plane interpolation are provided which interpolates the color values of pixels differently depending on an edge direction and whether a pixel is at an edge within an image. The use of the edge detection during the interpolation of each of the colors present in the color pattern helps reduce some of the disadvantages of the loss of image sharpness abundant in known demosaicing techniques. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0015]    The foregoing and other advantages and features of the invention will become more apparent from the detailed description of exemplary embodiments provided below with reference to the accompanying drawings in which: 
           [0016]      FIG. 1  is a top-down illustration of a conventional color filter array; 
           [0017]      FIG. 2  is a cross-sectional view of a portion of a pixel array having a color filter array; 
           [0018]      FIGS. 3A-B  are exemplary top views of a five by five pixel kernel used in an exemplary interpolation scheme of the present invention; 
           [0019]      FIG. 4  is a block diagram of a three by three kernel that is used in accordance with an exemplary embodiment of the invention; 
           [0020]      FIG. 5  is a block diagram of a CMOS imager integrated circuit (IC) having a pixel array constructed according to an exemplary embodiment of the invention; 
           [0021]      FIG. 6  is an illustration of a processor system having a CMOS imager according to the present invention; and 
           [0022]      FIG. 7  is a flow chart illustrating the process of one embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0023]    In the following detailed description, reference is made to the accompanying drawings which form a part hereof, and in which is shown by way of illustration specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention, and it is to be understood that other embodiments may be utilized, and that structural, logical and electrical changes may be made without departing from the spirit and scope of the present invention. 
         [0024]    The term “pixel” refers to a picture element unit cell containing a photosensor and transistors for converting light radiation to an electrical signal. For purposes of illustration, a representative pixel is illustrated in the figures and description herein and, typically, fabrication of all pixels in an imager will proceed simultaneously in a similar fashion. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims. 
         [0025]    It should be understood that reference to a CMOS imager in accordance with the present invention is made for the sole purpose of describing just one example of the present invention. It should be readily apparent that the present invention is not limited to CMOS imagers, but also applies to CCD and other imagers that employ color filters over pixels. Additionally, the current invention is described using a standard three color Bayer pattern. It should be understood that the present invention is not limited to the standard three color Bayer pattern but may be applied to color spaces which use different colors or which use more, or less, than three colors. 
         [0026]      FIGS. 3A ,  3 B are top-down illustrations of a partial pixel array  300  of an imager in accordance with embodiments of the invention. Specifically,  FIGS. 3A ,  3 B illustrate a five by five kernel (discussed below in more detail) used in the present invention. As previously noted, each pixel, e.g., pixel  23 , senses a single color. Accordingly, each green (G) pixel provides a sensed value for green. Similarly, each blue (B) pixel provides a sensed value for blue and each red (R) pixel provides a sensed value for red. For each pixel of a particular color, the values for each of the remaining colors is interpolated to reconstruct the color image. Additionally, as discussed below, the sensed pixel value may also be replaced by an interpolated value. Interpolation of the red, green and blue values eliminate the imbalance resulting from the use of sensed values for one of the colors and interpolated values of the remaining two colors (prevalent in prior art systems). 
         [0027]    As shown in  FIGS. 3A ,  3 B for a particular pixel  45  being processed, the five by five kernel of surrounding pixels is used in the following interpolation calculations, though in many of the interpolation calculations only pixels in the three by three kernel are needed. However, other kernel sizes may also be employed in the invention. 
         [0028]    Generally, for each selected pixel, a three by three interpolated kernel, within the five by five kernel, is first defined and color values for the pixel within the kernel are then calculated. Next, an edge direction is determined. Depending on the pixel color and the edge direction, some values of the three by three kernel may be recalculated. The three by three kernel is then used to determine whether an edge is present for the selected pixel. Then, based on whether an edge is present and the pixel color, interpolation values are calculated. Different interpolation parameters are applied in the interpolation process based on whether a processed pixel is at an image edge, as well as the sensed color of the pixel. 
         [0029]    The interpolation process of the invention can be more clearly understood from the  FIG. 7  flow chart which illustrates the overall interpolation process. In step  701 , a pixel is selected for processing. Throughout the description representative pixel  45  illustrated in  FIGS. 3A ,  3 B and as the center pixel in  FIG. 4 , is used as the exemplary pixel being processed. Next in step  703 , the three by three kernel surrounding the selected pixel is defined (e.g., pixels  34 ,  35 ,  36 ,  44 ,  45 ,  46 ,  54 ,  55 , and  56  in  FIGS. 3A and 3B ). In step  705  it is determined whether pixel  45  is a sensed green pixel. If pixel  45  is green, in step  707  the green values for the three by three kernel are calculated in accordance with equation set (1) below using actual sensed pixel values from the pixels within the three by three kernel.  FIG. 4  illustrates the locations within the three by three kernel for the calculated green values g11, g12, g13, g21, g22, g23, g31, g32, g33 for pixels within the three by three kernel. The three by three kernel is calculated using the actual values of green pixels  25 ,  34 ,  36 ,  45 ,  47 ,  54 ,  56  and  65  illustrated in  FIG. 3A . The three by three kernel is calculated using the following equations: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               11 
                             
                             = 
                             
                               P 
                               34 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             g 
                              
                             
                                 
                             
                              
                             12 
                           
                           = 
                           
                             MEDIAN 
                              
                             
                                 
                             
                              
                             
                               ( 
                               
                                 
                                   P 
                                   25 
                                 
                                 , 
                                 
                                   P 
                                   34 
                                 
                                 , 
                                 
                                   P 
                                   45 
                                 
                                 , 
                                 
                                   P 
                                   36 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               13 
                             
                             = 
                             
                               P 
                               36 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             g 
                              
                             
                                 
                             
                              
                             21 
                           
                           = 
                           
                             MEDIAN 
                              
                             
                                 
                             
                              
                             
                               ( 
                               
                                 
                                   P 
                                   56 
                                 
                                 , 
                                 
                                   P 
                                   47 
                                 
                                 , 
                                 
                                   P 
                                   45 
                                 
                                 , 
                                 
                                   P 
                                   36 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               22 
                             
                             = 
                             
                               P 
                               45 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               23 
                             
                             = 
                             
                               MEDIAN 
                                
                               
                                   
                               
                                
                               
                                 ( 
                                 
                                   
                                     P 
                                     56 
                                   
                                   , 
                                   
                                     P 
                                     65 
                                   
                                   , 
                                   
                                     P 
                                     45 
                                   
                                   , 
                                   
                                     P 
                                     54 
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               31 
                             
                             = 
                             
                               P 
                               54 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               32 
                             
                             = 
                             
                               MEDIAN 
                                
                               
                                   
                               
                                
                               
                                 ( 
                                 
                                   
                                     P 
                                     43 
                                   
                                   , 
                                   
                                     P 
                                     34 
                                   
                                   , 
                                   
                                     P 
                                     45 
                                   
                                   , 
                                   
                                     P 
                                     54 
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               33 
                             
                             = 
                             
                               P 
                               56 
                             
                           
                           , 
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where “P” is the pixel value and “xy” is the pixel number shown in  FIGS. 3A-B . As shown in  FIGS. 3A-B , “x” delineates the row and “y” delineates the column. If pixel  45  is either red or blue as shown in  FIG. 3B , in step  709 , the three by three kernel is calculated using the values of green pixels  24 ,  26 ,  33 ,  35 ,  37 ,  44 ,  46 ,  53 ,  55 ,  57 ,  64  and  65  in accordance with equation set (2) below. The three by three green kernel is then calculated using the following equations: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               11 
                             
                             = 
                             
                               MEDIAN 
                                
                               
                                   
                               
                                
                               
                                 ( 
                                 
                                   
                                     P 
                                     33 
                                   
                                   , 
                                   
                                     P 
                                     24 
                                   
                                   , 
                                   
                                     P 
                                     35 
                                   
                                   , 
                                   
                                     P 
                                     44 
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               12 
                             
                             = 
                             
                               P 
                               35 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               13 
                             
                             = 
                             
                               MEDIAN 
                                
                               
                                   
                               
                                
                               
                                 ( 
                                 
                                   
                                     P 
                                     26 
                                   
                                   , 
                                   
                                     P 
                                     37 
                                   
                                   , 
                                   
                                     P 
                                     35 
                                   
                                   , 
                                   
                                     P 
                                     46 
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               21 
                             
                             = 
                             
                               P 
                               44 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               22 
                             
                             = 
                             
                               MEDIAN 
                                
                               
                                   
                               
                                
                               
                                 ( 
                                 
                                   
                                     P 
                                     44 
                                   
                                   , 
                                   
                                     P 
                                     35 
                                   
                                   , 
                                   
                                     P 
                                     55 
                                   
                                   , 
                                   
                                     P 
                                     46 
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               23 
                             
                             = 
                             
                               P 
                               56 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               31 
                             
                             = 
                             
                               MEDIAN 
                                
                               
                                   
                               
                                
                               
                                 ( 
                                 
                                   
                                     P 
                                     53 
                                   
                                   , 
                                   
                                     P 
                                     44 
                                   
                                   , 
                                   
                                     P 
                                     55 
                                   
                                   , 
                                   
                                     P 
                                     64 
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               32 
                             
                             = 
                             
                               P 
                               55 
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             g 
                              
                             
                                 
                             
                              
                             33 
                           
                           = 
                           
                             MEDIAN 
                              
                             
                                 
                             
                              
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     46 
                                   
                                   , 
                                   
                                     P 
                                     57 
                                   
                                   , 
                                   
                                     P 
                                     55 
                                   
                                   , 
                                   
                                     P 
                                     66 
                                   
                                 
                                 ) 
                               
                               . 
                             
                           
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0000]    In this exemplary embodiment, the same kernel values are interpolated using median interpolation of actual sensed values of surrounding green pixels. The three by three interpolated kernel is green, in this exemplary embodiment, because as previously noted in a Bayer CFA, the green pixels are most prevalent and influential in the image. The values of pixels in the three by three kernel g11, g12, g13, g21, g22, g23, g31, g32, g33, illustrated in  FIG. 4 , are a calculation of the green values of the pixels in the three by three kernel illustrated in  FIGS. 3A and 3B . The green kernel will be used during edge detection and in the calculation of the correction terms. One of ordinary skill in the art would appreciate that other pixel colors may be used to calculate the three by three interpolated kernel or that the kernel may be of a different size. 
         [0030]    Next in step  711 , illustrated in  FIG. 7 , the calculated three by three green kernel is used to determine an edge direction. The values of four edge directions are calculated in step  711 . Dashed lines  2 ,  5 ,  8  and  11 , illustrated in  FIG. 4 , are the four directions for which edge direction calculations are done. The remaining dashed lines are only exemplary for use in calculating the four edge direction values. The sum of each dashed line is calculated in equation set (3) below: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             S 
                              
                             
                                 
                             
                              
                             1 
                           
                           = 
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               11 
                             
                             + 
                             
                               g 
                                
                               
                                   
                               
                                
                               12 
                             
                             + 
                             
                               g 
                                
                               
                                   
                               
                                
                               13 
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             S 
                              
                             
                                 
                             
                              
                             2 
                           
                           = 
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               21 
                             
                             + 
                             
                               g 
                                
                               
                                   
                               
                                
                               22 
                             
                             + 
                             
                               g 
                                
                               
                                   
                               
                                
                               23 
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               3 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 31 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 32 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 33 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               4 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 11 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 21 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 31 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               5 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 12 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 22 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 32 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               6 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 13 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 23 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 33 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               7 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 21 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 11 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 12 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               8 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 13 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 22 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 31 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               9 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 23 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 32 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 33 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               10 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 21 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 31 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 32 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               S 
                                
                               
                                   
                               
                                
                               11 
                             
                             = 
                             
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 11 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 22 
                               
                               + 
                               
                                 g 
                                  
                                 
                                     
                                 
                                  
                                 33 
                               
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             S 
                              
                             
                                 
                             
                              
                             12 
                           
                           = 
                           
                             
                               g 
                                
                               
                                   
                               
                                
                               12 
                             
                             + 
                             
                               g 
                                
                               
                                   
                               
                                
                               13 
                             
                             + 
                             
                               g 
                                
                               
                                   
                               
                                
                               23. 
                             
                           
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0031]    The edge direction value DIR x , where “DIR” is the value and “x” is the direction line number, is calculated for each of the direction lines  2 ,  5 ,  8 , and  11 . The following set of equations (4) are used to calculate the four edge direction values: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               DIR 
                               2 
                             
                             = 
                             
                               max 
                                
                               
                                 ( 
                                 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         1 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         2 
                                       
                                     
                                      
                                   
                                   , 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         2 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         3 
                                       
                                     
                                      
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               DIR 
                               5 
                             
                             = 
                             
                               max 
                                
                               
                                 ( 
                                 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         4 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         5 
                                       
                                     
                                      
                                   
                                   , 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         5 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         6 
                                       
                                     
                                      
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               DIR 
                               8 
                             
                             = 
                             
                               max 
                                
                               
                                 ( 
                                 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         7 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         8 
                                       
                                     
                                      
                                   
                                   , 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         8 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         9 
                                       
                                     
                                      
                                   
                                 
                                 ) 
                               
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             DIR 
                             11 
                           
                           = 
                           
                             
                               max 
                                
                               
                                 ( 
                                 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         10 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         11 
                                       
                                     
                                      
                                   
                                   , 
                                   
                                      
                                     
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         11 
                                       
                                       - 
                                       
                                         S 
                                          
                                         
                                             
                                         
                                          
                                         12 
                                       
                                     
                                      
                                   
                                 
                                 ) 
                               
                             
                             . 
                           
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0000]    The direction having the greatest DIR value is determined to be the edge direction and is determined in step  711 . 
         [0032]    Next in step  713  illustrated in  FIG. 7 , it is determined if pixel  45  undergoing processing is green. If the pixel  45  is not green, in step  713 , it is determined whether the edge direction was in the direction of line  2  (horizontal) in step  714 . If the edge direction was horizontal, g22 is recalculated to account for the edge direction, illustrated in  FIG. 3B . The value of g22 is recalculated using the equation g22=(g21+g23)/2. If in step  714 , the edge direction is not horizontal, it is next determined if the edge direction was in the direction of line  5  (vertical) in step  715 . If the direction was determined to be in vertical direction the pixel value of g22 is recalculated using the equation g22=(g12+g32)/2. However, if in step  715  the edge direction was not vertical, the value of g22 remains unchanged in step  719 . If in step  713  the pixel was determined to be green, the value of g22 remains unchanged. 
         [0033]    Next, in order to determine if an edge is present for processed pixel  45 , difference values are calculated between pairs of the same color pixels for all of the pixels that may be used in calculating the interpolated values. In step  723  if processed pixel  45  is green, the difference values are calculated in step  725  according to equation set (5) below: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               D 
                               1 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   54 
                                 
                                 - 
                                 
                                   P 
                                   36 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               2 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   45 
                                 
                                 - 
                                 
                                   P 
                                   47 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               3 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   35 
                                 
                                 - 
                                 
                                   P 
                                   57 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               4 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   44 
                                 
                                 - 
                                 
                                   P 
                                   66 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               5 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   55 
                                 
                                 - 
                                 
                                   P 
                                   37 
                                 
                               
                                
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             D 
                             6 
                           
                           = 
                           
                             
                                
                               
                                 
                                   P 
                                   64 
                                 
                                 - 
                                 
                                   P 
                                   46 
                                 
                               
                                
                             
                             . 
                           
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0000]    If it is determined in step  723  that the processed pixel  45  is not green, the difference values are calculated in step  727  according to equation set (6) below: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               D 
                               1 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   54 
                                 
                                 - 
                                 
                                   P 
                                   36 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               2 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   56 
                                 
                                 - 
                                 
                                   P 
                                   34 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               3 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   46 
                                 
                                 - 
                                 
                                   P 
                                   44 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               4 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   55 
                                 
                                 - 
                                 
                                   P 
                                   35 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               D 
                               5 
                             
                             = 
                             
                                
                               
                                 
                                   P 
                                   45 
                                 
                                 - 
                                 
                                   P 
                                   43 
                                 
                               
                                
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     D 
                                     6 
                                   
                                   = 
                                   
                                      
                                     
                                       
                                         P 
                                         45 
                                       
                                       - 
                                       
                                         P 
                                         47 
                                       
                                     
                                      
                                   
                                 
                                 ; 
                                 and 
                               
                             
                           
                           
                             
                               
                                 
                                   D 
                                   7 
                                 
                                 = 
                                 
                                   
                                      
                                     
                                       
                                         P 
                                         45 
                                       
                                       - 
                                       
                                         P 
                                         65 
                                       
                                     
                                      
                                   
                                   . 
                                 
                               
                             
                           
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0000]    In step  729 , it is determined whether the maximum difference value among the calculated difference values is greater than a predetermined edge threshold value using an equation (7): 
         [0000]      MAX ( D   1    . . . D   7 )&gt;Edge Threshold.  (7)
 
         [0000]    If the maximum difference value is less than the threshold, no edge is identified as present (step  731 ), however, if the maximum difference value is greater than the threshold, an edge is identified as present (step  733 ). The edge threshold may be set to be application specific or set based on a user&#39;s preferences. 
         [0034]    If no edge is detected in step  729 , it is again determined if processed pixel  45  is green. If processed pixel  45  is green, in step  739  a eighth set (8) of equations is used to calculated the interpolated red, green and blue values of pixel  45 . The eighth set (8) of interpolation equations is: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               R 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     35 
                                   
                                   + 
                                   
                                     P 
                                     55 
                                   
                                   + 
                                   
                                     P 
                                     37 
                                   
                                   + 
                                   
                                     P 
                                     57 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               B 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     44 
                                   
                                   + 
                                   
                                     P 
                                     46 
                                   
                                   + 
                                   
                                     P 
                                     66 
                                   
                                   + 
                                   
                                     P 
                                     64 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             
                               G 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     45 
                                   
                                   + 
                                   
                                     P 
                                     47 
                                   
                                   + 
                                   
                                     P 
                                     54 
                                   
                                   + 
                                   
                                     P 
                                     36 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           , 
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where R 45 , G 45 , and B 45  are the red, green and blue interpolated values for processed pixel  45 . Note that even though pixel  45  is a green pixel, the value is interpolated using the actual sensed value of P 45  as well as the actual values of other green pixel around it. 
         [0035]    If in step  735  it is determined that processed pixel  45  is not green, in step  741  it is determined if processed pixel  45  is blue. If processed  45  is blue, a ninth (9) set of equations is used to calculate the red, green and blue values of pixel  45  in step  747 . The ninth set of equations interpolation is: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               R 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     56 
                                   
                                   + 
                                   
                                     P 
                                     54 
                                   
                                   + 
                                   
                                     P 
                                     36 
                                   
                                   + 
                                   
                                     P 
                                     34 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               B 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     45 
                                   
                                   + 
                                   
                                     P 
                                     43 
                                   
                                   + 
                                   
                                     P 
                                     47 
                                   
                                   + 
                                   
                                     P 
                                     65 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             
                               G 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     44 
                                   
                                   + 
                                   
                                     P 
                                     35 
                                   
                                   + 
                                   
                                     P 
                                     46 
                                   
                                   + 
                                   
                                     P 
                                     55 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           , 
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where R 45 , G 45 , and B 45  are the red, green and blue interpolated values for pixel  45 . If in step  741 , processed pixel  45  is not blue, pixel  45  is red and a tenth (10) set of equations is used to calculate the red, green and blue values of pixel  45  in step  749 . The tenth set of interpolation equations is: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               R 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     45 
                                   
                                   + 
                                   
                                     P 
                                     43 
                                   
                                   + 
                                   
                                     P 
                                     47 
                                   
                                   + 
                                   
                                     P 
                                     65 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               B 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     56 
                                   
                                   + 
                                   
                                     P 
                                     54 
                                   
                                   + 
                                   
                                     P 
                                     36 
                                   
                                   + 
                                   
                                     P 
                                     34 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             
                               G 
                               45 
                             
                             = 
                             
                               
                                 ( 
                                 
                                   
                                     P 
                                     44 
                                   
                                   + 
                                   
                                     P 
                                     35 
                                   
                                   + 
                                   
                                     P 
                                     46 
                                   
                                   + 
                                   
                                     P 
                                     55 
                                   
                                 
                                 ) 
                               
                               / 
                               4 
                             
                           
                           , 
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where R 45 , G 45 , and B 45  are the red, green and blue interpolated values for pixel  45 . 
         [0036]    If an edge was detected in step  729  and processed pixel  45  is green in step  734 , the interpolation values of the red, green and blue values of pixel  45  are calculated using an eleventh (11) set of equations. The eleventh set of interpolation equations is: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               R 
                               45 
                             
                             = 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       P 
                                       35 
                                     
                                     + 
                                     
                                       P 
                                       55 
                                     
                                   
                                   ) 
                                 
                                 / 
                                 2 
                               
                               + 
                               
                                 DELTA 
                                 red 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               B 
                               45 
                             
                             = 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       P 
                                       44 
                                     
                                     + 
                                     
                                       P 
                                       46 
                                     
                                   
                                   ) 
                                 
                                 / 
                                 2 
                               
                               + 
                               
                                 DELTA 
                                 blue 
                               
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             
                               G 
                               45 
                             
                             = 
                             
                               g 
                                
                               
                                   
                               
                                
                               22 
                             
                           
                           , 
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where R 45 , G 45 , and B 45  are the red, green and blue interpolated values for pixel  45  and DELTA blue  and DELTA red  are correction terms. The values of DELTA blue  and DELTA red  are calculated based on which direction the edge was determined to be in step  711 . If the edge direction is in the horizontal line  2  direction, DELTA blue =g22−(g21+g23)/2 and DELTA red =0 and if the edge direction is determine to be vertical line  5  direction, DELTA blue =0 and DELTA red =g22−(g12+g32)/2. Lastly, if the edge direction is determined to be in a diagonal direction  11  or  8 , DELTA blue =g22−(g21+g23)/2 and DELTA red =g22−(g12+g32)/2. 
         [0037]    If in step  734  it is determined that processed pixel  45  is not green, in step  745  it is determined if the processed pixel  45  is blue. If processed pixel  45  is blue, a twelfth (12) set of equations is equations is used in step  751  to calculate the red, green and blue interpolation values. The twelfth set of interpolation equations is: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               R 
                               45 
                             
                             = 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       P 
                                       56 
                                     
                                     + 
                                     
                                       P 
                                       54 
                                     
                                     + 
                                     
                                       P 
                                       36 
                                     
                                     + 
                                     
                                       P 
                                       34 
                                     
                                   
                                   ) 
                                 
                                 / 
                                 4 
                               
                               + 
                               
                                 DELTA 
                                 red 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               B 
                               45 
                             
                             = 
                             
                               P 
                               45 
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             
                               G 
                               45 
                             
                             = 
                             
                               g 
                                
                               
                                   
                               
                                
                               22 
                             
                           
                           , 
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where R 45 , G 45 , and B 45  are the red, green and blue interpolated values for pixel  45  and the value of DELTA red  is calculated using the equation DELTA red =g22−(g11+g13+g31+g33)/4. If in step  745 , processed pixel  45  is not blue, a thirteenth (13) set of equations is used to calculate the red, green and blue values for red processed pixel  45  in step  753 . The thirteenth set of interpolation equations is: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               B 
                               45 
                             
                             = 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       P 
                                       56 
                                     
                                     + 
                                     
                                       P 
                                       54 
                                     
                                     + 
                                     
                                       P 
                                       36 
                                     
                                     + 
                                     
                                       P 
                                       34 
                                     
                                   
                                   ) 
                                 
                                 / 
                                 4 
                               
                               + 
                               
                                 DELTA 
                                 blue 
                               
                             
                           
                           ; 
                         
                       
                     
                     
                       
                         
                           
                             
                               R 
                               45 
                             
                             = 
                             
                               P 
                               45 
                             
                           
                           ; 
                           and 
                         
                       
                     
                     
                       
                         
                           
                             
                               G 
                               45 
                             
                             = 
                             
                               g 
                                
                               
                                   
                               
                                
                               22 
                             
                           
                           , 
                         
                       
                     
                   
                   } 
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where R 45 , G 45 , and B 45  are the red, green and blue interpolated values for pixel  45  and the value of DELTA blue  is calculated using the equation DELTA blue =g22−(g11+g13+g31+g33)/4). The DELTA correction values for the red and blue pixels are based on the edge direction and the green three by three interpolated kernel. 
         [0038]    As described, the invention provides a new and novel system and method for color plane interpolation, in which interpolated values for green, red and blue are calculated based on not only the sensed values obtained but also whether a processed pixel is at an image edge. According to the invention, the imbalance between sensed values and interpolated values is removed by interpolating the values for each of the colors. Further, edge detection and correction terms are utilized to minimize blurring of image edges. 
         [0039]      FIG. 5  illustrates a block diagram of a CMOS imager integrated circuit (IC)  500  having a pixel array  505  containing a plurality of pixels arranged in rows and columns, including a region  510  with, for example, two green pixels (G), one blue pixel (B), and one red pixel (R) arranged in a Bayer pattern. The pixels of each row in array  505  are all turned on at the same time by row select lines  515 , and the pixels of each column are selectively output by respective column select lines  520 . 
         [0040]    The row lines  515  are selectively activated by a row driver  525  in response to row address decoder  530 . The column select lines  520  are selectively activated by a column selector  535  in response to column address decoder  540 . The pixel array  505  is operated by the timing and control circuit  545 , which controls address decoders  530 ,  540  for selecting the appropriate row and column lines for pixel signal readout. 
         [0041]    The pixel column signals, which typically include a pixel reset signal (V rst ) and a pixel image signal (V sig ), are read by a sample and hold circuit  550  associated with the column selector  535 . A differential signal (V rst -V sig ) is produced by differential amplifier  555  for each pixel that is amplified and digitized by analog-to-digital converter  570  (ADC). The analog-to-digital converter  570  supplies the digitized pixel signals to an image processor  575 , which performs the processing method  700  of the invention. Alternatively, image processor  575  can output an image file in a raw format as received from the analog-to-digital converter  570  which can be received and processed in accordance with the invention by a different processor. 
         [0042]    A typical processor system which includes an imager device  605  having a pixel array in which the pixels signals are interpolated according to the present invention is illustrated generally at  600  in  FIG. 6 . The imager device  605  produces an output image from signals supplied from the pixel array. A processor system is exemplary of a system receiving the output of a CMOS imager device. Without being limiting, such a system could include a computer system, camera system, scanner, machine vision system, medical sensor system (such as medical pill sensors), and automotive diagnostic system, and other imaging systems, all of which can utilize the present invention. Alternatively, if the image processor  575  in the imager device  605  provides a progressed image signal, the invention can performed in the processing system  600 . 
         [0043]    A processor system  600 , such as a computer system, for example generally comprises a central processing unit (CPU)  610 , for example, a microprocessor, that communicates with an input/output (I/O) device  615  over a bus  620 . The imager device  605  also communicates with the system over bus  620  or other communication link. The processor-based system  600  also includes random access memory (RAM)  625 , and can include removable memory  630 , such as flash memory, which also communicates with the CPU  610  over the bus  620 . The imaging device  600  may be combined with a processor, such as a CPU, digital signal processor, or microprocessor, with or without memory storage on a single integrated circuit or on a different chip than the processor. 
         [0044]    The invention is not restricted to the above described embodiments. For example, a program embodying the processing method may be stored on a carrier medium which may include RAM, floppy disk, data transmission, compact disk, etc. and then be executed by an associated processor which receives and processes an image file in accordance with the invention or the processing method may be embodied in a circuit or a combination thereof. Additionally, the invention may be implemented as a plug-in for existing software applications or it may used on its own. The invention is not limited to the carrier mediums specified herein and the invention may be implemented using any carrier medium as known in the art. 
         [0045]    It should be understood that other methods of interpolating the values for the green, red and blue colors of the pixels are within the scope of the invention, and the invention is in not limited to the equations or use of the correction terms described above. Specifically, for example, other surrounding pixels may be used in calculating the interpolated values instead or in addition to those discussed herein. As such, the above description and drawings are only to be considered illustrative of an exemplary embodiment which achieves the features and advantages of the invention. Any modification of the present invention which comes within the spirit and scope of the following claims should be considered part of the invention. Accordingly, the invention is not to be considered as being limited by the foregoing description and drawings, but is only limited by the scope of the appended claims.