Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I...

27
Histograms – Chapter 4

Transcript of Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I...

Page 1: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Histograms – Chapter 4

Page 2: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Huh?

• That image is too contrasty.

• The colors aren’t vibrant enough.

• I want the reds to pop.

• It doesn’t have a warm enough feel.

• etc. etc. etc.

• The industry is rife with such statements that no one really knows how to interpret consistently

Page 3: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Some examples

Page 4: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Some examples

Page 5: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

The goal

• We know when a picture “looks” good• We know when a picture “looks” bad

– But this is purely subjective

• Sometimes we know what the reality is– But sometimes one person’s reality is different

than another’s

• Sometimes we have no idea what reality is– The scene we photographed is long gone

• We need a way to quantify our findings

Page 6: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Statistics…

• Figures often beguile me, particularly when I have the arranging of them myself; in which case the remark attributed to Disraeli would often apply with justice and force: "There are three kinds of lies: lies, damned lies and statistics." – Mark Twain

Page 7: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Statistics

• Statistics can tell us a lot about an image– Quality of exposure– Image manipulations– Compression/quantization

Page 8: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Statistics

• But if we compute the statistics in the “usual way” all we get is a bunch more numbers to look at– Min– Max– Mean– Mode– Skew– Standard deviation– etc.

• A picture is worth a thousand words (or number in this case)

Page 9: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Histogram

• Pictorial depiction of image statistics

Page 10: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Histogram

• The pixels within an image are arranged in a spatially coherent manner– What does that mean?

• Their position in the image matters

• A histogram is a frequency distribution of the pixel values within an image– What does that mean?

• It depicts the number of times a particular pixel value occurs in the image

Page 11: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Histogram

• Mathematically speaking…

• In words: h(i) is the number of pixels in the image I who’s value is i

• It will contain an array of values, 1 for each possible pixel value K

}),(|),{()( ivuIvucardih

Ki 0

Page 12: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Histogram

• The histogram does not contain any spatial information whatsoever!– Can you reconstruct the original image

from the histogram?• No, just like if I give you a bunch of statistics

you can’t recreate the original dataset!

Page 13: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

What can you do with a histogram?• Image Acquisition – exposure

• Where the concentration of pixel values lie within the histogram

• Laymen’s (subjective) terms: how bright or dark is the image

Page 14: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Under exposed

Page 15: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Over exposed

Page 16: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Properly exposed

Page 17: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

What can you do with a histogram?• Image acquisition – contrast

• How much of the pixel value range is effectively used – Note that “effectively” is yet another

subjective term

• Laymen’s (subjective) term: how foggy is the image

Page 18: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Low contrast

Page 19: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

High contrast

Page 20: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

“Good” (normal?) contrast

Page 21: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

What can you do with a histogram?• Image acquisition – dynamic range• The number of distinct pixel values in the

image• Often times this dynamic range will consider

how much “noise” (unstructured, unwanted, unintended, modifications of the pixel values) as part of the definition

• Laymen’s (subjective) term: how posterized or contoured is the image

Page 22: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Very, very low dynamic range

Page 23: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Low dynamic range

Page 24: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

High dynamic range

Page 25: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

A test image

Page 26: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

Test image

• Exposure?

• Contrast?

• Dynamic range?

Page 27: Histograms – Chapter 4. Huh? That image is too contrasty. The colors aren’t vibrant enough. I want the reds to pop. It doesn’t have a warm enough feel.

ImageJ

• Open snake.png (download from my web site)• Select Analyze/Histogram

– This is the histogram of the luminance channel of the color image

• Select Image/Color/Split Channels– You now have the red/green/blue channels individually

• Create histograms of each of these• Comment on exposure, contrast, dynamic range• Pull other images from wherever, play with it