Abstract:
A method for replacing defective pixels in a digital color image includes determining whether each pixel has defective data in a selected color channel; for the pixel, determining whether a first reference color channel exists and, if so, correcting the defective data by defining a group of neighboring pixels; for each of m neighboring pixels having non-defective data in the selected color channel and the reference color channel, computing a sum of the differences between the non-defective data in the selected color channel and the non-defective data in the first reference color channel; adding the sum of the differences divided by m to the non-defective data value from the first reference color channel to obtain a result; dividing the result by two to obtain a substitution data value; and substituting the substitution data value for the defective data.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application claims the benefit of U.S. Provisional Patent Application Ser. No. 61/384,110, filed Sep. 17, 2010, and the benefit of U.S. Provisional Patent Application Ser. No. 61/384,693, filed Sep. 20, 2010, the entirety of both of which are incorporated herein. 
     
    
     BACKGROUND 
       [0002]    1. Field of the Invention 
         [0003]    The present invention relates to correction of defective pixels in digital images. More particularly, the present invention relates to methods for performing fast pixel correction in digital color images. 
         [0004]    2. The Prior Art 
         [0005]    There are numerous methods known in the prior art for replacing defective pixels in digital images. For example, in cameras employing the F13 sensor or its predecessors manufactured by Foveon, Inc., defective pixels are corrected using a defective pixel map or list generated during sensor calibration. In this step defective pixels are replaced with average values of the neighboring pixels that are not defective. 
         [0006]    According to this prior-art method, defective pixels have been identified and are entered into a defective pixel map or list. All three color channels of each identified defective pixel get replaced by the average of a specified set of neighbors. An example of this algorithm can be seen from an examination of  FIG. 1 . In this figure, a 3×3 pixel neighborhood of a single color channel (e.g., red) is shown, with nine pixels in this neighborhood labeled as R 1  to R 9 . For purposes of this example, it is assumed that pixels R 1  and R 5  are defective, as indicated by the “X” designations in the lower right-hand corners of those pixels. For correction of each pixel, a 3×3 neighborhood of pixels is selected wherein the center pixel is the pixel of interest. In the example of  FIG. 1 , pixel R 5  is of interest. 
         [0007]    In the pixel neighborhood where pixel R 5  is the center, pixels R 2 , R 3 , R 4 , R 6 , R 7 , R 8 , and R 9  are good and may be used in the illustrative prior-art correction algorithm. Pixel R 1  is defective and will not be used to estimate the value of defective pixel R 5 . According to this prior-art algorithm, the average value of the good neighboring pixels is computed and is substituted for the value of the defective pixel R 5 . Thus, in the example shown in  FIG. 1 , the substitute value for pixel R 5  may be computed as: 
         [0000]        R 5=( R 2+ R 3+ R 4+ R 6+ R 7+ R 8+ R 9)/7   (1)
 
         [0008]    In a more general sense, image data and the defective pixel list are used as the input to the algorithm. Each defective pixel on the list may be identified by its multi-bit address and followed by an 8-bit mask (0 or 1). This mask is to identify each of the eight surrounding pixels as a good (1) or defective (0) pixel. Only the good pixels are used to determine the replacement value. This operation can be mathematically written as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     y 
                     
                       
                         ( 
                         
                           r 
                           , 
                           s 
                         
                         ) 
                       
                        
                       k 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               1 
                               
                                 
                                   ∑ 
                                   
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                     ∈ 
                                     ζ 
                                   
                                 
                                  
                                 
                                   b 
                                   
                                     ( 
                                     
                                       i 
                                       , 
                                       j 
                                     
                                     ) 
                                   
                                 
                               
                             
                              
                             
                               
                                 ∑ 
                                 
                                   
                                     ( 
                                     
                                       i 
                                       , 
                                       j 
                                     
                                     ) 
                                   
                                   ∈ 
                                   ζ 
                                 
                               
                                
                               
                                 
                                   b 
                                   
                                     ( 
                                     
                                       i 
                                       , 
                                       j 
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   x 
                                   
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                      
                                     k 
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               
                                 for 
                                  
                                 
                                     
                                 
                                  
                                 
                                   b 
                                   
                                     ( 
                                     
                                       r 
                                       , 
                                       s 
                                     
                                     ) 
                                   
                                 
                               
                               = 
                               0 
                             
                             , 
                           
                         
                       
                       
                         
                           
                             x 
                             
                               
                                 ( 
                                 
                                   r 
                                   , 
                                   s 
                                 
                                 ) 
                               
                                
                               k 
                             
                           
                         
                         
                           
                             
                               for 
                                
                               
                                   
                               
                                
                               
                                 b 
                                 
                                   ( 
                                   
                                     r 
                                     , 
                                     s 
                                   
                                   ) 
                                 
                               
                             
                             = 
                             1 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where k indicates the color channel, that is, k=1 for red, k=2 for green, and k=3 for blue. The triplet y (r,s) =[y (r,s)1 , y (r,s)2 , y (r,s)3 ] T  denotes the corrected color pixel, wheres x (i,j) =[x (i,j)1 ,x (i,j)2 ,x (i,j)3 ] T , for (i,j)εζ, denotes the pixels from the input color image with defective pixels. Each component of these pixels represents the intensity value in the kth color channel. The term ζ={(i,j);r−1≦i≦r+1,s−1≦j≦s+1} denotes a 3×3 pixel neighborhood centered in the location (r,s) of the pixel to be corrected. The need for the correction process is indicated by the defective pixel flag b (r,s) =0. If the location (r,s) is associated with the defective pixel flag b (r,s) =1, then the pixel under consideration is kept unchanged. 
         [0009]    This prior-art algorithm operates directly on pixel values and processes each color channel separately, ignoring the fact that natural color images usually exhibit significant spectral correlation. Unfortunately, such componentwise processing often results in various color shifts or visible edge artifacts due to the lack of color information in the data estimation process. To avoid this drawback, a different solution is needed. 
       BRIEF DESCRIPTION 
       [0010]    A defective pixel correction algorithm according to the present invention requires having at least one non-defective color component in the location under consideration to correct defective one or two other color components in the same pixel location. 
         [0011]    According to one aspect of the present invention, the weighted sum of color differences of good neighboring pixels in the color channel containing the defective pixel and the good pixels in at least one other color channel is computed and used to provide the substitute value for the defective pixel. 
         [0012]    According to another aspect of the present invention, the weighted sum of color differences of good neighboring pixels in the color channel containing the defective pixel and the good pixels in both of the other color channels is computed and used to provide the substitute value for the defective pixel. 
         [0013]    According to another aspect of the present invention, a weighted sum of color ratios of good neighboring pixels in the color channel containing the defective pixel and the good pixels in at least one other color channel is computed and used to provide the substitute value for the defective pixel. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWING FIGURES 
         [0014]      FIG. 1  is a diagram illustrating a 3×3 pixel neighborhood in a digital image, showing pixel data in a single color channel (e.g., red) and including defective pixels to illustrate one prior-art method for defective pixel correction. 
           [0015]      FIG. 2  is a diagram illustrating a 3×3 pixel neighborhood in a digital image, showing pixel data in three colors (e.g., red, green, and blue) and including defective pixels in each color channel to illustrate methods for defective pixel correction in accordance with the present invention. 
           [0016]      FIG. 3  is a flow diagram illustrating one exemplary method for defective pixel correction in accordance with the present invention. 
           [0017]      FIG. 4  is a flow diagram illustrating another exemplary method for defective pixel correction in accordance with the present invention. 
           [0018]      FIG. 5  is a flow diagram illustrating another exemplary method for defective pixel correction in accordance with the present invention. 
           [0019]      FIG. 6  is a flow diagram illustrating another exemplary method for defective pixel correction in accordance with the present invention. 
           [0020]      FIG. 7  is a flow diagram illustrating another exemplary method for defective pixel correction in accordance with the present invention. 
           [0021]      FIG. 8  is a flow diagram illustrating another exemplary method for defective pixel correction in accordance with the present invention. 
       
    
    
     DETAILED DESCRIPTION 
       [0022]    Persons of ordinary skill in the art will realize that the following description of the present invention is illustrative only and not in any way limiting. Other embodiments of the invention will readily suggest themselves to such skilled persons. 
         [0023]    Referring now to  FIG. 2 , a diagram depicting a 3×3 pixel neighborhood in a digital image, showing red, green, and blue pixel data and including defective pixels in each color channel can be utilized to illustrate methods for defective pixel correction in accordance with the present invention. 
         [0024]    In  FIG. 2 , red channel pixels R 1  and R 5  are assumed to be defective; green channel pixel G 3  is assumed to be defective; and blue channel pixels B 3  and B 8  are assumed to be defective as indicated by the “X” designations in the lower right-hand corners of those pixels. According to a first aspect of the present invention, the substitute value for pixel R 5  may be computed using available pixels in the red and green channels as: 
         [0000]        R 5= G 5+(( R 2− G 2)+( R 4− G 4)+( R 6− G 6)+( R 7− G 7)+( R 8− G 8)+( R 9− G 9))/6   (3)
 
         [0000]    Alternately, the substitute value for pixel R 5  may be computed using available pixels in the red and blue channels as: 
         [0000]        R 5= B 5+(( R 2− B 2)+( R 4− B 4)+( R 6− B 6)+( R 7− B 7)+( R 9))/5   (4)
 
         [0025]    From an examination of the two above examples using the green and blue channels for color correction, it may be seen that, when using the green channel, there are six available terms because the red and green channels both have good pixels in positions  2 ,  4 ,  6 ,  7 ,  8 , and  9  of the neighborhood. When using the blue channel, there are only five available terms because the red and blue channels both have good pixels in positions  2 ,  4 ,  6 ,  7 , and  9  of the neighborhood. 
         [0026]    Combining all the available information in all three color channels, the substitute value for R 5  may be computed as: 
         [0000]        R 5=[( G 5+Σ( Ri−Gi )/6)+( B 5+Σ( Rj−Bj )/5]/2, for  i= 2,4,6,7,9 and  j= 2,4,6,7,9   (5)
 
         [0000]    where Σ denotes the summation operator. 
         [0027]    In a slightly less complicated version of this algorithm, good pixel data from both the green and blue channels may be used in computing the substitute value for pixel R 5  as follows: 
         [0000]        R 5=[( G 5+Σ( Ri−Gi )/5)+( B 5+Σ( Ri−Bi )/5)]/2, for  i =2,4,6,7,9   (6)
 
         [0028]    In its simplest form, the color-correlation driven defective pixel correction operation of the present invention can be mathematically written in general as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     y 
                     
                       
                         ( 
                         
                           r 
                           , 
                           s 
                         
                         ) 
                       
                        
                       k 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               x 
                               
                                 
                                   ( 
                                   
                                     r 
                                     , 
                                     s 
                                   
                                   ) 
                                 
                                  
                                 c 
                               
                             
                             + 
                             
                               
                                 1 
                                 
                                   
                                     ∑ 
                                     
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                       ∈ 
                                       ζ 
                                     
                                   
                                    
                                   
                                     b 
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                   
                                 
                               
                                
                               
                                 
                                   ∑ 
                                   
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                     ∈ 
                                     ζ 
                                   
                                 
                                  
                                 
                                   
                                     b 
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         x 
                                         
                                           
                                             ( 
                                             
                                               i 
                                               , 
                                               j 
                                             
                                             ) 
                                           
                                            
                                           k 
                                         
                                       
                                       - 
                                       
                                         x 
                                         
                                           
                                             ( 
                                             
                                               i 
                                               , 
                                               j 
                                             
                                             ) 
                                           
                                            
                                           c 
                                         
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               
                                 for 
                                  
                                 
                                     
                                 
                                  
                                 
                                   b 
                                   
                                     
                                       ( 
                                       
                                         r 
                                         , 
                                         s 
                                       
                                       ) 
                                     
                                      
                                     k 
                                   
                                 
                               
                               = 
                               0 
                             
                             , 
                           
                         
                       
                       
                         
                           
                             x 
                             
                               
                                 ( 
                                 
                                   r 
                                   , 
                                   s 
                                 
                                 ) 
                               
                                
                               k 
                             
                           
                         
                         
                           
                             
                               for 
                                
                               
                                   
                               
                                
                               
                                 b 
                                 
                                   
                                     ( 
                                     
                                       r 
                                       , 
                                       s 
                                     
                                     ) 
                                   
                                    
                                   k 
                                 
                               
                             
                             = 
                             1 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where k denotes the color channel to be corrected (e.g., k=1 for red) and c denotes the non-defective reference channel (e.g., k=2 for green in this example). The term b (i,j)  denotes the defective pixel flag set as b (i,j) =min(b (i,j)k ,b (i,j)c ) or b (i,j) =min(b (i,j)1 ,b (i,j)2 ,b (i,j)3 ) during sensor calibration. The data averaging operation is performed on color differences instead of directly on color components. Since color difference signals are low-pass in their nature, averaging color differences usually produces smaller processing error than the equivalent operation performed on pixel intensities, which is particularly true in image areas with edges and details. The high frequency content of the kth color channel is restored by adding the non-defective component x (r,s)c  from the reference color channel to the average color difference value. 
         [0029]    Note that if two non-defective color components are available, then the final value of corrected color components can be obtained as the combination of two y (r,s)k  values obtained using Equation (7) for two difference values of c (e.g., c=1 and c=2 for good red and green channels used to correct blue channel, i.e., k=3). 
         [0030]    The defective pixel correction framework according to the present invention allows combining simultaneously the spatial, spectral, and structural image characteristics. Similar to Equations (2) and (7), the spatial characteristics are considered by operating on samples inside the neighborhood ζ whereas similar to Equation (7) spectral characteristics are considered by making the use of color difference signals. Structural characteristics reflect the presence of edges and details in the image and these characteristics can be addressed in the calculations through the use of edge-sensitive weights as follows: 
         [0000]        R 5=[( G 5 +Σwi ( Ri−Gi )/Σ wi )+( B 5 +Σwi ( Ri−Bi )/Σ wi )]/2, for  i =2,4,6,7,9   (8)
 
         [0000]    In general, the algorithm of Equation (8) may be generally expressed as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     y 
                     
                       
                         ( 
                         
                           r 
                           , 
                           s 
                         
                         ) 
                       
                        
                       k 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               x 
                               
                                 
                                   ( 
                                   
                                     r 
                                     , 
                                     s 
                                   
                                   ) 
                                 
                                  
                                 c 
                               
                             
                             + 
                             
                               
                                 1 
                                 
                                   
                                     ∑ 
                                     
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                       ∈ 
                                       ζ 
                                     
                                   
                                    
                                   
                                     
                                       b 
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                     
                                      
                                     
                                       w 
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                     
                                   
                                 
                               
                                
                               
                                 
                                   ∑ 
                                   
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                     ∈ 
                                     ζ 
                                   
                                 
                                  
                                 
                                   
                                     b 
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                   
                                    
                                   
                                     
                                       w 
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           x 
                                           
                                             
                                               ( 
                                               
                                                 i 
                                                 , 
                                                 j 
                                               
                                               ) 
                                             
                                              
                                             k 
                                           
                                         
                                         - 
                                         
                                           x 
                                           
                                             
                                               ( 
                                               
                                                 i 
                                                 , 
                                                 j 
                                               
                                               ) 
                                             
                                              
                                             c 
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               
                                 for 
                                  
                                 
                                     
                                 
                                  
                                 
                                   b 
                                   
                                     
                                       ( 
                                       
                                         r 
                                         , 
                                         s 
                                       
                                       ) 
                                     
                                      
                                     k 
                                   
                                 
                               
                               = 
                               0 
                             
                             , 
                           
                         
                       
                       
                         
                           
                             x 
                             
                               
                                 ( 
                                 
                                   r 
                                   , 
                                   s 
                                 
                                 ) 
                               
                                
                               k 
                             
                           
                         
                         
                           
                             
                               for 
                                
                               
                                   
                               
                                
                               
                                 b 
                                 
                                   
                                     ( 
                                     
                                       r 
                                       , 
                                       s 
                                     
                                     ) 
                                   
                                    
                                   k 
                                 
                               
                             
                             = 
                             1 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0031]    In a straightforward way, the weights w (i,j)  can be estimated using any common edge detection algorithm applied to either one or two non-defective color channels. For example, in one possible implementation, the edge-sensitive weights will be fairly small if the pixels associated with these weights are too different from other pixels inside a 3×3 pixel neighborhood. Note that all solutions constructed within the presented framework can be used in a recursive mode, that is, the actual pixel can be corrected using both non-defective and previously corrected pixels located inside ζ. 
         [0032]    A straightforward alternative to the solution in Equation (9) is to replace the addition and subtraction operations with multiplication and division, respectively. Such an alternative can be generally expressed as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     y 
                     
                       
                         ( 
                         
                           r 
                           , 
                           s 
                         
                         ) 
                       
                        
                       k 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               
                                 x 
                                 
                                   
                                     ( 
                                     
                                       r 
                                       , 
                                       s 
                                     
                                     ) 
                                   
                                    
                                   c 
                                 
                               
                               
                                 
                                   ∑ 
                                   
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                     ∈ 
                                     ζ 
                                   
                                 
                                  
                                 
                                   
                                     b 
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                   
                                    
                                   
                                     w 
                                     
                                       ( 
                                       
                                         i 
                                         , 
                                         j 
                                       
                                       ) 
                                     
                                   
                                 
                               
                             
                              
                             
                               
                                 ∑ 
                                 
                                   
                                     ( 
                                     
                                       i 
                                       , 
                                       j 
                                     
                                     ) 
                                   
                                   ∈ 
                                   ζ 
                                 
                               
                                
                               
                                 
                                   b 
                                   
                                     ( 
                                     
                                       i 
                                       , 
                                       j 
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   w 
                                   
                                     ( 
                                     
                                       i 
                                       , 
                                       j 
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   
                                     x 
                                     
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                        
                                       k 
                                     
                                   
                                   
                                     x 
                                     
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                        
                                       c 
                                     
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               
                                 for 
                                  
                                 
                                     
                                 
                                  
                                 
                                   b 
                                   
                                     
                                       ( 
                                       
                                         r 
                                         , 
                                         s 
                                       
                                       ) 
                                     
                                      
                                     k 
                                   
                                 
                               
                               = 
                               0 
                             
                             , 
                           
                         
                       
                       
                         
                           
                             x 
                             
                               
                                 ( 
                                 
                                   r 
                                   , 
                                   s 
                                 
                                 ) 
                               
                                
                               k 
                             
                           
                         
                         
                           
                             
                               for 
                                
                               
                                   
                               
                                
                               
                                 b 
                                 
                                   
                                     ( 
                                     
                                       r 
                                       , 
                                       s 
                                     
                                     ) 
                                   
                                    
                                   k 
                                 
                               
                             
                             = 
                             1 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
         [0033]    More specifically, given the example depicted in Equation (4), the substitute value of the defective pixel can be obtained using color ratios as follows: 
         [0000]        R 5 =B 5×(( R 2 /B 2)+( R 4 /B 4)+( R 4 /B 4)+( R 6 /B 6)+( R 7 /B 7)+( R 9 /B 9))/5   (11)
 
         [0000]    Applying this concept to any above-presented color-difference formulation is straightforward. However, it should be noted that a color-ratio based solution may be more difficult to implement than its color-difference based variant. 
         [0034]      FIGS. 3 to 8  are flow charts that illustrate exemplary processes for replacing defective pixel data in accordance with the present invention. Persons skilled in the art will appreciate that the following examples are exemplary only and do not represent all possible methods of replacing defective pixel data in accordance with the present invention. 
         [0035]    Referring now to  FIG. 3 , a flow diagram illustrates the above-described exemplary method for defective pixel correction in accordance with the present invention. First, at reference numeral  10  a pixel and the data of one of the color channels in the pixel are selected. Next, at reference numeral  12 , it is determined whether the selected pixel data in the selected color channel is defective. This may be done by examining the defective pixel map or list, or by other means known in the art. 
         [0036]    At reference numeral  14 , a group of neighboring pixels surrounding the selected pixel is defined. In a presently-preferred embodiment, this neighborhood may be defined as a 3×3 group of neighboring pixels with the selected pixel in the center. Persons of ordinary skill in the art will appreciate that the pixel neighborhood could be defined in other ways using a fewer or greater number of pixels surrounding the selected pixel. Such skilled persons will also appreciate that for pixels located at the edges of an image, there will not be adjacent available pixels to one side (either top, bottom, left, or right) or in the corner of the image to even two sides (either top-left, top-right, bottom-left, or bottom right) of the selected pixel that can be used for correction., In such cases, the methods of the present invention can be implemented using the data available from the existing adjacent pixels or the edge pixels can be ignored. 
         [0037]    At reference numeral  16  it is determined whether there is a reference color channel for the pixel containing good pixel data. For example, if the red color channel of the selected pixel is being processed, it is determined whether the data in either of the blue or green color channels is good data. If it is determined that there is no good reference channel pixel, the process proceeds to reference numeral  18 , where a process, such as calculating the average value of the good pixels in the selected color channel defined neighborhood, is performed to generate substitute data for the defective pixel. The process proceeds to reference numeral  20  where the generated substitute data is used to replace the defective pixel data. 
         [0038]    If, at reference numeral  16 , it is determined that there is a reference color channel in the selected pixel having good data, the process proceeds to reference numeral  22 , where data in the selected color channel and the reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the sum of the differences between the good data in the selected color channel and the data in the reference color channel. In general, there will be an integer m equal to the number of neighboring pixels that have good data in both the selected color channel and the reference color channel. At reference numeral  24 , the sum of the differences divided by m is added to the good data value from the reference color channel of the selected pixel to obtain a data substitution value. 
         [0039]    Next, at reference numeral  20 , the defective pixel data value is replaced with the substitution data value. At reference numeral  26 , it is determined whether all pixels have been processed. If all pixels have been processed, the process ends at reference numeral  28 . If all pixels have not yet been processed, the process returns to reference numeral  10 , where another pixel is selected for review. 
         [0040]    Referring now to  FIG. 4 , a flow diagram illustrates another exemplary method for defective pixel correction in accordance with the present invention. First, at reference numeral  30  a pixel and the data of one of the color channels in the pixel are selected. Next, at reference numeral  32 , it is determined whether the selected pixel data in the selected color channel is defective. This may be done by examining the defective pixel map or list, or by other means known in the art. 
         [0041]    At reference numeral  34 , a group of neighboring pixels surrounding the selected pixel is defined. In a presently-preferred embodiment, this neighborhood may be defined as a 3×3 group of neighboring pixels with the selected pixel in the center. Persons of ordinary skill in the art will appreciate that the pixel neighborhood could be defined in other ways using a fewer or greater number of pixels surrounding the selected pixel. 
         [0042]    At reference numeral  36  it is determined whether there is a reference color channel for the pixel containing good pixel data. For example, if the red color channel of the selected pixel is being processed, it is determined whether the data in either of the blue or green color channels is good data. If it is determined that there is no good reference channel pixel, the process proceeds to reference numeral  38 , where a process, such as calculating the average value of the good pixels in the selected color channel defined neighborhood, is performed to generate substitute data for the defective pixel. The process proceeds to reference numeral  40  where the generated substitute data is used to replace the defective pixel data. 
         [0043]    If, at reference numeral  36 , it is determined that there is a reference color channel in the selected pixel having good data, the process proceeds to reference numeral  42 , where data in the selected color channel and the reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the weighted sum of the differences between the good data in the selected color channel and the data in the reference color channel. In general, there will be an integer m equal to the number of neighboring pixels that have good data in both the selected color channel and the reference color channel. At reference numeral  44 , the weighted sum of the differences divided by the sum of weights is added to the good data value from the reference color channel of the selected pixel to obtain a data substitution value. 
         [0044]    As will be appreciated by persons of ordinary skill in the art, various weighting factors may be employed in accordance with the instant invention. As non-limiting examples, weighting factor w i  may be calculated as: 
         [0000]        w   i =1/(| P 5− Pi|+K )   (12)
 
         [0000]    As another non-limiting example, weighting factor w i  may be calculated as: 
         [0000]        w   i =exp[−| P 5 −Pi|   2   /K]   (13)
 
         [0000]    In these examples, K denotes a predetermined constant or scaling factor. The terms P 5  an Pi can denote the available data in the reference color channel, for example. 
         [0045]    Next, at reference numeral  40 , the defective pixel data value is replaced with the substitution data value. At reference numeral  46 , it is determined whether all pixels have been processed. If all pixels have been processed, the process ends at reference numeral  48 . If all pixels have not yet been processed, the process returns to reference numeral  30 , where another pixel is selected for review. 
         [0046]    Referring now to  FIG. 5 , a flow diagram illustrates another exemplary method for defective pixel correction in accordance with the present invention. In the example of  FIG. 5 , data from two reference color channels is used if the data is available. 
         [0047]    First, at reference numeral  50  a pixel and the data of one of the color channels in the pixel are selected. Next, at reference numeral  52 , it is determined whether the selected pixel data in the selected color channel is defective. This may be done by examining the defective pixel map or list, or by other means known in the art. 
         [0048]    At reference numeral  54 , a group of neighboring pixels surrounding the selected pixel is defined. In a presently-preferred embodiment, this neighborhood may be defined as a 3×3 group of neighboring pixels with the selected pixel in the center. Persons of ordinary skill in the art will appreciate that the pixel neighborhood could be defined in other ways using a fewer or greater number of pixels surrounding the selected pixel. 
         [0049]    At reference numeral  56  it is determined whether there is a first reference color channel for the pixel containing good pixel data. For example, if the red color channel of the selected pixel is being processed, it is determined whether the data in either of the blue or green color channels is good data. If it is determined that there is no good reference channel pixel, the process proceeds to reference numeral  58 , where a process, such as calculating the average value of the good pixels in the selected color channel defined neighborhood, is performed to generate substitute data for the defective pixel. The process proceeds to reference numeral  60  where the generated substitute data is used to replace the defective pixel data. 
         [0050]    If, at reference numeral  56 , it is determined that there is a first reference color channel in the selected pixel having good data, the process proceeds to reference numeral  62 , where data in the selected color channel and the first reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the sum of the differences between the good data in the selected color channel and the data in the first reference color channel. In general, there will be an integer m equal to the number of neighboring pixels that have good data in both the selected color channel and the first reference color channel. At reference numeral  64 , the sum of the differences divided by m is added to the good data value from the reference color channel of the selected pixel to obtain a first result. 
         [0051]    Next, at reference numeral  66 , it is determined whether there is a second reference color channel for the pixel containing good pixel data. If it is determined that there is no good second reference color channel that contains good data for the selected pixel, the process proceeds to reference numeral  68 , where the first result from reference numeral  64  is used as the substitute data for the defective pixel. The process proceeds to reference numeral  60  where the substitute data is used to replace the defective pixel data. 
         [0052]    If, at reference numeral  66 , it is determined that there is a second reference color channel for the pixel containing good pixel data, the process proceeds to reference numeral the process proceeds to reference numeral  70 , where data in the selected color channel and the second reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the sum of the differences between the good data in the selected color channel and the data in the second reference color channel. In general, there will be an integer n equal to the number of neighboring pixels that have good data in both the selected color channel and the first reference color channel. At reference numeral  72 , the sum of the differences divided by n is added to the good data value from the reference color channel of the selected pixel to obtain a second result. 
         [0053]    At reference numeral  74 , the sum of the first and second results is computed. The sum is then divided by two to obtain a substitution data value. Next, at reference numeral  60 , the defective pixel data value is replaced with the substitution data value generated at reference numeral  74 . 
         [0054]    Finally, at reference numeral  76 , it is determined whether all pixels have been processed. If all pixels have been processed, the process ends at reference numeral  78 . If all pixels have not yet been processed, the process returns to reference numeral  50 , where another pixel is selected for review. 
         [0055]    According to another aspect of the present invention illustrated with reference to  FIGS. 6 ,  7 , and  8 , either a sum or a weighted sum of color ratios of good neighboring pixels in the color channel containing the defective pixel and the good pixels in at least one other color channel is computed and used to provide the substitute value for the defective pixel. 
         [0056]    Referring now to  FIG. 6 , a flow diagram illustrates the above-described exemplary method for defective pixel correction in accordance with the present invention. First, at reference numeral  80  a pixel and the data of one of the color channels in the pixel are selected. Next, at reference numeral  82 , it is determined whether the selected pixel data in the selected color channel is defective. This may be done by examining the defective pixel map or list, or by other means known in the art. 
         [0057]    At reference numeral  84 , a group of neighboring pixels surrounding the selected pixel is defined. In a presently-preferred embodiment, this neighborhood may be defined as a 3×3 group of neighboring pixels with the selected pixel in the center. Persons of ordinary skill in the art will appreciate that the pixel neighborhood could be defined in other ways using a fewer or greater number of pixels surrounding the selected pixel. Such skilled persons will also appreciate that for pixels located at the edges of an image, there will not be adjacent available pixels to one side (either top, bottom, left, or right) or in the corner of the image to even two sides (either top-left, top-right, bottom-left, or bottom right) of the selected pixel that can be used for correction. In such cases, the methods of the present invention can be implemented using the data available from the existing adjacent pixels or the edge pixels can be ignored. 
         [0058]    At reference numeral  86  it is determined whether there is a reference color channel for the pixel containing good pixel data. For example, if the red color channel of the selected pixel is being processed, it is determined whether the data in either of the blue or green color channels is good data. If it is determined that there is no good reference channel pixel, the process proceeds to reference numeral  88 , where a process, such as calculating the average value of the good pixels in the selected color channel defined neighborhood, is performed to generate substitute data for the defective pixel. The process proceeds to reference numeral  90  where the generated substitute data is used to replace the defective pixel data. 
         [0059]    If, at reference numeral  86 , it is determined that there is a reference color channel in the selected pixel having good data, the process proceeds to reference numeral  92 , where data in the selected color channel and the reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the sum of the ratios between the good data in the selected color channel and the data in the reference color channel. In general, there will be an integer m equal to the number of neighboring pixels that have good data in both the selected color channel and the reference color channel. At reference numeral  94 , the sum of the ratios divided by m is multiplied with the good data value from the reference color channel of the selected pixel to obtain a data substitution value. 
         [0060]    Next, at reference numeral  90 , the defective pixel data value is replaced with the substitution data value. At reference numeral  96 , it is determined whether all pixels have been processed. If all pixels have been processed, the process ends at reference numeral  98 . If all pixels have not yet been processed, the process returns to reference numeral  80 , where another pixel is selected for review. 
         [0061]    Referring now to  FIG. 7 , a flow diagram illustrates another exemplary method for defective pixel correction in accordance with the present invention. First, at reference numeral  100  a pixel and the data of one of the color channels in the pixel are selected. Next, at reference numeral  102 , it is determined whether the selected pixel data in the selected color channel is defective. This may be done by examining the defective pixel map or list, or by other means known in the art. 
         [0062]    At reference numeral  104 , a group of neighboring pixels surrounding the selected pixel is defined. In a presently-preferred embodiment, this neighborhood may be defined as a 3×3 group of neighboring pixels with the selected pixel in the center. Persons of ordinary skill in the art will appreciate that the pixel neighborhood could be defined in other ways using a fewer or greater number of pixels surrounding the selected pixel. 
         [0063]    At reference numeral  106  it is determined whether there is a reference color channel for the pixel containing good pixel data. For example, if the red color channel of the selected pixel is being processed, it is determined whether the data in either of the blue or green color channels is good data. If it is determined that there is no good reference channel pixel, the process proceeds to reference numeral  108 , where a process, such as calculating the average value of the good pixels in the selected color channel defined neighborhood, is performed to generate substitute data for the defective pixel. The process proceeds to reference numeral  110  where the generated substitute data is used to replace the defective pixel data. 
         [0064]    If, at reference numeral  106 , it is determined that there is a reference color channel in the selected pixel having good data, the process proceeds to reference numeral  112 , where data in the selected color channel and the reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the weighted sum of the ratios between the good data in the selected color channel and the data in the reference color channel. In general, there will be an integer m equal to the number of neighboring pixels that have good data in both the selected color channel and the reference color channel. At reference numeral  114 , the weighted sum of the ratios divided by the sum of weights is multiplied with the good data value from the reference color channel of the selected pixel to obtain a data substitution value. 
         [0065]    As will be appreciated by persons of ordinary skill in the art, various weighting factors may also be employed in accordance with this aspect of the instant invention. As non-limiting examples, weighting factor w i  may be calculated as in Equation (12) or Equation (13). 
         [0066]    Next, at reference numeral  110 , the defective pixel data value is replaced with the substitution data value. At reference numeral  116 , it is determined whether all pixels have been processed. If all pixels have been processed, the process ends at reference numeral  118 . If all pixels have not yet been processed, the process returns to reference numeral  110 , where another pixel is selected for review. 
         [0067]    Referring now to  FIG. 8 , a flow diagram illustrates another exemplary method for defective pixel correction in accordance with the present invention. As in the example of  FIG. 5 , data from two reference color channels is used in the example of  FIG. 8  if the data is available. 
         [0068]    First, at reference numeral  120  a pixel and the data of one of the color channels in the pixel are selected. Next, at reference numeral  122 , it is determined whether the selected pixel data in the selected color channel is defective. This may be done by examining the defective pixel map or list, or by other means known in the art. 
         [0069]    At reference numeral  124 , a group of neighboring pixels surrounding the selected pixel is defined. In a presently-preferred embodiment, this neighborhood may be defined as a 3×3 group of neighboring pixels with the selected pixel in the center. Persons of ordinary skill in the art will appreciate that the pixel neighborhood could be defined in other ways using a fewer or greater number of pixels surrounding the selected pixel. 
         [0070]    At reference numeral  126  it is determined whether there is a first reference color channel for the pixel containing good pixel data. For example, if the red color channel of the selected pixel is being processed, it is determined whether the data in either of the blue or green color channels is good data. If it is determined that there is no good reference channel pixel, the process proceeds to reference numeral  128 , where a process, such as calculating the average value of the good pixels in the selected color channel defined neighborhood, is performed to generate substitute data for the defective pixel. The process proceeds to reference numeral  130  where the generated substitute data is used to replace the defective pixel data. 
         [0071]    If, at reference numeral  126 , it is determined that there is a first reference color channel in the selected pixel having good data, the process proceeds to reference numeral  132 , where data in the selected color channel and the first reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the sum of the ratios between the good data in the selected color channel and the data in the first reference color channel. In general, there will be an integer m equal to the number of neighboring pixels that have good data in both the selected color channel and the first reference color channel. At reference numeral  134 , the sum of the ratios divided by m is multiplied with the good data value from the reference color channel of the selected pixel to obtain a first result. 
         [0072]    Next, at reference numeral  136 , it is determined whether there is a second reference color channel for the pixel containing good pixel data. If it is determined that there is no good second reference color channel that contains good data for the selected pixel, the process proceeds to reference numeral  138 , where the first result from reference numeral  134  is used as the substitute data for the defective pixel. The process proceeds to reference numeral  130  where the substitute data is used to replace the defective pixel data. 
         [0073]    If, at reference numeral  136 , it is determined that there is a second reference color channel for the pixel containing good pixel data, the process proceeds to reference numeral the process proceeds to reference numeral  140 , where data in the selected color channel and the second reference color channel from all of the available neighboring pixels (i.e., only pixels with good data) is processed to compute the sum of the ratios between the good data in the selected color channel and the data in the second reference color channel. In general, there will be an integer n equal to the number of neighboring pixels that have good data in both the selected color channel and the first reference color channel. At reference numeral  142 , the sum of the ratios divided by n is multiplied with the good data value from the reference color channel of the selected pixel to obtain a second result. 
         [0074]    At reference numeral  144 , the sum of the first and second results is computed. The sum is then divided by two to obtain a substitution data value. Next, at reference numeral  130 , the defective pixel data value is replaced with the substitution data value generated at reference numeral  144 . 
         [0075]    Finally, at reference numeral  146 , it is determined whether all pixels have been processed. If all pixels have been processed, the process ends at reference numeral  148 . If all pixels have not yet been processed, the process returns to reference numeral  120 , where another pixel is selected for review. 
         [0076]    While embodiments and applications of this invention have been shown and described, it would be apparent to those skilled in the art that many more modifications than mentioned above are possible without departing from the inventive concepts herein. The invention, therefore, is not to be restricted except in the spirit of the appended claims.