Digital Image Processing Part 2 Contrast processing
Brightness and Contrast Grey scale and histogram of pixel values
Dark and Light Images
Low Contrast To lighten or darken, shift the distribution left or right To increase contrast, stretch the distribution over a wider range
Good Contrast Almost full dynamic range used. Could contrast stretch slightly
Point process contrast
Contrast stretch Histogram towards right so bright Width narrow so low contrast
Contrast stretch result
Contrast stretch limitations Subjective so needs human judgment Best enhancement not always linear May need to do brightness shift first Sometimes need an automated method Can be slow if each point is calculated so use look-up table to speed-up processing
Histogram equalisation Simple image with up to 10 brightness levels Plot histogram
Process Determine the frequency of each pixel level –i.e. distribution as on histogram Determine the cumulative frequency –How many pixels at level n plus all previous levels Determine new mapping function Map old values to new values using the new mapping function
Mapping function
Worked Example LevelFreq Count the number of pixels at each level and create a frequency column
LevelFreqCum Freq Cumulative frequency is the sum of the pixels at the current level and all previous levels
Use formula to create new mapping function LevelFreq Cum FreqF(g)
New Mapping Function
New Pixel Levels LevelFreqCFrqF(g)New Old levels (Level) are converted to new levels (F(g)) New histogram plotted from new distribution (New)
Histogram comparison
New Picture
Does not need human intervention so can be used in systems which need automatic image enhancement Sometimes it makes a good job but not always –It will improve contrast for imaging systems but may not always produce an image which is pleasing to the eye Advantages and Disadvantages