430 likes | 615 Views
Image Processing IB Paper 8 – Part A. Ognjen Arandjelovi ć http://mi.eng.cam.ac.uk/~oa214/. – Colour –. Why Colour?. Useful for perceptual enhancement of images:. Samples corresponding to a single pixel. Original image. After enhancement. Why Colour?.
E N D
Image ProcessingIB Paper 8 – Part A Ognjen Arandjelovićhttp://mi.eng.cam.ac.uk/~oa214/
Why Colour? Useful for perceptual enhancement of images: Samples corresponding to a single pixel Original image After enhancement
Why Colour? A useful descriptor for tracking of deformable objects in cluttered environments:
CCD Colour Image Acquisition We can think of image processing as a black box that takes an input image and produces an output image. Samples corresponding to a single pixel Red Green Blue Bayer mask
+ RGB Colour Space The RGB is an additive colour model: Red, Green and Blue are combined to produce other colours.
RGB Colour Space It is one of the most frequently used colour models and is particularly attractive as it resembles the workings of the human visual system. The RGB colour model mapped onto a cube Common colours in the RGB colour space
RGB Colour Space Limitations The main limitation of the RGB representation is that apparent luminance is differently affected by different colours: Same R, G, B values Same luminance NB: Human eye is more sensitive to luminance than chrominance (colour)
YUV Color Space The YUV is an additive colour model, obtained by linear transformation of the RGB space, and it consists of: • The luminance component (Y)Indicates the apparent brightness of the colour • Two chrominance components (U and V)Indicate how far from grey the colour is, in the blue and red directions respectively Why these particular differences?
YUV Color Space The linear transformation between RGB and YUV colour spaces can be represented by simple matrix multiplication: RGB coordinates YUV coordinates Note different contributions of R, G and B to the luminance component
YUV Color Space The matrix C is non-singular (i.e. no information is lost in the transformation of coordinates) and the reverse conversion is simply:
YUV Color Space The YUV space can be visualized by looking at the directions of pure Y, U and V vectors in the orthonormal RGB space:
Human Eye Colour Sensitivity Maximal luminance response at ~5 cycles/degree. • Stripe width ~1.8mm at ~1m distance
Human Eye Colour Sensitivity Little luminance response above ~100 cycles/degree. • Stripe width ~0.1mm at ~1m distance • 19” display at 1280 х1024 has pixel size ~0.29mm
Human Eye Colour Sensitivity Little luminance response at low frequencies. • Humans are bad at estimating absolute luminance levels as long as they do not change with time
Human Eye Colour Sensitivity Little luminance response at low frequencies. • Humans are bad at estimating absolute luminance levels as long as they do not change with time
Human Eye Colour Sensitivity These observations are often used in practice in image compression or video signal transmission applications: • U and V can be sampled at lower rate than Y due to their narrower bandwidth • U and V can be quantized more coarsely due to their lower contrast sensitivity
HSV Color Space The HSV representation shares some similar ideas as YUV, but is a non-linear transformation of RGB: • V(alue) is the maximal value of the R, G and BApproximate luminance • S(aturation) is the difference between the maximal and minimal of the R, G and B • H(ue) is a function of the colour of the maximal of R, G, and B, adjusted by the other two
Hue Saturation HSV Color Space Formally, H, S and V components are defined as follows:
Hue Saturation HSV Color Space The HSV space can be visualized as a disc: • Different Hue values form a circle • Saturation (normalized by the Value) is given by the distance from the centre of the disc
Brightness and Contrast Enhancement Images of interest often have poor contrast and/or brightness characteristics:
Luminance Histograms Luminance histogram counts the frequency of occurrence of each possible pixel luminance across an image: There are 1966 pixels with luminance 50.
Histogram Modelling Key idea: can we devise a map of the original pixel intensities so that the resulting histogram is of particular form? What histogram shape should we aim for?
Point-Wise Brightness Correction Each pixel with the intensity i, regardless of the location in the image, is mapped to f(i):
Affine Correction In affine brightness correction, f(i) is a linear function:
Affine Correction – Example Original image Transformed image
Affine Correction – Histograms Affine brightness correction shifts and stretches the luminance histogram: Original histogram Transformed histogram What is the origin of this?
Affine Correction – Clipping Nonlinear effects may be caused by clipping – the resulting pixel luminance must be in the valid range:
Gamma Correction Gamma correction is one of the most used histogram transformation techniques: The gamma value
Gamma Correction – Varying Gamma Varying the gamma values gives a family of possible intensity transformation curves: γ = 0.2 γ = 1.4
Gamma Correction – Varying Gamma What effects do different gamma values have on the appearance of an image? • A small gamma stretches the lower part of the histogram – brings out detail in dark regions of the image γ = 0.2 γ = 1.4
Gamma Correction – Varying Gamma What effects do different gamma values have on the appearance of an image? • A large gamma stretches the higher part of the histogram – brings out detail in bright regions of the image γ = 0.2 γ = 1.4
Gamma Correction – Example Original image Transformed image
Gamma Correction – Histograms With gamma correction, certain parts of the image are stretched and others compressed: Original histogram Transformed histogram
Histogram Equalization In histogram equalization, the original pixel intensities are transformed in such a way that the resulting histogram is flat: How to obtain f(i)?
Cumulative Luminance Distribution Consider the cumulative pixel distribution: Histogram Corresponding cumulative distribution
Cumulative Luminance Distribution From the target cumulative distribution, we can write: Target cumulative distribution Histogram Corresponding cumulative distribution
Histogram Equalization Thus, the algorithm becomes: • Compute original histogram h(i) • From h(i) compute the cumulative distribution c(i) • Map pixels according to:
Histogram Equalization Original image Transformed image
Histogram Equalization Note the following about the result: • The histogram is not flat • In some cases, different original intensities i are mapped to the same f(i) Original histogram Transformed histogram