## Tuesday, July 18, 2006

### LUT filter (histogram equalization and histogram matching)

The process of histogram equalization and histogram matching. Given a LUT with input values a,b,c... and corresponding output values A,B,C.

$$H(I) -> H_N(I) (LUT) -> output$$, where LUT is input

1. Get the histogram; H(I) = # of pixels intensity
2. Calculate normalized sum: $$H_N(I) = \sum _{i=0} ^N H(i) (Max pixel) / (total number of pixel)$$, we use 255 (or 1) for 'Max pixel'.
3. Treat $$H_N(I)$$ as lookup table. Check every input image pixel in the LUT and get the output image.

For example, the look-up table is a matrix:LUT[], now for intput a,b,c... we get the output A,B,C:
A = LUT[a]
B = LUT[b]
C = LUT[c]