Abstract:
A compensation apparatus for digital image signal comprises an AFE (analog front end), a timing circuit, a differential pulse coding modulation (DPCM) unit and an arithmetic unit. The AFE digitalizes an analog signal from an image capture apparatus. The timing circuit provides timing control for the compensation apparatus. The DPCM unit for obtains offset and gain compensation parameter for each pixel. The arithmetic unit performs arithmetic operation to the digital signal of the AFE with respect to the offset and gain compensation parameter of the DPCM unit, thus obtaining compensated pixel.

Description:
FIELD OF THE INVENTION  
         [0001]    The present invention relates to a compensation apparatus for digital image signal, especially to a compensation apparatus using differential pulse coding modulation (DPCM) for compensating digital image signal.  
         BACKGROUND OF THE INVENTION  
         [0002]    The prior art image capture apparatus such as scanner, digital still camera (DSC) and digital video camera generally use charge coupled device or CMOS sensor for obtaining image data. However, the image capture apparatus may have image deviation due to discrepancy in optical and physical property of each pixel thereof, the image capture apparatus requires a compensation scheme to eliminate the image deviation. Moreover, the image capture apparatus may have pike noise due to dirt on surface or instable power supply, as shown in FIG. 1A. Even though in absence of luminance, the image capture apparatus also has pike noise due to dark current, as shown in FIG. 1B.  
           [0003]    The conventional compensation scheme for image capture apparatus can be classified into dark shading method (without luminance) and white shading method (with luminance). In each method, the output signal of the image capture apparatus is subjected to a gain compensation operation or an offset compensation operation. The output signal of the image capture apparatus may have different compensation parameters for each pixel thereof. The storing of compensation parameters requires large storage space. Moreover, the pike noise occurred in certain pixel requires more bit for precise representation, which worsens the problem.  
           [0004]    The storage space for gain and offset compensation parameters can be reduced at the expense of degraded resolution. The picture quality is deteriorated. Alternatively, the gain and offset compensation operations can be resorted to more powerful platform such as PC for scanner. However, this approach is not applicable to PDA (personal digital assistant).  
         SUMMARY OF THE INVENTION  
         [0005]    It is the object of the present invention to provide a compensation apparatus with less storage space and faster accessing speed.  
           [0006]    In one aspect of the invention, the offset data for each pixel is encoded and packeted beforehand in a host platform or offline and then stored in the compensation apparatus.  
           [0007]    In another aspect of the invention, differential pulse coding modulation (DPCM) is used to reduce storage space.  
           [0008]    To achieve above object, the present invention provides a compensation apparatus for digital image signal comprising an AFE (analog front end), a timing circuit, an offset DPCM unit and a subtractor for offset compensation.  
           [0009]    Alternative, the compensation apparatus for digital image signal comprising an AFE (analog front end), a timing circuit, a DPCM gain unit and a multiplier for gain compensation.  
           [0010]    Alternative, the compensation apparatus for digital image signal comprising an AFE (analog front end), a timing circuit, a DPCM gain unit, a multiplier a DPCM gain unit and a multiplier for offset and gain compensation.  
           [0011]    The various objects and advantages of the present invention will be more readily understood from the following detailed description when read in conjunction with the appended drawing, in which: 
       
    
    
     BRIEF DESCRIPTION OF DRAWINGS  
       [0012]    [0012]FIG. 1A shows the pike noise distribution in dark shading calibration;  
         [0013]    [0013]FIG. 1B shows the pike noise distribution in white shading calibration;  
         [0014]    [0014]FIG. 2 shows the schematic diagram of the first preferred embodiment of the present invention;  
         [0015]    [0015]FIG. 3 is a flowchart for the first preferred embodiment of the present invention;  
         [0016]    [0016]FIG. 4 shows the schematic diagram of the second preferred embodiment of the present invention;  
         [0017]    [0017]FIG. 5 shows part of the schematic diagram of the third preferred embodiment of the present invention; and  
         [0018]    [0018]FIG. 5A shows part of the schematic diagram of the third preferred embodiment of the present invention. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0019]    [0019]FIG. 2 shows the schematic diagram of the first preferred embodiment of the present invention, which is an offset compensation apparatus for digital image signal. The offset compensation apparatus of the present invention comprises an AFE (analog front end)  11 , a timing circuit  12 , an offset DPCM unit  13  and a subtractor  14 .  
         [0020]    The AFE I i  is functioned to digitalize an analog signal from a sensor (not shown) into a digital counter part.  
         [0021]    The timing circuit  12  provides timing control for overall system to treat each pixel in the digital image data.  
         [0022]    The offset DPCM unit  13  is functioned to obtain offset parameter for each pixel and is composed of a memory  131 , a code extractor  132 , a look-up table  133 , a code table  134 , a delay unit  135 , a predictor  136  and an adder  137 . The memory  131  stores an offset data for each pixel, which is encoded and packeted beforehand in a host platform or offline. The memory  131  is synchronized by the timing circuit  12  and provides an offset codeword W i  for i-th pixel to the code extractor  132 . The code extractor  132  generates a code index I i  in response to the offset codeword W i  and sends the code index I i  to the look-up table  133 . The look-up table  133  receives the code index I i  and finds a corresponding reconstruction codeword C i  from the code table  134  for the i-th pixel. The delay unit  135  is used to store previous k offset compensation parameters S i−1 , S i−2  . . . S i−k  of the i-th pixel, and the predictor  136  generates a pixel offset prediction P i =F(S i−1 , S i−2  . . . S i−k ) with reference to the previous k offset compensation parameters S i−1 , S i−2  . . . S i−k  stored in the delay unit  135  and an appropriate prediction function. The adder  137  adds the pixel offset prediction P i  to the reconstruction codeword C i , thus obtaining an offset compensation parameter S i  for the i-th pixel, i.e., S i =P i +C i .  
         [0023]    The subtractor  14  subtract the offset compensation parameter S i  for the i-th pixel from the digital data R i  for the i-th pixel produced by the AFE I i  and generates a compensated image data X i  for the i-th pixel, i.e., X i =R i −S i .  
         [0024]    Moreover, the code table  134  contains escape code (not shown) for treating the compensation for the pike noise. If the i-th pixel has pike nose, the prefix of the code index I i  has escape code and the remaining part of the code index I i  points to a reconstruction codeword C i  with more bit to obtain the required offset compensation parameter S i  for the i-th pixel.  
         [0025]    [0025]FIG. 3 is a flowchart showing how to obtain the offset codeword W i  in the memory  131 , the prediction function used by the predictor  136 , and the reconstruction codeword C i  in the code table  134  by a calibration process.  
         [0026]    Step  31 : A shading data is obtained from a calibration process.  
         [0027]    Step  32 : A reference data for the shading data is calculated.  
         [0028]    Step  33 : An optimal prediction function for the predictor  136  is derived from the reference data.  
         [0029]    Step  34 : A residual sequence is obtained by differential pulse coding modulation (DPCM) with reference to the prediction function.  
         [0030]    Step  35 : Pike noises are removed from the residual sequence.  
         [0031]    Step  36 : An optimal quantizer is derived for the generating the reconstruction codeword C i  in the code table  134 .  
         [0032]    Step  37 : The residual sequence is encoded to obtain the offset codeword W i  in the memory  131 .  
         [0033]    [0033]FIG. 4 shows the schematic diagram of the second preferred embodiment of the present invention, which is a gain compensation apparatus for digital image signal. The gain compensation apparatus of the present invention comprises an AFE (analog front end)  21 , a timing circuit  22 , a DPCM gain unit  23  and a multiplier  24 . Similar to the first preferred embodiment of the present invention shows in FIG. 3, the multiplier  24  multiplies the gain compensation parameter S′ i  for the i-th pixel to the digital data R′ i  for the i-th pixel produced by the AFE  21  and generates a compensated image data X′ i  for the i-th pixel, i.e., X′ i =R′ i ×S′ i .  
         [0034]    The DPCM gain unit  23  has similar components to those in the offset DPCM unit  13  of the first preferred embodiment of the present invention, such as a memory  231 , a code table  234  and a predictor  236 . Moreover, the generation of offset codeword in the memory  231 , the prediction function used by the predictor  236 , and the reconstruction codeword in the code table  234  are obtained in similar way to the counterparts in the first preferred embodiment except following:  
         [0035]    (a) the size and content of the memory  231 ;  
         [0036]    (b) the way for the code extractor  232  to generate a code index I′ i  for i-th pixel;  
         [0037]    (c) the size and content of the code table  234 ;  
         [0038]    (d) the length of the delay unit  23 ;  
         [0039]    (e) the prediction function used by the predictor  236 .  
         [0040]    [0040]FIGS. 5 and 5A shows the schematic diagram of the third preferred embodiment of the present invention, which is an offset and gain compensation apparatus for digital image signal. The offset and gain compensation apparatus of the present invention comprises an AFE (analog front end)  11 , a timing circuit  12 , an offset DPCM unit  13 , a subtractor  14 , a DPCM gain unit  23  and a multiplier  24 .  
         [0041]    Similar to the first preferred embodiment, the subtractor  14  generates an image data X i  with offset compensation and the multiplier  24  multiplies the image data X i  with offset compensation to gain compensation parameter S′ i  to obtain an image data Y i  with offset and gain compensation.  
         [0042]    For a 1200 dpi A4 size scanned data, the prior art image compensation scheme requires 192 KB DRAM for storing the offset and gain compensation data. The data accessing time is 50 ns if 60 ns DRAM are used. In the present invention, only 38.4 KB DRAM is required if the compression factor of differential pulse coding modulation (DPCM) is 5. In other word, the accessing time is improved to 10 ns in the present invention.  
         [0043]    To sum up, the compensation apparatus for digital image signal of the present invention has following advantages:  
         [0044]    (1) The storage spaces for the offset and gain compensation data is reduced.  
         [0045]    (2) The accessing speed for offset and gain compensation is enhanced.  
         [0046]    Although the present invention has been described with reference to the preferred embodiment thereof, it will be understood that the invention is not limited to the details thereof. Various substitutions and modifications have suggested in the foregoing description, and other will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims.