Contrast Enhancement for subjects under Flash For a machine vision application, we take short duration (50uSec) monochrome pictures with IR flash. The images we get are decent quality however the light color subjects (light blue, light green, yellow) are all lost or become less visible. 

We convert these 10 bit images to 8 bit and look at them that way which already contributes to the problem. This is something we can probably solve with a non-linear 10-8 bit companding, so I am not worried about this part. If I look at the images on a display that supports 10 bit I still see them very very weak. My objective is to boost them. 

In the raw data when I look at them, assuming surface average is 800 (pretty white), these light color subjects are 760-780 range, so the info is there but not visible. (A side note, if I take a picture of the same object under normal light with very long exposure time, 1msec, I see all details, so flash is also contributing to the problem). 

What is the best way to gain these lost info back? We still have access to the 10 bit raw image data, what type of algorithm I can use to gain them back.
You can perform tone mapping on the source image and then convert the result to 8 bits.

Global tone mapping

Depends just on pixel values, i.e.

H[x,y] = G(I[x,y])


The output image pixel H[x,y] is just processed input pixel value using tone mapping operator G. This allows making lookup table holding all possible values (i.e. 0 - 1023 in 10-bit images).

Local tone mapping

Works on pixel values and their neighborhood, i.e.

H[x,y] = G(I, x, y)


These operators are more complex in nature, but yield more details in the resulting image.

Conversion

After applying tone mapping, the image can be converted to 8-bits easily:

O[x,y] = H[x,y] &gt;&gt; 2


Where (>> 2) is shift by two bits, or division by 4.

The conversion can be incorporated in tone mapping step, for example and entry for the look-up table in global tone mapping can be defined this way:

g[i] = (log2(i + 1) * 102.3) &gt;&gt; 1


Note that the operator is a log curve adjusted for range of input values to 0-1023. The operator also contains conversion to 8-bits.

Samples

More info on Wikipedia