MASTERCLASS

# Image processing

### Lessons

#### Share

#### Transcript

Histogram normalization is a common technique that is used to enhance fine detail within an image.

The cumulative histogram is computed from the image intensity histogram.

Each column in the cumulative histogram is computed as the sum of all the image intensity histogram values up to and including that grey level, and then it is scaled so that the final value is 1.0. And what you will notice with the cumulative histogram is that it is very steep when the input histogram is quite large, and it is fairly flat when the input histogram is quite low.

So we can see here a couple of areas where the cumulative histogram has grown quite quickly.

Now we use the cumulative histogram as a mapping. So for every input value, and these unsigned integer pixel values in the range 0 to 255, I take an input pixel x and I map it through the cumulative histogram and I get the result. So my function of x is a non-linear mapping through the cumulative histogram of the image.

So the result of this on the Mona Lisa image is to enhance a lot of the fine detail. So if we have a look into the background we can see areas where it is fairly dark in the original image and where the histogram normalization has increased the local contrast; made it possible for us to see detail that otherwise we could not see very easily in the input image.

This is another example of a monadic image processing operation.

#### Code

We can bring together what we’ve learnt about histograms and monadic operations to implement a technique called histogram normalization which is great at highlighting fine detail in an image.

### Skill level

MATLAB experience

This content assumes an understanding of high school level mathematics; for example, trigonometry, algebra, calculus, physics (optics) and experience with MATLAB command line and programming, for example workspace, variables, arrays, types, functions and classes.