Retinex filter

Retinex is an image enhancement with possible application to seismic data and core photograph enhancement. The word is a portmanteau of retina and cortex and reflects the fact that the algorithm attempts to mimic the human pyschovisual system.

The filter enhances local contrast and lightness. This is akin to the aim of High dynamic range imaging. Though aimed at multi-band images, e.g. colour images, it can also be used to enhance monochrome images (e.g. seismic data). The advantage over regular linear or non-linear contrast enhancement is the multi-scale component, which enhances local contrast without sacrificing retaining global tonal quality (that is, generally dark and generally light areas).

Algorithms
The basic multi-scale Retinex for monochrome images is


 * $$ R(x,y) = \sum_{k=1}^K W_k (\log I(x,y)-\log [F_k(x,y) * I(x,y)])$$

where R is the result image, W is a scalar for each scale k, I is the input image, F is a Gaussian filter (or 'surround function') at scale k, and $$*\ $$ is the convolution operator. In turn, F is given by


 * $$ F_k(x,y) = \alpha \, \mathrm{e}^{-(x^2 + y^2)/\sigma^2}$$

Where &alpha; is a normalization factor given by


 * $$ \alpha = \frac{1}{\sum_{x,y} F_k(x,y)} \ $$

There is an implementation of the Retinex filter in the official distribution of GIMP, based on the work of Zia-ur Rahman et al.

I (Matt) asked Professor Rahman about the parameter W; here's what he said:

"Wk does not have to be 1/K but that is what we generally use. It can be changed to any value that you want as long as ?Wk = 1. We chose 1/K for most of our results because it shows the case where each scale has equal weighting and you can see the impact of each scale on the overall quality of the image. You can try different variations depending on your application. For instance you may want to weigh the lowest scale more heavily than the higher scales to bring out more fine detail."

Application to geoscientific data
The filter has possible application to:


 * Low contrast seismic data, especially in timelslices where the scale is more meaningful in terms of pixel dimensions.
 * Certain seismic attributes, like RGB-blended images, which often have rather subtle contrast.
 * Field photographs, especially those taken in hazy conditions.
 * Core photographs, especially of low-contrast facies.