1 / 26

Histograms – Chapter 4

Histograms – Chapter 4. Continued. ImageJ – from last time…. 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

mistico
Télécharger la présentation

Histograms – Chapter 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Histograms – Chapter 4 Continued

  2. ImageJ – from last time… • 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

  3. Effects of JPEG compression • Original, uncompressed file • 229K bytes • Smooth histogram

  4. Effects of JPEG compression • JPEG compressed file • 33K bytes • Smooth histogram – not much change, image visually lossless

  5. Effects of JPEG compression • JPEG compressed file • 18K bytes • Histogram showing spikes – image starting to blur

  6. Effects of JPEG compression • JPEG compressed file • 12K bytes • Histogram showing spikes – image more blurring

  7. Effects of JPEG compression • JPEG compressed file • 6K bytes • Histogram showing tall spikes – image blocking, color fidelity lost

  8. Effects of JPEG compression • JPEG compressed file • 5K bytes • Histogram showing tall spikes – image blocking, color fidelity lost

  9. Effects of JPEG compression • JPEG compressed file • 3K bytes • Histogram showing tall spikes – image wrecked

  10. Effects of JPEG compression • JPEG compressed file • 3K bytes • Histogram showing tall spikes and gaps – image wrecked

  11. Effects of JPEG compression • JPEG compressed file • 2K bytes • Histogram showing tall spikes and gaps – image, what snake?

  12. ImageJ JPEG • Edit->Options->Input/Output… • Allows you to set level of compression • Smaller number gives more compression at the cost of greater information loss • Larger number retains more information at the cost of less compression

  13. Effects of saturation • Ideally the sensor’s range (detectable light levels from dark to bright) is greater than that of the scene being imaged • Realistically, this doesn’t always happen • The human visual system has incredible dynamic range due to the distribution of rods and cones in the retina • Very difficult to match in silicon

  14. Human visual system • Cones: process color (3 types) • Primarily in the foveal region of the retina • Rods: process shades of gray • Primarily in the peripheral region of the retina

  15. Effects of saturation • Original, looks decent enough • Histogram is smooth, contrast is a little low, exposure a little low, dynamic range a little low

  16. Effects of saturation • We brighten it up by multiplying pixels by some specified values (artificially brighten it to compensate for the sensor deficiencies) • Histogram shows dynamic range is good, contrast is good, but we get spikes and a lot of saturated pixels

  17. Playing detective • When you see stuff like this in the histogram, you know something is awry • If you see spikes, either the imaging device was bad or the image was digitally manipulated • Analog pixels don’t do this • Ditto if you see gaps • If you see a lot of saturation either the photographer screwed up or the image was digitally manipulated (or the scene was too bright for the camera)

  18. Computing histograms • Because you should at least see the code… int Histogram[] = new int[256]; // 8 bit histogram for (int i = 0; i < imageHeight; i++) { for (int j = 0; j < imageWidth; j++) { ++Histogram[image[i][j]]; } }

  19. Computing histograms • There may be times when your histogram is bigger than your memory size • Large bit-depth images • Floating point images • All is not lost, we just resort to binning • In this case a single histogram entry represents a range of pixel values [rather than a single value] • Be careful when reading these as spikes/gaps could be hidden in the representation

  20. Computing histograms • Histograms of color images create another situation to be dealt with • Color images are typically 24-bits • 8-bits each for Red, Green, and Blue • Results in 224 = 16777216 pixel values • Not suitable for direct histogram creation and binning makes not sense – why? • There is not natural ordering of the colors as there is in a gray scale image • Two choices • Display the luminance histogram (the brightness content of the image) • Display the red, green, and blue histograms separately

  21. Color histograms Luminance Red Green Blue

  22. Color histograms • The green histogram will [typically] look similar to the luminance histogram • If the red, green, and blue histograms look similar the image has most likely been white balanced • Two of the channels (e.g. red, and blue) have been enhanced (contrast, dynamic range) to look similar to the third (e.g. green) • This “trick” is performed to make sure that white objects in the scene appear white in the resulting image • Corrects for deficiencies in the imaging device

  23. Color histograms • Another option is to create a three dimensional histogram or scatter plot of the image pixel colors

  24. Cumulative histogram • A bin in the cumulative histogram is the sum of all lower bins of the “normal” histogram • It’s not overly useful for analysis but will provide some needed information for certain image enhancement operations

  25. Cumulative histogram

  26. Cumulative histogram • I’ve placed a plugin for the cumulative histogram on the website • Download it and drop it into the folder • It will show up under the Plugins->Chapter04 menu C:\Program Files\ImageJ\plugins\Chapter04

More Related