Abstract:
A system including a processor for adjusting the dynamic range of an image including a plurality of pixels. The processor segments the pixels into blocks, and computes statistical values for each block based on intensity values of the pixels. The processor also adjusts the dynamic range of the image by controlling the intensity values of the pixels based on the statistical values.

Description:
The present invention relates, in general, to a system and method for performing spatially variant dynamic range adjustment (SVDRA) to enhance the contrast of an image or video sequence. Specifically, the system utilizes local block statistics in order to perform SVDRA. 
     BACKGROUND 
     In conventional systems, contrast enhancement for still pictures and video sequences is generally broken into two categories: global based enhancement and local based enhancement. An image histogram (showing distribution of pixel intensity values) is the primary tool to determine how input pixels are mapped to output pixels when performing contrast enhancement. 
     In some global based systems, a processor computes a histogram of the entire image utilizing the entire data set (all of the pixels in the image). Based on this cumulative histogram of the image, the system determines gain and offset of each pixel in order to perform dynamic range adjustment. 
     In some local based systems, the image is segmented into smaller blocks within the image where each block includes a computed local histogram. The adjusted value of each pixel in each block is then determined based on the histogram of the respective block. 
     In general, global systems compute histograms of an entire image data set which may be negatively influenced by dominant objects such as sky, water, foreground grass, etc. This often results in a less than desirable appearance which lacks noticeable distinction between grey levels. In contrast, local systems tend to produce better results than the global systems. However, computing and manipulating multiple histograms (for many blocks within an image) may pose problems to systems having limited processing and/or storage capabilities. 
     SUMMARY 
     To meet this and other needs, and in view of its purposes, the present invention provides a system for adjusting dynamic range of an image which includes a plurality of pixels. The system includes a processor configured to segment the pixels into blocks, and compute statistical values for each block based on intensity values of the pixels in each blocks. The processor adjusts the dynamic range of the image by controlling the intensity values of the pixels based on the statistical values. 
     The system may also include an image sensor for capturing the image, and a display for displaying an adjusted image. In one example, the processor, image sensor and display are included in a Video Capture and Enhancement system (VCED) controlled by a user. 
     In one example, the processor is configured to exclude pixel values in each block before computing the statistical values. The processor computes a minimum pixel value, a maximum pixel value, a mean pixel value and a mean of absolute differences (MAD) value, per each block, as the statistical values. The processor is also configured to compute for each block, a gain value based on the mean pixel value and MAD value of the respective block, and an offset value based on the mean pixel value of the respective block. The processor then adjusts the dynamic range of the image by applying a respective gain value and a respective offset value to each pixel in each block. 
     In one example, the processor is configured to segment the pixels into blocks that overlap each other, or blocks that do not overlap each other. The processor is also configured to adjust the gain value and offset value applied to each pixel by weighting the gain value and offset value based on a distance between each pixel and a reference location in the pixel block to which each pixel belongs and reference locations in adjacent pixel blocks. 
     In another example, the processor configured to segment the pixels into blocks, compute a gain and an offset value for each block in an image based on intensity values of the pixels in each block and filter the gain and offset values for the blocks based on a previous gain and offset values for the block in a previous image. The processor then adjusts the dynamic range of the image by controlling the intensity values of the pixels based on the filtered pixel gain and offset. 
     Included are an image sensor for capturing real time video, and a display for displaying an adjusted real time video. In one example, the processor, image sensor and display are included in a vehicle. 
     The processor is configured to compute the gain and offset values for each block in each image based on statistical values such as a minimum pixel value, maximum pixel value, mean pixel value and mean of absolute differences (MAD) value. The processor is also configured to filter the gain and offset values by an infinite impulse response (IIR) filter that computes a weighted sum between the gain and offset values of a block in the image and the previous gain and offset values of the block in the previous image in the sequence. 
     The processor is configured to adjust the gain value and offset value by weighting the gain value and offset value based on a distance between each pixel and a reference location in the pixel block to which each pixel belongs and reference locations in adjacent pixel blocks. The processor is configured to select three adjacent blocks when the pixel is located between the centers of four blocks, and select one adjacent block when the pixel is located between the centers of two blocks and a border of the image. 
     In one example, the processor is configured to convolve the statistical values of each block with a normalized convolution kernel to reduce a difference between statistical values in adjacent blocks, and to overlap the blocks in the image to correlate the statistical values between adjacent blocks. 
     A method for adjusting dynamic range of an image including a plurality of pixels, includes segmenting the pixels into blocks, and computing statistical values for each block based on intensity values of the pixels in each block. The method also includes adjusting the dynamic range of the image by controlling the intensity values of the pixels based on the statistical values. 
     The method may also include capturing the image, displaying the adjusted image, and identifying an object of interest in the adjusted image. In one example the method includes computing, for each block, a minimum pixel value, maximum pixel value, mean pixel value, where the pixel values below and above an intensity threshold are excluded prior to computing the minimum, maximum and mean values. 
     The method may also include computing a mean of absolute differences (MAD) value, where the pixel values below the threshold are set to the minimum value and the pixel values above the threshold are set to the maximum pixel value prior to computing the MAD, and where the minimum, maximum and MAD values are the statistical values. 
     The method may also include computing a gain value based on the mean pixel value and MAD value of the respective block, computing an offset value based on the mean pixel value of the respective block, and adjusting the dynamic range of the image by applying the respective gain value and respective offset value to each pixel in each block. 
     The method may also include adjusting the gain value and offset value applied to each pixel by weighting the gain value and offset value based on a distance between each pixel and a reference location in the pixel block to which each pixel belongs and adjacent pixel blocks. 
     It is understood that the foregoing general description and following detailed description are exemplary, but are not restrictive, of the invention. 
    
    
     
       BRIEF DESCRIPTION OF THE FIGURES 
         FIG. 1  is a view of a Video Capture Enhancement and Display (VCED) system for performing SVDRA, according to an embodiment of the present invention. 
         FIG. 2   a  is a view of an image which is segmented into a plurality of pixel blocks for performing SVDRA, according to an embodiment of the present invention. 
         FIG. 2   b  is a view of another image segmented into a plurality of pixel blocks that overlap each other for performing SVDRA, according to an embodiment of the present invention. 
         FIG. 3   a  is a flow chart describing an algorithm for computing block statistics, according to an embodiment of the present invention. 
         FIG. 3   b  is a flow chart describing an algorithm for computing block gain and offset, according to an embodiment of the present invention. 
         FIG. 4   a  is a view of a pixel block histogram discarding high and low intensity pixels, according to an embodiment of the present invention. 
         FIG. 4   b  is a view of a pixel block histogram saturating high and low level intensity pixels to a minimum and maximum intensity value, according to an embodiment of the present invention. 
     
    
    
     DETAILED DESCRIPTION 
     As will be described, the present invention provides a spatially variant dynamic range adjustment (SVDRA) system configured to perform contrast enhancement (i.e. adjust intensity values of pixels) based on statistics within an image. The system provides the ability to segment an image into a plurality of pixel blocks. Statistics (not a histogram) for each pixel block are then computed. A gain and an offset (i.e. pixel-wise remapping parameters) for performing dynamic range adjustment are then computed based on the statistics of each pixel block. 
     In one embodiment a Video Capture Enhancement and Display (VCED) system  102  (e.g. an imaging system mounted to a vehicle, etc.) may be capturing a real time video of a scene (e.g. a battlefield). For example, image sensor  108  (e.g. Frame Array Digital Image Sensor, thermal/intensity sensor, etc. . . . ) may be capturing an image  112  of the scene which may have low contrast due to dominant background artifacts (e.g. foliage). Processor  104  (utilizing memory  106 ) may perform SVDRA in order to enhance contrast of image  112 . An enhanced contrast image may then be displayed (by display  110 ), allowing the observer (e.g. soldier) to visually interpret the structure of objects of interest (e.g. vehicles, persons, structures) within the image. Although  FIG. 1  shows a system implementing SVDRA in an VCED system, it is noted that SVDRA of the present invention may be implemented on any image or video that is either captured by an image sensor in real time or pre-stored in a database memory (i.e. a pre-stored image may be extracted from a database and processed to adjust its dynamic range). 
     For example, a visual light, laser, thermal, radio frequency, or any other type of image sensor may be utilized to capture an image of interest. The sensor may be implemented on an VCED system worn by a user (e.g. police officer), or mounted to a vehicle (e.g. police car, jeep, aircraft, etc.). Regardless of how the image is captured, processor  104  (e.g., a microprocessor, field programmable gate array (FPGA), application specific integrated circuit (ASIC), etc. . . . ) may be utilized to perform the SVDRA algorithm described by the present invention. In either embodiments, the present invention enhances an image to allow an observer to visually interpret and distinguish objects within the image. 
     Rather than computing histograms for each pixel block in image  112  (i.e. as in conventional local based systems), the SVDRA system of the present invention computes descriptive statistics on a block by block basis. The descriptive statistics from each block within the image are utilized to compute a pixel dependent linear stretch (i.e. adjust the pixel intensity values). 
     Shown in  FIG. 2   a  is an image  200  which includes a plurality of pixels (e.g., 1000×1000 pixels). In the SVDRA algorithm, the image is segmented into smaller pixel blocks b(i,j). As shown in  FIG. 2   a , image  200  is broken into M rows×N columns pixel blocks, where each pixel block includes a plurality of pixels from the overall image. For example, if the image has dimensions of 1000×1000 pixels, and the number of pixel blocks is determined as 100 (i.e. M=10 rows by N=10 columns), then each pixel block has dimensions 100×100 pixels. During processing, pixel statistics for each pixel block (e.g. based on 10,000 pixels per block) are computed and stored in memory. These statistics are then utilized to compute remapping parameters for each pixel within the image to perform contrast enhancement. 
     Although remapping pixels based primarily on remapping parameters within each respective pixel block may be effective, utilizing remapping parameters of adjacent pixel blocks may also be beneficial. Thus, in one example, the system utilizes remapping parameters from the pixel block where it is located, and remapping parameters from adjacent pixel blocks in order to remap each pixel. For example, as shown in  FIG. 2   a , pixel P(x,y) of pixel block b(0,0) may be operated on. In one example, the remapping parameters of pixel block b(0,0) and adjacent pixel blocks b(0,1), b(1,0) and b(1,1) each contribute to remapping pixel P(x,y). The remapping parameters for each of the four pixel blocks may be weighted equally (i.e. equally contributing to remapping), or may be weighted according to the distance between pixel P(x,y) and the respective centers (i.e. c(0,0), c(0,1), c(1,0) and c(1,1)) of the four pixel blocks (i.e. remapping parameters contribute to remapping based on distance to pixel P(x,y)). 
     In the example shown in  FIG. 2   a , the remapping parameters of block b(0,0) may be dominant because distance d 1  is the shortest of the four distances. Distance statistics of block b(1,1), however may not carry as much weight because distance d 4  is the longest of the four distances. In this example, the center pixel of each pixel block is utilized as a reference point relative to each pixel being operated on. However, another point within the pixel block (i.e. other than the center) may alternately be utilized as a reference point. It is also noted that the remapping parameters from any number of pixel blocks (i.e. 1 or more) may be chosen to contribute to remapping each pixel. 
     If a pixel is located between the centers of two pixel blocks and the border of the image, then remapping parameters of the two pixel blocks may be utilized. Shown in  FIG. 2   a  is an example where pixel P(x,y) is located between blocks b(N−1,0), b(N,0), and the border of the image. In this example, the remapping parameters of blocks b(N−1,0) and b(N,0) may be utilized for remapping. 
     In general, the pixel by pixel remapping operation is performed throughout the entire image until each pixel has an adjusted intensity value resulting in an image with enhanced contrast Although image  200  in  FIG. 2   a  shows that the pixel blocks are spatially independent (i.e. non-overlapping) of one another, they also may overlap each other as shown in  FIG. 2   b . For example, pixel blocks b(0,0) and b(1,0) are shown to overlap each other by half (e.g. 50 pixels in a 100×100 block) a block. The amount of overlap is not limited to half and may be any number of pixels. Also, even though  FIG. 2   b  shows the columns of pixel blocks being overlapped, it is also noted that the rows of pixel blocks may also overlap. One advantage of overlapping the pixel blocks is that the statistics between adjacent blocks will be somewhat correlated and will not vary as much from block to block (i.e. the statistics of adjacent blocks will be computed based on common pixel values in the overlapping regions). Thus, the statistics may be somewhat correlated between columns, rows or a combination of both. It is also contemplated that pixel blocks may overlap each other in a diagonal direction (not shown) and furthermore that the pixel blocks may be shapes other than squares (not shown). 
     One embodiment for performing SVDRA is described in the equations below and in the flowcharts of  FIGS. 3   a  and  3   b . Some of the parameters of the blocks and the pixels in the image are shown in the table below: 
     
       
         
               
               
               
               
             
               
               
               
               
             
           
               
                   
                   
               
               
                   
                 Name 
                 Symbol 
                 Value 
               
               
                   
                   
               
             
             
               
                   
               
             
          
           
               
                   
                 Input Bit Depth 
                 b 
                 16 
               
               
                   
                 Output Bit Depth 
                 {tilde over (b)} 
                 12 
               
               
                   
                 Image Width 
                 w 
                 640 
               
               
                   
                 Image Height 
                 h 
                 480 
               
               
                   
                 Block Width 
                 bw 
                 32 
               
               
                   
                 Block Height 
                 bh 
                 32 
               
               
                   
                   
               
             
          
         
       
     
     In general, SVDRA utilizes statistics computed on a block by block basis to define pixel wise remapping parameters. These blocks have dimensions 2 n  pixel rows and 2 m  pixel columns. These blocks tile the image starting from the origin and stop when all pixels have been covered by a tile. Also, non-full and non-empty blocks may be allowed to ensure that all pixels in the image with non power of two dimensions are represented. 
     During processing of the pixel blocks, SVDRA computes, independent of the histogram, statistical values for the block mean, the block maximum, the block minimum and the block mean of absolute difference (MAD) (See  FIG. 3   a ). In general, block boundaries (step  302 ) may be computed in which a pixel p x, y  is determined to be a member of the pixels corresponding to the block b i,j  when it positively satisfies Equation 2.1. 
     
       
         
           
             
               
                 
                   
                     p 
                     
                       x 
                       , 
                       y 
                     
                   
                   ∈ 
                   
                     
                       { 
                       
                         b 
                         
                           i 
                           , 
                           j 
                         
                       
                       } 
                     
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       s 
                       . 
                       t 
                       . 
                       
                         { 
                         
                           
                             
                               
                                 
                                   
                                     ∑ 
                                     
                                       r 
                                       = 
                                       0 
                                     
                                     i 
                                   
                                   ⁢ 
                                   
                                     b 
                                     ⁢ 
                                     
                                         
                                     
                                     ⁢ 
                                     
                                       ω 
                                       ⁡ 
                                       
                                         ( 
                                         r 
                                         ) 
                                       
                                     
                                   
                                 
                                 ≤ 
                                 x 
                                 &lt; 
                                 
                                   
                                     ∑ 
                                     
                                       r 
                                       = 
                                       0 
                                     
                                     
                                       i 
                                       + 
                                       1 
                                     
                                   
                                   ⁢ 
                                   
                                     b 
                                     ⁢ 
                                     
                                         
                                     
                                     ⁢ 
                                     
                                       ω 
                                       ⁡ 
                                       
                                         ( 
                                         r 
                                         ) 
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     ∑ 
                                     
                                       r 
                                       = 
                                       0 
                                     
                                     j 
                                   
                                   ⁢ 
                                   
                                     bh 
                                     ⁡ 
                                     
                                       ( 
                                       r 
                                       ) 
                                     
                                   
                                 
                                 ≤ 
                                 x 
                                 &lt; 
                                 
                                   
                                     ∑ 
                                     
                                       r 
                                       = 
                                       0 
                                     
                                     
                                       j 
                                       + 
                                       1 
                                     
                                   
                                   ⁢ 
                                   
                                     bh 
                                     ⁡ 
                                     
                                       ( 
                                       r 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   2.1 
                   ) 
                 
               
             
           
         
       
     
     In general, each block has a local pixel based coordinate system indexed by the horizontal coordinate u and vertical coordinates v. The range of u runs from zero at the left of the block through bw(i)-1, while v similarly runs from zero at the top of the block through bh(j)-1. 
     Before computing the statistics, SVDRA may exclude high and low pixels values (step  304 ) from each block. In general, before computing the mean, minimum and maximum of each block, a new set of pixels {tilde over (b)} i,j  is first generated, where {tilde over (b)} i,j  is a population of valid pixels that will number δ i,j . This population size in general is less than or equal to the total number of pixels in the original population b i,j  which as a population size w i,j.    
     To form {tilde over (b)} i,j  each pixel in b i,j  that is less than the low clip point c low , and greater than the high clip point c high  is removed from the set. This exclusion process is illustrated in  FIG. 4   a  where the pixel value is less than c low  and greater than c high  or excluded from the block. This process is applied by the relationship in Equation 2.2:
 
 pε{{tilde over (b)}   i,j   }s.t. c   low   ≦p≦c   high   ∩pε{b   i,j }  (2.2)
 
     In one embodiment, the intensity values of the pixels may be compared to thresholds c low  and c high  in order to determine if they fall within the appropriate range. If they are greater than or equal to c low  or less than or equal to c high , they are utilized to compute the block statistics (otherwise they are discarded). 
     Once the high and low values are excluded, SVDRA computes the block minimum, maximum and mean (steps  308 - 312 ). A minimum and a maximum value are found in each set {tilde over (b)} i,j  which are defined by the relationships in equation 2.3 and 2.4:
 
min i,j =min({ {tilde over (b)}   i,j }) s.t. min i,j   ≦p∀pε{{tilde over (b)}   i,j }  (2.3)
 
max i,j =max({ {tilde over (b)}   i,j }) s.t. max i,j   ≧p∀pε{{tilde over (b)}   i,j }  (2.4)
 
     In some instances, the exclusion operation (step  304 ) may produce zero pixels. Both non-zero set sizes and zero set sizes are handled as separate conditions. If the number of pixels after exclusion is zero, then equation 2.5 is applied to the value of the minimum, maximum and mean value are set to either c low  or c high , whichever is exceeded by the last pixel in set b i,j . 
     
       
         
           
             
               
                 
                   
                     min 
                     
                       i 
                       , 
                       j 
                     
                   
                   ⁢ 
                   
                     = 
                     
                       
                         max 
                         
                           i 
                           , 
                           j 
                         
                       
                       ⁢ 
                       
                         = 
                         
                           
                             mean 
                             
                               i 
                               , 
                               j 
                             
                           
                           = 
                           
                             { 
                             
                               
                                 
                                   
                                     
                                       c 
                                       low 
                                     
                                     ⁢ 
                                     
                                         
                                     
                                   
                                 
                                 
                                   
                                     
                                         
                                     
                                     ⁢ 
                                     
                                       
                                         if 
                                         ⁢ 
                                         
                                             
                                         
                                         ⁢ 
                                         
                                           p 
                                           
                                             ( 
                                             
                                               
                                                 
                                                   b 
                                                   ⁢ 
                                                   
                                                       
                                                   
                                                   ⁢ 
                                                   
                                                     ω 
                                                     ⁡ 
                                                     
                                                       ( 
                                                       
                                                         i 
                                                         + 
                                                         1 
                                                       
                                                       ) 
                                                     
                                                   
                                                 
                                                 - 
                                                 1 
                                               
                                               , 
                                               
                                                 
                                                   bh 
                                                   ⁡ 
                                                   
                                                     ( 
                                                     
                                                       j 
                                                       + 
                                                       1 
                                                     
                                                     ) 
                                                   
                                                 
                                                 - 
                                                 1 
                                               
                                             
                                             ) 
                                           
                                         
                                       
                                       ≤ 
                                       
                                         c 
                                         low 
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       c 
                                       high 
                                     
                                     ⁢ 
                                     
                                         
                                     
                                   
                                 
                                 
                                   
                                     
                                       if 
                                       ⁢ 
                                       
                                           
                                       
                                       ⁢ 
                                       
                                         p 
                                         
                                           ( 
                                           
                                             
                                               
                                                 b 
                                                 ⁢ 
                                                 
                                                     
                                                 
                                                 ⁢ 
                                                 
                                                   ω 
                                                   ⁡ 
                                                   
                                                     ( 
                                                     
                                                       i 
                                                       + 
                                                       1 
                                                     
                                                     ) 
                                                   
                                                 
                                               
                                               - 
                                               1 
                                             
                                             , 
                                             
                                               
                                                 bh 
                                                 ⁡ 
                                                 
                                                   ( 
                                                   
                                                     j 
                                                     + 
                                                     1 
                                                   
                                                   ) 
                                                 
                                               
                                               - 
                                               1 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                     ≥ 
                                     
                                       c 
                                       high 
                                     
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   2.5 
                   ) 
                 
               
             
           
         
       
     
     In general, the mean of the (i,j)th block is computed as the sum of the elements in {tilde over (b)} i,j  divided by the total number of valid elements, ε i,j  as shown in Equation 2.6: 
     
       
         
           
             
               
                 
                   
                     mean 
                     
                       i 
                       , 
                       j 
                     
                   
                   = 
                   
                     
                       1 
                       
                         ε 
                         
                           i 
                           , 
                           j 
                         
                       
                     
                     ⁢ 
                     
                       ∑ 
                       
                         p 
                         ⁢ 
                         
                           ∀ 
                           
                             p 
                             ∈ 
                             
                               { 
                               
                                 
                                   b 
                                   ~ 
                                 
                                 
                                   i 
                                   , 
                                   j 
                                 
                               
                               } 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   2.6 
                   ) 
                 
               
             
           
         
       
     
     Before computing the Mean of Absolute Differences (MAD) (step  314 ), the high and low values may be clipped from the block (step  306 ). For example, a new set of pixel values {circumflex over (b)} i,j  is first generated from b i,j . Rather than dropping pixels from set b i,j , the values of the entries are modified (i.e. clamped). The expectation is that the {circumflex over (b)} i,j  may be the same size as b i,j . In general, when clipping high and low values, the values of b i,j  are replicated except where a value is less than c low  or greater than c high . The pixel values less than c low  are saturated to the value of c low  and the pixel values greater than c high  are saturated to the value of c high . The value of elements in the set {circumflex over (b)} i,j  is defined in Equation 2.7: 
     
       
         
           
             
               
                 
                   
                     
                       p 
                       ^ 
                     
                     ∈ 
                     
                       
                         { 
                         
                           
                             b 
                             ~ 
                           
                           
                             i 
                             , 
                             j 
                           
                         
                         } 
                       
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         s 
                         . 
                         t 
                         . 
                         
                           p 
                           ^ 
                         
                       
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             c 
                             low 
                           
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               p 
                             
                             &lt; 
                             
                               c 
                               low 
                             
                           
                         
                       
                       
                         
                           p 
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 c 
                                 low 
                               
                             
                             ≤ 
                             p 
                             ≤ 
                             
                               
                                 c 
                                 high 
                               
                               ⁢ 
                               
                                 ∀ 
                                 
                                   p 
                                   ∈ 
                                   
                                     b 
                                     
                                       i 
                                       , 
                                       j 
                                     
                                   
                                 
                               
                             
                           
                         
                       
                       
                         
                           
                             c 
                             low 
                           
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               p 
                             
                             &gt; 
                             
                               c 
                               high 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   2.7 
                   ) 
                 
               
             
           
         
       
     
     In general, step  306  is illustrated in  FIG. 4   b  where the pixel values less than c low  are set at the value of c low  and the pixel values greater than c high  are set at c high . 
     Once the high and low values are clipped, the MAD statistic is computed (step  314 ). The MAD is another descriptive statistic which may be preferred over computing the standard deviation for its comparative computational simplicity (i.e. computing the standard deviation requires squaring and square-root operations which may be computationally intensive in some systems). The MAD statistic captures the average magnitude of the differences between the values in a pixel set and the mean of the set. The MAD value may also be properly scaled to keep the values consistent with expectations. 
     The MAD statistic is computed based on the set of clipped values {circumflex over (b)} i,j  but uses the block mean which as previously described was computed using the exclusion modified set {tilde over (b)} i,j . The MAD calculation is defined in Equation 2.8 where w i,j  is the number of elements in {circumflex over (b)} i,j . It is noted that in certain instances, if the mean for the pixel block of the current temporal frame is not available, the SVDRA may utilize the value of the pixel block mean of the prior temporal frame in the video sequence. 
     Once the basic block statistics (e.g. min, max, mean and MAD) have been computed, SVDRA derives two values e_min ij  and e_max ij  for each of the pixel blocks as described in steps  316  and  318  of  FIG. 3   b . At each pixel block, the MAD and mean value are utilized to compute a preliminary value for e_min i,j   init  and e_max i,j   init . These values are computed by Equations 3.1 and 3.2 where β is a scaler value:
 
 e _min i,j   init =max(0,mean i,j −β(mad i,j ))  (3.1)
 
 e _max i,j   init =min(2 b −1,mean i,j +β(mad i,j ))  (3.2)
 
     In some instances when a pixel block has a skewed distribution e_min i,j   init  or e_max i,j   init  may exceed the block min ij  or max ij . Thus, SVDRA may restrict the e_min and e_max values (steps  320 ,  322  and  324 ) based on the pixel block minimum value and maximum value. If e_min i,j   init  or e_max i,j   init  is within the extremes of min ij  of max ij , it may not be altered. Otherwise, the average of the extreme and respective e_min i,j   init  or e_max i,j   init  is used as shown in Equations 3.3 and 3.4 where n low  and n high  are relative weights for each block: 
     
       
         
           
             
               
                 
                   
                     e_min 
                     
                       i 
                       , 
                       j 
                     
                     rct 
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             e_min 
                             
                               i 
                               , 
                               j 
                             
                             init 
                           
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 e_min 
                                 
                                   i 
                                   , 
                                   j 
                                 
                                 init 
                               
                             
                             ≥ 
                             
                               min 
                               
                                 i 
                                 , 
                                 j 
                               
                             
                           
                         
                       
                       
                         
                           
                             
                               ( 
                               
                                 
                                   ( 
                                   
                                     1 
                                     - 
                                     
                                       η 
                                       low 
                                     
                                   
                                   ) 
                                 
                                 ⁢ 
                                 
                                   e_min 
                                   
                                     i 
                                     , 
                                     j 
                                   
                                   init 
                                 
                               
                               ) 
                             
                             + 
                             
                               ( 
                               
                                 
                                   ( 
                                   
                                     η 
                                     low 
                                   
                                   ) 
                                 
                                 ⁢ 
                                 
                                   min 
                                   
                                     i 
                                     , 
                                     j 
                                   
                                 
                               
                               ) 
                             
                           
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 e_min 
                                 
                                   i 
                                   , 
                                   j 
                                 
                                 init 
                               
                             
                             &lt; 
                             
                               min 
                               
                                 i 
                                 , 
                                 j 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   3.3 
                   ) 
                 
               
             
             
               
                 
                   
                     e_max 
                     
                       i 
                       , 
                       j 
                     
                     rct 
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             e_max 
                             
                               i 
                               , 
                               j 
                             
                             init 
                           
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 e_max 
                                 
                                   i 
                                   , 
                                   j 
                                 
                                 init 
                               
                             
                             ≤ 
                             
                               max 
                               
                                 i 
                                 , 
                                 j 
                               
                             
                           
                         
                       
                       
                         
                           
                             
                               ( 
                               
                                 
                                   ( 
                                   
                                     1 
                                     - 
                                     
                                       η 
                                       high 
                                     
                                   
                                   ) 
                                 
                                 ⁢ 
                                 
                                   e_max 
                                   
                                     i 
                                     , 
                                     j 
                                   
                                   init 
                                 
                               
                               ) 
                             
                             + 
                             
                               ( 
                               
                                 
                                   ( 
                                   
                                     η 
                                     high 
                                   
                                   ) 
                                 
                                 ⁢ 
                                 
                                   max 
                                   
                                     i 
                                     , 
                                     j 
                                   
                                 
                               
                               ) 
                             
                           
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 e_max 
                                 
                                   i 
                                   , 
                                   j 
                                 
                                 init 
                               
                             
                             &gt; 
                             
                               max 
                               
                                 i 
                                 , 
                                 j 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   3.4 
                   ) 
                 
               
             
           
         
       
     
     In other cases the difference of e_min i,j   rct  and e_max i,j   rct  may be small which may cause the SVDRA to over stretch the dynamic range. Thus, the SVDRA may protect against undesirable results by enforcing minimum stretch limits to e_min i,j   rct  and e_max i,j   rct  so that their difference is at least a minimum stretch limit. This may be accomplished by setting a new value equidistant from the original midpoint between e_min i,j   rct  and e_max i,j   rct  such that the new value e_min i,j   str  and e_max i,j   str  differ by λ. This operation is defined in Equations 3.5, 3.6 and 3.7:
 
 a   i,j =0.5( e _max i,j   rct   +e _min i,j   rct )  (3.5)
 
 e _min i,j   str   =a   ij −0.5(λ)  (3.6)
 
 e _max i,j   str   =a   ij +0.5(λ)  (3.7)
 
     In steps  326  and  334 , a denominator value and an offset value are respectively computed. Specifically, the gain value (i.e. one of the remapping parameters) that will eventually be used to compute the output pixel values will be the ratio between an output data maximum (2 {tilde over (b)} −1) and the denominator. The denominator may be related to the range of the input count values to be stretched, and is simply the difference between e_max i,j   str  and e_min i,j   str  as shown in Equation 3.8:
 
denom i,j   =e _max i,j   str   −e _min i,j   str   (3.8)
 
     Furthermore, the offset value that will eventually be utilized to compute the output pixel value will be the mean value of the pixel block after convolution as defined in Equation 3.9:
 
offset i,j =mean i,j   (3.9)
 
     It is noted that a selected pixel block may have significantly different statistics than a neighboring adjacent pixel block, which may produce undesired artifacts within the image after stretching. Thus, SVDRA performs a smoothing convolution operation (steps  328  and  334 ) on the computed offset and denominator values. Each offset and denominator value for each respective pixel block is convolved by a convolution kernel to produce convolved values offset i,j   conv  and denom i,j   conv . The kernel utilized for involving the offset and denominator values may be implemented as a spatial mask that is scanned across the pixel blocks within the image. For example, the offset and denominator values for a center pixel block (e.g. b(1,1)) may be computed by multiplying kernel values (i.e. normalized weight values) with eight aligned adjacent pixel blocks (e.g. b(0,0), b(0,1), b(0,2), b(1,0), b(1,2), b(2,0), b(2,1) and b(2,2)). In general, by convolving the offset and denominator values for each pixel block, the offset i,j   conv  and denom i,j   conv  values will not vary drastically between adjacent blocks. 
     It is noted that the mean of the offset values prior to and after performing convolution may not be equal. Thus, in one embodiment, the offset value may be corrected for this difference (step  336 ). Specifically, an offset correction term which is a difference between the means of the pre and post convolution offset values may be computed as defined in Equation 3.10:
 
 oc =mean(offset i,j )−mean(offset i,j   conv )  (3.10)
 
     The correction term oc may then be applied to the offset value by adding it back to the offset convolution values. In this example, the mean of the offset value after correction may equal the mean value of the offset value before convolution as expressed in equation 3.11:
 
 k   i,j =offset i,j   conv   +oc   (3.11)
 
     In step  330 , a gain for each pixel block may also be computed as shown in Equation 3.12:
 
 g   i,j =(2 {tilde over (b)} −1)/denom i,j   conv   (3.12)
 
     Recall that {tilde over (b)} is the output bit depth, thus 2 {tilde over (b)} −1 is the maximum value of the output range. In general, the computed gain may provide a normalization of the data in a domain width e_max i,j   str −e_min i,j   str  to the output range (0,2 {tilde over (b)} −1). 
     In some video signals, frame to frame variation may be a factor. To compensate for any temporal changes in frame to frame variation, it may be beneficial to filter (steps  338  and  332 ) the corrected offset value and gain value for each pixel block. For example, in all frames of video, the values k i,j  and g i,j  may be filtered using an infinite impulse response (IIR) filter controlled by a parameter α. The final values k i,j,t  and g i,j,t  for a frame at time t are defined in Equations 3.16 and 3.17, respectively:
 
 k   i,j,t   iir =α( k   i,j,t-1 )+(1−α)( k   i,j,t )  (3.16)
 
 g   i,j,t   iir =α( g   i,j,t-1 )+(1−α)( g   i,j,t )  (3.17)
 
     Once the gain and offset values are filtered, each pixel is adjusted within the image on a pixel by pixel basis (step  342 ). Unlike the other block wise operations in the flow charts of  FIGS. 3   a  and  3   b , step  422  is a pixel wise operation where the computed gain and offset for each pixel block is applied to each individual pixel. For example, given a gain g and offset k a pixel value p x,y  is remapped to its output (contrast stretched) value {tilde over (p)} x,y  as described in Equation 3.18:
 
 {tilde over (p)}   x,y   =g ( p   x,y   −k )+(2 {tilde over (b)}-1 −1).  (3.18)
 
     In general, the subtraction of the offset value k effectively shifts the mean value of the block to zero. Multiplication by gain value g then stretches the data over a range of 
             ±         2       b   ~     -   1       2     .           
The addition of 2 {tilde over (b)}-1 −1 to the result readjusts the mean of the data to lie at the midpoint of the output dynamic range. This results in block data that has a mean near the midpoint of the output dynamic range and will cover the full output dynamic range[0(2 {tilde over (b)}-1 −1)].
 
     The gain and offset values for each pixel are dependent on the location of the pixel within each block. For example, if a pixel to be stretched is located directly at the center of the pixel block (i.e. at the reference point of the block), then SVDRA algorithm would utilize g=g i,j,t  and k=e_min i,j,t . For all other pixels, however, (not located directly at the pixel block center reference point), SVDRA would form g and k values through an interpolation (e.g. bilinear interpolation) between adjacent pixel blocks (see  FIG. 2   a ). For example, if a pixel p x+Δx,y+Δy  lies interior to four pixel blocks b i,j  located at p x,y ; b i+1,j  located at p x+bw,y ; b i,j+1  located at p x,y+bh  and b i+1,j+1  located at p x+Δx,y+Δy . The gain g x+Δx,y+Δy  to be applied at pixel p x+Δx,y+Δy  is computed using Equation 3.19 
                     g       x   +     Δ   ⁢           ⁢   x       ,     y   +     Δ   ⁢           ⁢   y           =           Δ   ⁢           ⁢   y     bh     ⁡     [           Δ   ⁢           ⁢   x       b   ⁢           ⁢   ω       ⁢     (     g     i   ,   j       )       +       (     1   -       Δ   ⁢           ⁢   x       b   ⁢           ⁢   ω         )     ⁢     (     g       i   +   1     ,   j       )         ]       +       (     1   -       Δ   ⁢           ⁢   y     bh       )     ⁡     [           Δ   ⁢           ⁢   x       b   ⁢           ⁢   ω       ⁢     (     g     i   ,     j   +   1         )       +       (     1   -       Δ   ⁢           ⁢   x       b   ⁢           ⁢   ω         )     ⁢     (     g       i   +   1     ,     j   +   1         )         ]                 (   3.19   )               
Similarly, SVDRA defines the offset k×+Δx,y+Δy according to Equation 3.20:
 
     
       
         
           
             
               
                 
                   
                     k 
                     
                       
                         x 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           x 
                         
                       
                       , 
                       
                         y 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           y 
                         
                       
                     
                   
                   = 
                   
                     
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           y 
                         
                         bh 
                       
                       ⁡ 
                       
                         [ 
                         
                           
                             
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 x 
                               
                               
                                 b 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 ω 
                               
                             
                             ⁢ 
                             
                               ( 
                               
                                 k 
                                 
                                   i 
                                   , 
                                   j 
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                           + 
                           
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   
                                     Δ 
                                     ⁢ 
                                     
                                         
                                     
                                     ⁢ 
                                     x 
                                   
                                   
                                     b 
                                     ⁢ 
                                     
                                         
                                     
                                     ⁢ 
                                     ω 
                                   
                                 
                               
                               ) 
                             
                             ⁢ 
                             
                               ( 
                               
                                 k 
                                 
                                   
                                     i 
                                     + 
                                     1 
                                   
                                   , 
                                   j 
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                         
                         ] 
                       
                     
                     + 
                     
                       
                         ( 
                         
                           1 
                           - 
                           
                             
                               Δ 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               y 
                             
                             bh 
                           
                         
                         ) 
                       
                       ⁡ 
                       
                         [ 
                         
                           
                             
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 x 
                               
                               
                                 b 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 ω 
                               
                             
                             ⁢ 
                             
                               ( 
                               
                                 k 
                                 
                                   i 
                                   , 
                                   
                                     j 
                                     + 
                                     1 
                                   
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                           + 
                           
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   
                                     Δ 
                                     ⁢ 
                                     
                                         
                                     
                                     ⁢ 
                                     x 
                                   
                                   
                                     b 
                                     ⁢ 
                                     
                                         
                                     
                                     ⁢ 
                                     ω 
                                   
                                 
                               
                               ) 
                             
                             ⁢ 
                             
                               ( 
                               
                                 k 
                                 
                                   
                                     i 
                                     + 
                                     1 
                                   
                                   , 
                                   
                                     j 
                                     + 
                                     1 
                                   
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                         
                         ] 
                       
                     
                   
                 
               
               
                 
                   ( 
                   3.20 
                   ) 
                 
               
             
           
         
       
     
     In another example, a pixel which is bounded by two pixel blocks and the outer edge of the image (See  FIG. 2   a ) is handled by a slight modification to these equations: 
     
       
         
           
             
               
                 
                   
                     k 
                     
                       
                         x 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           x 
                         
                       
                       , 
                       
                         y 
                         - 
                         bh 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           y 
                         
                       
                     
                   
                   = 
                   
                     
                       1 
                       
                         b 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         ω 
                       
                     
                     ⁡ 
                     
                       [ 
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             x 
                             ⁡ 
                             
                               ( 
                               
                                 k 
                                 
                                   i 
                                   , 
                                   j 
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             ( 
                             
                               1 
                               - 
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 x 
                               
                             
                             ) 
                           
                           ⁢ 
                           
                             ( 
                             
                               k 
                               
                                 
                                   i 
                                   + 
                                   1 
                                 
                                 , 
                                 j 
                                 , 
                                 t 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   
                     3.21 
                     ⁢ 
                     a 
                   
                   ) 
                 
               
             
             
               
                 
                   
                     k 
                     
                       
                         x 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           x 
                         
                       
                       , 
                       
                         y 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           y 
                         
                       
                     
                   
                   = 
                   
                     
                       1 
                       
                         b 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         ω 
                       
                     
                     ⁡ 
                     
                       [ 
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             x 
                             ⁡ 
                             
                               ( 
                               
                                 k 
                                 
                                   i 
                                   , 
                                   j 
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             ( 
                             
                               1 
                               - 
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 x 
                               
                             
                             ) 
                           
                           ⁢ 
                           
                             ( 
                             
                               k 
                               
                                 
                                   i 
                                   + 
                                   1 
                                 
                                 , 
                                 j 
                                 , 
                                 t 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   
                     3.21 
                     ⁢ 
                     b 
                   
                   ) 
                 
               
             
             
               
                 
                   
                     k 
                     
                       
                         x 
                         - 
                         
                           b 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           ω 
                         
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           x 
                         
                       
                       , 
                       
                         y 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           y 
                         
                       
                     
                   
                   = 
                   
                     
                       1 
                       bh 
                     
                     ⁡ 
                     
                       [ 
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             y 
                             ⁡ 
                             
                               ( 
                               
                                 k 
                                 
                                   i 
                                   , 
                                   j 
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             ( 
                             
                               1 
                               - 
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 y 
                               
                             
                             ) 
                           
                           ⁢ 
                           
                             ( 
                             
                               k 
                               
                                 i 
                                 , 
                                 
                                   j 
                                   + 
                                   1 
                                 
                                 , 
                                 t 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   
                     3.21 
                     ⁢ 
                     c 
                   
                   ) 
                 
               
             
             
               
                 
                   
                     k 
                     
                       
                         x 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           x 
                         
                       
                       , 
                       
                         y 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           y 
                         
                       
                     
                   
                   = 
                   
                     
                       1 
                       bh 
                     
                     ⁡ 
                     
                       [ 
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             y 
                             ⁡ 
                             
                               ( 
                               
                                 k 
                                 
                                   i 
                                   , 
                                   j 
                                   , 
                                   t 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             ( 
                             
                               1 
                               - 
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 y 
                               
                             
                             ) 
                           
                           ⁢ 
                           
                             ( 
                             
                               k 
                               
                                 i 
                                 , 
                                 
                                   j 
                                   + 
                                   1 
                                 
                                 , 
                                 t 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   
                     3.21 
                     ⁢ 
                     d 
                   
                   ) 
                 
               
             
           
         
       
     
     The output pixel {tilde over (p)} x+Δx,y+Δy  value is then computed using the inte&#39;rpolated gain and offset values as Equation 3.22:
 
 {tilde over (p)}   x+Δx,y+Δy   =g   x+Δx,y+Δy ( p   x+Δx,y+Δy   −k   x+Δx,y+Δy )+(2 {tilde over (b)}-1 −1)  (3.22)
 
     Although the invention is illustrated and described herein with reference to specific embodiments, the invention is not intended to be limited to the details shown. Rather, various modifications may be made in the details within the scope and range of equivalence of the claims and without departing from the invention.