Computer Vision Week 2 - 2
plot_im_hist(pow(img_gray, 1.0./1.1))
c) Using histogram to stretch the gray scale:
We can use a tailored curve from input to output to make the output have a flat histogram: that is, with about the same number of pixels at each gray level. This gives high visibiity for most of the detail in the image. In Matlab, histeq does this.
• Why Histogram Equlisation?
- It doesn't necessarily make better looking photos, but it improves the global contrast.
- This means that more details may become visible in the image.
- It doesn't discriminate between image noise and true signal, so it could have adverse effects.
- The operation is invertible so the original values are recoverable.
- It's not used that much in deep learning based vision systems, but still is used as a pre-processing step for many systems.
d) Thresholding: a very non-linear operation
Thresholding compares the gl at each pixel with a number called the threshold. If the gl is greater than the threshold, the corresponding pixel in the output is set to 1; otherwise, it is set to 0. We might choose the threshold by looking at the histogram.
Thresholding is often most useful when applied to the output of some other image processing operation, rather than directly to the original image.
- The ratio between the highest and lowest values that can be described.
- In photography, this corresponds to the range of luminance visible in the image.
- Typically, we are interested in detail within the middle range of luminance, and can compress shadows and highlights.
- By playing with more localised contrast controls, we can create the appearance of high dynamic range on screens and printed images.