Many capture device, for example scanners or digital cameras, capture images as a two dimensional array of pixels. Each pixel will have associated intensity values in a predefined color space, for example red, green and blue. The intensity values may be captured using a high bit depth for each color, for example 12 or 16 bits deep. The captured intensity values are typically linearly spaced. When saved as a final image, or displayed on a display screen, the intensity values of each color may be converted to a lower bit depth with a non-linear spacing, for example 8 bits per color. A final image with 8 bits per color (with three colors) may be represented as a 24 bit color image. Mapping the linear high bit depth image (12 or 16 bits per color) into the lower non-linear bit depth image (8 bits per color) is typically done using a gamma correction tone map.
Multi-projector systems often require high-bit depth to prevent contouring in the blend areas (the blends must vary smoothly). This becomes a much more significant issue when correcting black offsets digitally since a discrete digital jump from 0 to 1 does not allow a representation of continuous values in that range. Also, in a display system the “blends” or subframe values are often computed in linear space with high precision (16-bit) and then gamma corrected to 8 non-linear bits.
As shown above, there are many reasons a high bit depth linear image is converted or mapped into a lower bit depth non-linear image. During the mapping process, contouring of the dark areas of the image may occur. Contouring is typically defined as a visual step between two colors or shades.
a is a table showing the intensity values of the high bit depth image in an example embodiment of the invention.
b is a table showing the intensity values of the lower bit depth image in non-linear space and in linear space, in an example embodiment of the invention.
Mapping an image from a high bit depth linear image into a lower bit depth non-linear image can be done over many different bit depth levels. For example mappings may be done from 16 bits (65,536 levels) to 8 bits (256 levels), from 12 bit to 8 bits, from 8 bits to 4 bits, from 4 bits into 2 bits, or the like. When using gamma correction for the mapping, each intensity level in the high bit depth image is first normalized to between 0 and 1. In one embodiment, each color channel is processed independently. Normalization is done by dividing the original intensity value by the largest possible intensity value for the current bit depth. For example if the original intensity value was 50 for an 8 bit image (and the intensity range was from 0-255), the normalized value would be 50/255 or 0.196078. When using gamma compression as the mapping function, the mapped non-linear intensity value (normalized between 0 and 1) is given by equation 1.
Normalized Non-linear Value=(NormalizedValue)̂(1/gamma) Equation 1
In equation 1, the normalized Non-linear intensity value is given by raising the normalized intensity value to one over the gamma value. For a gamma of 2.2, the normalized intensity value would be raised to the power of 1/2.2 or 0.4545. The original intensity value of 50 would yield a normalized mapped value of 0.4812 (0.196078̂0.4545=0.476845). The final intensity value in non-linear space is generated by multiplying the normalized mapped value by the highest intensity level in the mapped non-linear space. For example if the 8 bit value was being mapped into a 4 bit or 16 level value (with an intensity range from 0-15), the final mapped intensity value would be given by multiplying the normalized mapped value by 15, or 0.476845 *15=7.
In one example embodiment of the invention, a dithering step is combined with the mapping step to produce an image that may show less contouring.
At step 402 in
At step 406 a dither pattern is overlaid onto the pixels of the original image in linear space. At step 408 the intensity value at each pixel is snapped to one of the two closest left and right interval boundaries in linear space, based on the original linear intensity value, the left and right interval boundary values (in linear space), and the value of the dither screen at that pixel location. At step 410 the non-linear gamma corrected intensity value for the pixel location is determined.
The following example will help illustrate one example embodiment of the invention. In this example a 4 bit, or 16 level, linear image will be converted into a 2 bit, or 4 level, non-linear image. The 4 bit image has possible intensity values ranging from 0-15. We will use the image shown in
For this example a 2.2 gamma compression will be used.
The next step is to generate the left and right boundary intervals for each high bit depth intensity value. The left and right boundary intervals represent the two closest lower bit depth non-linear intensity values to the current non-linear intensity value. Equations 2 and 3 are used to calculate the left and right boundary intervals respectively.
Left=((integerValue(IntensityVal*MaxIV)/MaxIV) Equation 2
Right=(((integerValue(IntensityVal*MaxIV)−=1)/MaxIV) Equation 3
Where IntensityVal is the normalized high bit depth intensity value in non-liner space, MaxIV is the maximum low bit depth intensity value, and intergerValue is a function that truncates any fractional value (i.e. it converts a floating point value into an integer value). To understand these equations, each part will be discussed.
The first step in equation 1 [integerValue(IntensityVal*MaxIV)] takes the normalized high bit depth intensity value and multiplies it by the maximum quantized low bit depth intensity value. The result is converted from a floating point value into an integer. This converts the normalized high bit depth intensity value into a lower bit depth intensity value. The second step in equation 1 normalizes the lower bit depth value to between zero and one by dividing by the maximum low bit depth intensity value. The calculation for the left boundary interval value in non-linear space for the 4 bit intensity value of 6 is shown below.
Left=((integerValue(0.65935*3))/3)
Left=((integerValue(1.97805))/3)
Left=(1/3)
Left=0.33333
The next step is to translate the left and right non-linear values into linear space. When the mapping between linear and non-linear space has been done using gamma correction, the linear values are calculated by raising the non-linear values to the power of gamma.
In the next step, a dither pattern is overlaid onto the pixels of the original image in linear space. For this application a dither pattern may be a matrix of threshold intensity values, a single threshold intensity value with a pattern for propagating error to other pixels, a single threshold with a pattern of noise addition, or the like. For this example the dither pattern is shown in
In the next step the intensity value at each pixel is snapped to one of the two closest left and right interval boundaries in linear space, based on the original linear intensity value, the left and right interval boundary values in linear space, and the value of the dither screen at that pixel location. The correct left or right interval boundary is selected using equations 4 and 5.
CompVal=IntensityN−left>DitherN*(right−left) Equation 4
SelectedVal=CompVal*right+(1−CompVal)*left Equation 5
Where IntensityN is the original high bit depth linear intensity value for the current pixel normalized to between 0 and 1, left and right are the left and right boundary intervals in linear space for the current intensity value, and Dither is the normalized dither value for the current pixel. CompVal is set to zero when the expression is false and CompVal is set to one when the expression is true. SelectedVal will equal the right value when CompVal is one, and will equal the left value when CompVal is a zero.
Equations 4 and 5 are used to calculate the last two columns in
CompVal=IntensityN−left>DitherN*(right−left)
CompVal=0.20000−0.08919>0.13333*(0.409826−0.08919)
CompVal=0.11081>0.13333*0.32064
CompVal=0.11081>0.04275 is true therefore CompVal is set to one
SelectedVal=CompVal*right+(1−CompVal)*left
SelectedVal=1*0.409826+(1−1)*0.08919
SelectedVal=0.409826
The last step is to map the selected value from the linear space to the non-linear space. This can be done using a lookup table. The lookup table in
Once the selected intensity values have been mapped into the lower bit depth non-linear space, the image can be saved or stored onto a computer readable medium. A computer readable medium can comprise the following: random access memory, read only memory, hard drives, tapes, optical disk drives, non-volatile ram, video ram, and the like. The image can be used in many ways, for example displayed on one or more displays, transferred to other storage devices, or the like.
The method describe above can be executed on a computer system.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/US09/52226 | 7/30/2009 | WO | 00 | 9/22/2011 |