Patent Publication Number: US-2015070550-A1

Title: Spatial binning method for re-sampling binned image, related circuit, and computer readable medium

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The disclosed embodiments of the present invention relate to processing pixel data of an image, and more particularly, to a spatial binning method for re-sampling an image generated by pixel binning, related apparatus, and computer readable medium thereof. 
     2. Description of the Prior Art 
     Generally speaking, pixel binning refers to the combination of the information of adjacent detectors in a CMOS image sensor (CIS) or a charge-coupled device (CCD) to create one single pixel in the recorded image. For instance, a 2×2 binning gathers the electrons from a square of four detectors to record them in just one of the image pixels. Thus, the intensity per pixel increases in a factor of (about) four. Different pixel binning methods are used to sum the signals from more pixels to enhance the sensitivity and improve the signal-to-noise ratio (SNR). 
     Therefore, there is a need for an innovative re-sampling scheme which is capable of restoring the relative pixel distances and compensating the spatial non-uniformity of the binned pixels for improving the image quality. 
     SUMMARY OF THE INVENTION 
     In accordance with exemplary embodiments of the present invention, a spatial binning method for re-sampling a binned image, related apparatus, and computer readable medium thereof are proposed to solve the aforesaid problems. 
     According to a first aspect of the present invention, an exemplary spatial binning method for re-sampling a binned image is disclosed. The exemplary spatial binning method includes: receiving a raw image; pixel binning the raw image to generate a binned image; and re-sampling the binned image spatially to generate a re-sampled image according to the values and positions of the pixels of the binned image. 
     According to a second aspect of the present invention, an exemplary spatial binning circuit for re-sampling a binned image is disclosed. The exemplary spatial binning circuit includes: a binning unit and a re-sampling unit, wherein the binning unit is arranged for receiving a raw image to generate a binned image; and the re-sampling unit is arranged for receiving the binned image and re-sampling the pixels of the binned image according to the values and positions of the pixels of the binned image. 
     According to a third aspect of the present invention, an exemplary non-transitory computer readable medium, storing a program code, wherein when the program code is executed by a processor, the processor performs following steps for spatial binning: pixel binning a raw image to generate a binned image; and re-sampling the binned image spatially to generate a re-sampled image according to the values and positions of the pixels of the binned image. 
     These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a flowchart illustrating a spatial binning method according to an exemplary embodiment of the present invention. 
         FIG. 2  is a diagram illustrating operation of the spatial binning method according to an embodiment of the present invention. 
         FIG. 3  is a diagram illustrating operation of the spatial binning method according to another embodiment of the present invention. 
         FIG. 4A  is a diagram illustrating a pixel block according to an embodiment of the present invention. 
         FIG. 4B  is a diagram illustrating a binned pixel block derived from the pixel block shown in  FIG. 4A . 
         FIG. 4C  is a diagram illustrating a re-sampled pixel block derived from the binned pixel block shown in  FIG. 4B . 
         FIG. 5A  is a diagram illustrating a pixel block according to another embodiment of the present invention. 
         FIG. 5B  is a diagram illustrating a binned pixel block derived from the pixel block shown in  FIG. 5A . 
         FIG. 5C  is a diagram illustrating a re-sampled pixel block derived from the binned pixel block shown in  FIG. 5B . 
         FIG. 6  is a diagram illustrating a spatial binning circuit according to a first embodiment of the present invention. 
         FIG. 7  is a diagram illustrating a spatial binning circuit according to a second embodiment of the present invention. 
     
    
    
     DETAILED DESCRIPTION 
     Certain terms are used throughout the description and following claims to refer to particular components. As one skilled in the art will appreciate, manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following description and in the claims, the terms “include” and “comprise” are used in an open-ended fashion, and thus should be interpreted to mean “include, but not limited to . . . ”. Also, the term “couple” is intended to mean either an indirect or direct electrical connection. Accordingly, if one device is electrically connected to another device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections. 
     Some of the conventional binning methods introduce side effects. Specifically, the relative pixel distances are changed and the pixel distribution is not uniform after said binning processes, and thus color artifacts and edge zipper effects emerge. The main concept of the present invention is to restore the relative pixel distances and compensate for the spatial non-uniformity of the binned pixels for improving the image quality. In other words, the present invention proposes a spatial binning method for re-sampling an image generated by pixel binning, related apparatus, and computer readable medium according to the corresponding pixel binning algorithm adopted for generating the image. 
       FIG. 1  is a flowchart illustrating a spatial binning method  100  according to an exemplary embodiment of the present invention. Provided that substantially the same result is achieved, the steps in  FIG. 1  need not be in the exact order shown and need not be contiguous, that is, other steps can be intermediate. Besides, some steps in  FIG. 1  may be omitted according to various types of embodiments or requirements. In this embodiment, the detailed operation for spatial binning a binned image generated by pixel binning may comprise following steps. 
     Step  102 : Receive a raw image from a pixel array of an image sensor; 
     Step  104 : Perform pixel binning on the raw image to generate a binned image; and 
     Step  106 : Spacial re-sample the binned image to generate a re-sampled image according to the values and positions of the pixels of the binned image. 
       FIG. 2  is a diagram illustrating operation of the spatial binning method according to an embodiment of the present invention. First, a raw image is received shown as the pixel block  210  shown in  FIG. 2 . Pixel block  210  is for example a 4×4 pixel block including 16 pixels belonging to 3 colors, blue (B), green (G, g) and red (R) arranged according to the Bayer filter. Bayer filter is a color filter array (CFA) for arranging RGB color filters on an array of photo-sensors, wherein the filter pattern is 50% green, 25% red and 25% blue, hence is also called RGBg, GRgB, or RGgB. Then, pixel binning is performed to generate a binned image shown as the binned pixel block  220  shown in  FIG. 2 . The binned pixel block  220  is a 2×2 pixel block which is generated by vertical binning and horizontal binning, also known as the normal binning. Please note that the boxes with a dotted line are used for illustration of relative positions of the raw image. Specifically, the position of Bbin 1  is relatively at the center of B 1 , B 2 , B 3  and B 4 ; the position of Gbin 1  is relatively at the center of G 1 , G 2 , G 3  and G 4 ; the position of gbin 1  is relatively at the center of g 1 , g 2 , g 3  and g 4 ; and the position of Rbin 1  is relatively at the center of R 1 , R 2 , R 3  and R 4 . 
     The values of the binned pixel block  220  are: 
         B   bin1 =( B   1   +B   2   +B   3   +B   4 )/4, 
         G   bin1 =( G   1   +G   2   +G   3   +G   4 )/4,  g   bin1 =( g   1   +g   2   +g   3   +g   4 )/4, and  R   bin1 =( R   1   +R   2   +R   3   +R   4 )/4. 
     The G bin1  pixel and the g bin1  pixel are both green, and have a ¼ part overlapping with each other, that is, g 2  is positioned in the area formed by G 1 , G 2 , G 3 , and G 4 ; and G 3  is positioned in the area formed by g 1 , g 2 , g 3  and g 4 . To put it another way, the compositions of the G bin1  pixel and the g bin1  pixel might interfere with each other (i.e., the ¼ parts which overlap with each other), thus a re-sampling step is performed to compensate for the green part (i.e., G and g) of the normal binning. That is to say, when the binned image is generated by the pixel binning algorithm configured to perform vertical binning and horizontal binning, the binned pixels diagonally adjacent to each other are selected for a same color. The proposed re-sampling step of the embodiment may be expressed using the following equations: 
     
       
         
           
             
               
                 B 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               - 
               
                 B 
                 
                   bi 
                    
                   
                       
                   
                    
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
             
             , 
             
               
 
             
              
             
               
                 G 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 
                   
                     5 
                     4 
                   
                    
                   
                     G 
                     
                       bin 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
                 - 
                 
                   
                     1 
                     4 
                   
                    
                   
                     g 
                     
                       bin 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
               
             
             , 
             
               
 
             
              
             
               
                 g 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 
                   
                     5 
                     4 
                   
                    
                   
                     g 
                     
                       bin 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
                 - 
                 
                   
                     1 
                     4 
                   
                    
                   
                     G 
                     
                       bin 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
               
             
             , 
             and 
           
         
       
       
         
           
             
               R 
               
                 n 
                  
                 
                     
                 
                  
                 1 
               
             
             = 
             
               
                 R 
                 
                   bin 
                    
                   
                       
                   
                    
                   1 
                 
               
               . 
             
           
         
       
     
     A re-sampled pixel block  230  shown in  FIG. 2  is a 2×2 pixel block which is generated by re-sampling the binned pixel block  220 . The B n1 , G n1 , g n1 , and R n1  are the re-sampling pixels of the binning pixels B bin1 , G bin1 , g bin1 , and R bin1 , wherein the B n1  pixel and the R n1  pixel are identical to the B bin1  pixel and the R bin1  pixel, respectively; only the G n1  pixel and the g n1  pixel are modified. The G bin1  pixel and the g bin1  pixel are strengthened by a weighting factor 5/4, respectively, and at the same time, a part of g bin1  and G bin1  (i.e., with a weighting factor ¼) are deducted from the 5/4 G bin1  and the 5/4 g bin1  respectively to obtain re-sampled pixels without interference between green colors. It should be noted that the weighting factors could be adjusted according to the actual demand in practice. Besides, the settings in this embodiment are for illustrative purposes only, and are not meant to be limitations of the present invention. Hence, modifications on the weighting factors also belong to the scope of the present invention. 
       FIG. 3  is a diagram illustrating operation of the spatial binning method according to another embodiment of the present invention. A pixel block  310  shown in  FIG. 3  is an 8×4 pixel block including 32 pixels belonging to 3 colors, blue (B), green (G), and red (R) according to the Bayer filter. A binned pixel block  320  shown in  FIG. 3  is a 4×4 pixel block which is generated by the pixel binning algorithm configured to perform vertical binning without horizontal binning. Please note that the boxes with a dotted line are used for illustrative purposes only. In other words, the boxes with a dotted line are not pixels due to the 8×4 pixel block being reduced to the 4×4 block after the vertical binning without horizontal binning process. The binned pixels are respectively positioned at the center of the related pixels in the raw image. Specifically, B bin1 =(B 1 +B 3 )/2, G bin1 =(G 1 +G 3 )/2, g bin1 =(g 1 +g 3 )/2, and R bin1 =(R 1 +R 3 )/2. 
     As other binned pixels in the binned pixel block  320  are generated according to the same rules like B bin1 , G bin1 , g bin1 , and R bin1 , the equations of the other binned pixels in the binned pixel block  320  are omitted here for brevity. According the binned pixel block  320 , two groups are separated by 8 dotted boxes. More specifically, the relative pixel distance between the g bin1  pixel and the B bin3  pixel is 3 times as large as the relative pixel distance between the g bin1  pixel and the B bin1  pixel, and the relative pixel distance between the R bin1  pixel and the G bin3  pixel is 3 times as large as the relative pixel distance between the R bin1  pixel and the G bin1  pixel, and so on. To put it another way, the relative pixel distances are changed and the pixel distribution is not uniform after the vertical binning without horizontal binning process. In order to get rid of the side effects and to improve the image quality, the g bin1 , R bin1 , g bin2 , R bin2 , g bin3 , R bin3 , g bin4 , and R bin4  pixels need to be re-sampled to ensure the uniform distribution of the image. The operation can be expressed using the following equations: 
     
       
         
           
             
               
                 B 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 B 
                 
                   bin 
                    
                   
                       
                   
                    
                   1 
                 
               
             
             , 
             
               
 
             
              
             
               
                 G 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 G 
                 
                   bin 
                    
                   
                       
                   
                    
                   1 
                 
               
             
             , 
             
               
 
             
              
             
               
                 g 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 
                   
                     3 
                     4 
                   
                    
                   
                     g 
                     
                       bin 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
                 + 
                 
                   
                     1 
                     4 
                   
                    
                   
                     g 
                     
                       bin 
                        
                       
                           
                       
                        
                       3 
                     
                   
                 
               
             
             , 
             and 
           
         
       
       
         
           
             
               R 
               
                 n 
                  
                 
                     
                 
                  
                 1 
               
             
             = 
             
               
                 
                   3 
                   4 
                 
                  
                 
                   R 
                   
                     bin 
                      
                     
                         
                     
                      
                     1 
                   
                 
               
               + 
               
                 
                   1 
                   4 
                 
                  
                 
                   
                     R 
                     
                       bin 
                        
                       
                           
                       
                        
                       3 
                     
                   
                   . 
                 
               
             
           
         
       
     
     A re-sampled pixel block  330  shown in  FIG. 3  is a 4×4 pixel block which is generated by re-sampling the binned pixel block  320 . Please note that the boxes with a dotted line are used for illustrative purposes only, in other words, the boxes with a dotted line are not pixels. The B n1 , G n1 , g n1 , and R n1  are the re-sampling pixels of the binning pixels B bin1 , G bin1 , g bin1 , and R bin1 , wherein the B n1  pixel and the G n1  pixel are identical to the B bin1  pixel and the G bin1  pixel, respectively; only the g n1  pixel and the R n1  pixel are modified. The position of the g n1  pixel is the box with a dotted line right below the g bin1  pixel of the binned pixel block  320 , and therefore the relative pixel distance between the g n1  pixel and the B n3  pixel equals the relative pixel distance between the g n1  pixel and the B n1  pixel. However, the corresponding composition of the g n1  pixel at the position (i.e., the box with a dotted line right below the g bin1  pixel of the binned pixel block  320 ) includes both g bn1  and g bn3 , and the weighting factor should be ¾ and ¼ respectively due to the relative pixel distance between the g n1  pixel and the g bin3  pixel is 3 times as large as the relative pixel distance between the g n1  pixel and the g bin1  pixel. That is, the weighting factor of the g bin1  pixel should be 3 times as large as the weighting factor of the g bin3  pixel, inversely proportional to the distances. Furthermore, the summation of the weighting factor of the g bin1  pixel and the weighting factor of the g bin3  pixel should be equal to 1 due to that the composition of g n1  contains only g bin1  and g bin3 . It should be noted that the weighting factors could be adjusted according to the actual demand in practice. Besides, the settings in this embodiment are for illustrative purposes only, and are not meant to be limitations of the present invention. Modifications on the weighting factors also belong to the scope of the present invention. 
       FIGS. 4A-4C  are diagrams illustrating a pixel block according to an embodiment of the present invention. The pixel block  410  shown in  FIG. 4A  is an 8×8 pixel block including 64 pixels belonging to 3 colors, blue (B), green (G), and red (R) according to the Bayer filter.  FIG. 4B  is a diagram illustrating a binned pixel block derived from the pixel block  410  shown in  FIG. 4A . The binned pixel block  420  shown in  FIG. 4B  is a 4×4 pixel block which is generated by the pixel binning algorithm configured to perform diamond-shape binning. Please note that the boxes with a dotted line are used for illustrative purposes. In other words, the boxes with a dotted line are not pixels due to the 8×8 pixel block  410  being reduced to the 4×4 block  420  after the diamond-shape binning process. The pixels in the binned pixel block  420  might be represented by the following equations: 
         B   bin1 =( B   1   +B   2   +B   3   +B   4 )/4, 
         G   bin1 =( G   2   +g   2   +G   4   +g   5 )/4, 
         g   bin1 =( G   3   +g   3   +G   9   +g   4 )/4, and 
         R   bin1 =( R   1   +R   2   +R   3   +R   4 )/4. 
     As other binned pixels in the binned pixel block  520  are generated according to the same rules like B bin1 , G bin1 , g bin1 , and R bin1 , the equations of other binned pixels in the binned pixel block  420  are omitted here for brevity. 
     According the binned pixel block  420 , the G bin1  pixel and the g bin1  pixel no longer overlap with each other like the G bin1  pixel and the g bin1  pixel in the binned pixel block  220  shown in  FIG. 2  due to the diamond-shape binning type of the composition of the G bin1  pixel and the g bin1  pixel. However, the relative pixel distances are changed and the pixel distribution is not uniform after the diamond-shape binning process. In order to get rid of the side effects and to improve the image quality, the R bin1  pixel needs to be moved to another place to ensure the uniform distribution of the image. That is to say, when the binned image is generated by the pixel binning algorithm configured to perform diamond-shape binning, the binned pixels, each vertically adjacent to one of the binned pixels for a same color, horizontally adjacent to another of the binned pixels for the same color, and diagonally adjacent to yet another of the binned pixels for the same color are selected. The related operation may be expressed using the following equations: 
     
       
         
           
             
               
                 B 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 B 
                 
                   bin 
                    
                   
                       
                   
                    
                   1 
                 
               
             
             , 
             
               
 
             
              
             
               
                 G 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 G 
                 
                   bin 
                    
                   
                       
                   
                    
                   1 
                 
               
             
             , 
             
               
 
             
              
             
               
                 g 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 g 
                 
                   bin 
                    
                   
                       
                   
                    
                   1 
                 
               
             
             , 
             and 
           
         
       
       
         
           
             
               R 
               
                 n 
                  
                 
                     
                 
                  
                 1 
               
             
             = 
             
               
                 
                   9 
                   16 
                 
                  
                 
                   R 
                   
                     bin 
                      
                     
                         
                     
                      
                     1 
                   
                 
               
               + 
               
                 
                   3 
                   16 
                 
                  
                 
                   R 
                   
                     bin 
                      
                     
                         
                     
                      
                     2 
                   
                 
               
               + 
               
                 3 
                 16 
               
               + 
               
                 
                   1 
                   16 
                 
                  
                 
                   
                     R 
                     
                       bin 
                        
                       
                           
                       
                        
                       4 
                     
                   
                   . 
                 
               
             
           
         
       
     
       FIG. 4C  is a diagram illustrating a re-sampled pixel block derived from the binned pixel block  420  shown in  FIG. 5 . The re-sampled pixel block  430  shown in  FIG. 4C  is a 4×4 pixel block which is generated by re-sampling the binned pixel block  420 . Please note that the boxes with a dotted line are used for illustrative purposes only. In other words, the boxes with a dotted line are not pixels. The B n1 , G n1 , g n1 , and R n1  are the re-sampling pixels of the binning pixels B bin1 , G bin1 , g bin1 , and R bin1 , wherein the B n1  pixel, the G n1  pixel, and the g n1  pixel are identical to the B bin1  pixel, the G bin1  pixel, and the g bin1  pixel, respectively; only the R n1  pixel is modified. The position of the R n1  pixel is the box with a dotted line at the lower right side around the R bin1  pixel, and therefore the relative pixel distances between the R n1  pixel and the G n3  pixel, the relative pixel distance between the R n1  pixel and the g n1  pixel, the relative pixel distance between the g n1  pixel and the B n1  pixel, and the relative pixel distance between the G n1  pixel and the B n1  pixel are equal to each other. However, the corresponding composition of R n1  at the position (i.e., the box with a dotted line at the lower right side around the R bin1  of the binned pixel block  420 ) includes R bn1 , R bn2 , R bn3 , and R bn4 , and thus the weighting factor might be set as 9/16, 3/16, 3/16, and 1/16 respectively due to the relative pixel distances between the R n1  pixel and the R bin1  pixel, between the R n1  pixel and the R bin2  pixel, between the R n1  pixel and the R bin3  pixel, and between the R n1  pixel and the R bin4  pixel. The summation of the weighting factors of R bin1 , R bin2 , R bin3 , and R bin4  should be 1 due to that the composition of R n1  contains only R bin1 , R bin2 , R bin3 , and R bin4 . It should be noted that the weighting factors could be adjusted according to the actual demand in practice, and the settings in this embodiment are for illustrative purposes only, and are not meant to be a limitation of the present invention. Modifications of the weighting factors also belong to the scope of the present invention. 
       FIGS. 5A-5C  is a diagram illustrating a pixel block according to another embodiment of the present invention. The pixel block  510  shown in  FIG. 5A  is an 8×8 pixel block including 64 pixels belonging to 3 colors, blue (B), green (G), and red (R) according to the Bayer filter.  FIG. 5B  is a diagram illustrating a binned pixel block derived from the pixel block  510  shown in  FIG. 5A . The binned pixel block  520  shown in  FIG. 5B  is a 4×4 pixel block which is generated by the pixel binning algorithm configured to perform vertical sub-sampling horizontal binning. Please note that the boxes with a dotted line are used for illustrative purposes. In other words, the boxes with a dotted line are not pixels due to the 8×8 pixel block  510  being reduced to the 4×4 block  520  after the vertical sub-sampling horizontal binning process. A pixel sub-block  512  and a pixel sub-block  514  are bypassed due to the sub-sampling horizontal binning, and the remaining pixels in the pixel block  510  would be used to generate the binned pixel block  520 . The pixels in the binned pixel block  520  might be represented by the following equations: 
         B   bin1 =( B   1   +B   2 )/2, 
         G   bin1 =( G   1   +G   2 )/2, 
         g   bin1 =( g   1   +g   2 )/2, and 
         R   bin1 =( R   1   +R   2 )/2. 
     As other binned pixels in the binned pixel block  520  are generated according to the same rules like B bin1 , G bin1 , g bin1 , and R bin1 , the equations of other binned pixels in the binned pixel block  520  are omitted here for brevity. According the binned pixel block  520 , four separated groups would introduce irregular arrangement to the binned image. To put it another way, the relative pixel distances are changed and the pixel distribution is not uniform after the vertical sub-sampling horizontal binning process. In order to get rid of the side effects and to improve the image quality, the G bin1  pixel, the R bin1  pixel, and the g bin1  pixel need to be moved to new places like the re-sampled pixel block shown  FIG. 5C , thus ensuring the uniform distribution of the image. That is to say, when the binned image is generated by the pixel binning algorithm configured to perform vertical sub-sampling horizontal binning, the method includes selecting the binned pixels diagonally adjacent to each other for a same color; or selecting the binned pixels vertically adjacent to each other for the same color; or selecting the binned pixels, each vertically adjacent to one of the binned pixels for the same color, horizontally adjacent to another of the binned pixels for the same color, and diagonally adjacent to yet another of the binned pixels for the same color. The related operation may be expressed using the following equations: 
     
       
         
           
             
               
                 B 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 B 
                 
                   bin 
                    
                   
                       
                   
                    
                   1 
                 
               
             
             , 
             
               
 
             
              
             
               
                 G 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 
                   
                     3 
                     4 
                   
                    
                   
                     G 
                     
                       bin 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
                 + 
                 
                   
                     1 
                     4 
                   
                    
                   
                     g 
                     
                       bin 
                        
                       
                           
                       
                        
                       2 
                     
                   
                 
               
             
             , 
             
               
 
             
              
             
               
                 g 
                 
                   n 
                    
                   
                       
                   
                    
                   1 
                 
               
               = 
               
                 
                   
                     3 
                     4 
                   
                    
                   
                     g 
                     
                       bin 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
                 + 
                 
                   
                     1 
                     4 
                   
                    
                   
                     g 
                     
                       bin 
                        
                       
                           
                       
                        
                       3 
                     
                   
                 
               
             
             , 
             and 
           
         
       
       
         
           
             
               R 
               
                 n 
                  
                 
                     
                 
                  
                 1 
               
             
             = 
             
               
                 
                   9 
                   16 
                 
                  
                 
                   R 
                   
                     bin 
                      
                     
                         
                     
                      
                     1 
                   
                 
               
               + 
               
                 
                   3 
                   16 
                 
                  
                 
                   R 
                   
                     bin 
                      
                     
                         
                     
                      
                     2 
                   
                 
               
               + 
               
                 
                   3 
                   16 
                 
                  
                 
                   R 
                   
                     bin 
                      
                     
                         
                     
                      
                     3 
                   
                 
               
               + 
               
                 
                   1 
                   16 
                 
                  
                 
                   
                     R 
                     
                       bin 
                        
                       
                           
                       
                        
                       4 
                     
                   
                   . 
                 
               
             
           
         
       
     
       FIG. 5C  is a diagram illustrating a re-sampled pixel block derived from the binned pixel block  520  shown in  FIG. 5B . The re-sampled pixel block  530  shown in  FIG. 5C  is a 4×4 pixel block which is generated by re-sampling the binned pixel block  520 . Please note that the boxes with a dotted line are used for illustrative purposes only. In other words, the boxes with a dotted line are not pixels. The B n1 , G n1 , g n1 , and R n1  are the re-sampling pixels of the binning pixels B bin1 , G bin1 , g bin1 , and R bin1 , wherein the B n1  pixel is identical to the B bin1  pixel; however, the G bin1  pixel, the g n1  pixel, and the R n1  pixel are modified. The position of the g n1  pixel is the box with a dotted line right below the g bin1  pixel of the binned pixel block  520 , and therefore the relative pixel distance between the g n1  pixel and the B n3  pixel equals the relative pixel distance between the g n1  pixel and the B n1  pixel. The position of the G n1  pixel is the box with a dotted line close to the right side of the g bin1  pixel of the binned pixel block  520 , and therefore the relative pixel distance between the G n1  pixel and the B n2  pixel equals the relative pixel distance between the G n1  pixel and the B n1  pixel. The position of the R n1  pixel is the box with a dotted line at the lower right side around the R bin1  pixel, and therefore the relative pixel distance between the R n1  pixel and the G n1  pixel, the relative pixel distance between the R n1  pixel and the g n1  pixel, the relative pixel distance between the R n1  pixel and the g n2  pixel, and the relative pixel distance between the R n1  pixel and the G n3  pixel are equal to each other. However, the corresponding composition of g n1  at the position (i.e., the box with a dotted line right below the g bin1  pixel of the binned pixel block  320 ) includes both g bn1  and g bn3 , and the weighting factor should be ¾ and ¼ respectively due to the relative pixel distance between the g n1  pixel and the g bin3  pixel is 3 times as large as the relative pixel distance between the g n1  pixel and the g bin1  pixel. That is, the weighting factor of the g bin1  pixel should be 3 times as large as the weighting factor of the g bin3  pixel. As settings of other weighting factors can be easily deduced by analogy, further description is omitted here for brevity. It should be noted that the weighting factors could be adjusted according to the actual demand in practice, and the settings in this embodiment are for illustrative purposes only, and are not meant to be limitations of the present invention. Modifications on the weighting factors also belong to the scope of the present invention. 
       FIG. 6  is a block diagram illustrating a spatial binning circuit  430  according to an embodiment of the invention. The spatial binning circuit  430  includes a sensor array  612 , a spatial binning circuit  614 , and a re-sampling unit  601 . The sensor array  612  equipped in the spatial binning circuit  430  is used to receive a raw image for the spatial binning circuit  614  which will perform the pixel binning process upon the raw image by the binning unit, to generate an input pixels S i  and a pixel binning algorithm S a  for the re-sampling unit  601 . 
     The re-sampling unit  601  includes a selecting unit  602 , a weighting factor generator  604 , a multiplier  606 , and an adder  608 . The selecting unit  602  is arranged for selecting binned pixels S s  from the input pixels S i  of an image according to the pixel binning algorithm S a  adopted for generating the image. The weighting factor generator  604  is arranged for determining weighting factors S w  according to the pixel binning algorithm S a  adopted for generating the image. The multiplier  606  is arranged for multiplying a plurality of binned pixels S s  of the image with a plurality of weighting factors S w  to generate a plurality of weighted pixels S m , respectively. The adder  608  is arranged for summing up the weighted pixels S m  to generate a re-sampled pixel S o . Specifically, the spatial binning circuit  430  is devised to perform the above-mentioned spatial binning method. As a person skilled in the art can readily understand details of the spatial binning circuit  430  after reading above paragraphs, further description is omitted here for brevity. 
     Regarding the spatial binning circuit  430  shown in  FIG. 6 , a hardware-based implementation is employed. More specifically, the sensor array  612 , the spatial binning unit  614 , the selecting unit  602 , the weighting factor generator  604 , the multiplier  606 , and the adder  608  are hardware elements. However, using a software-based implementation to realize a spatial binning circuit is also feasible. Please refer to  FIG. 7 , which is a block diagram illustrating a spatial binning circuit  510  according to a second embodiment of the present invention. The spatial binning circuit  510  includes a processor  702  and a computer readable medium  704 . For example, the processor  702  may be a central processing unit (CPU) or a micro control unit (MCU), and the computer readable medium  704  may be a non-transitory storage device (e.g., a flash memory or a dynamic random access memory). The computer readable medium  704  has a program code PROG stored therein. When executed by the processor  702 , the program code PROG enables the processor  702  to perform steps of the above-mentioned spatial binning method  100  shown in  FIG. 1 . The same objective of obtaining a re-sampled pixel block (e.g.,  230 ,  330 ,  430  or  530 ) from processing a binned pixel block is achieved. 
     Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.