Presentation is loading. Please wait.

Presentation is loading. Please wait.

Color. Summary Color is complex The human visual system is complex and very good at processing light Together they comprise a system that we aren’t even.

Similar presentations


Presentation on theme: "Color. Summary Color is complex The human visual system is complex and very good at processing light Together they comprise a system that we aren’t even."— Presentation transcript:

1 Color

2 Summary Color is complex The human visual system is complex and very good at processing light Together they comprise a system that we aren’t even close to understanding but utilize very effectively

3 Other Related Topics And what good talk on color would dare to leave out these topics…

4 The GretagMacBeth TM ColorChecker®

5 The JOBO Card

6 Gamma RGB values from a camera (for instance) are linear RGB values viewed on a monitor are non-linear Gamma correction is a non-linear pre-adjustment of the linear RGB values to match (or meet the expectations of) the non-linear human visual system when viewing a non-linear monitor Implemented as a look-up table 0.01.0 0.0 R’G’B’ RGB

7 Gamma Correction Linear RGB from camera Uncorrected Linear RGB on monitor Corrected Linear RGB from camera Corrected Linear RGB on monitor

8 Alpha In computer graphics, we often speak of 32- bit RGB The additional 8-bits is not another color basis, but rather a value called Alpha Alpha defines how colors combine with one another in an operation called Alpha Blending

9 Alpha Blending In 3D computer graphics objects naturally obscure other objects Depending on the make-up of the object in front –You may not see the object in back, the object in front is opaque –You may only see the object in back, the object in front is translucent –You may see some combination of both objects

10 Alpha Blending The specification of an objects opacity is done through alpha The basic formula is one of linear interpolation The alpha value of the object in back is ignored In the event that we have multiple objects stacked, then the z-buffer rendering performs this calculation in order, back to front

11 Color Space Quantization There are times (used to be times?) when our hardware does not (did not?) support 2 24 (24-bit) colors The alternative is (was?) typically an 256 (8-bit) color palette system –This is what the GIF file format supports The question then arises as to which 256 colors we should choose

12 Scalar Quantization Create 256 uniformly spaced bins Place actual colors into the closest bin Simply put, divide the components (or just drop low order bits) Does not account for non-uniform distribution of colors in a scene (and therefore doesn’t work very well) But it’s easy to implement

13 Color Space Quantization The popularity (populosity) algorithm prescribes that we select the 256 most frequently used colors in the scene we are displaying Create a histogram of all 2 24 possible colors Keep only the top 256

14 Popularity (Populosity) Algorithm COUNT COLOR INDEX Color Frequency Histogram Create color frequency histogram Sort histogram by count Keep the 256 colors with the largest counts Convert all other scene colors to the closest kept color

15 Popularity (Populosity) Algorithm This algorithm works fine for a small amount of original scene colors (relative to the target number of colors) When the number of different colors in the original scene is much greater than the target number, the algorithm breaks down –Especially where small scene objects are concerned

16 Median-Cut Algorithm Rather than just histogram and keep the most popular colors, the median-cut algorithm attempts to find colors that represent equal numbers of colors in the original scene –Map color pixels onto the color cube –Recursively split the cube into smaller cubes, attempting to keep the number of pixels in each cube the same –The procedure ends when n (the target number of colors) cubes are created –The centroids of the cubes are the retained colors –All other pixel colors in each cube are set to the cube centroid color

17 Quantization But what happens when the number of available colors is only 2? (monochrome display device) Popularity and median-cut algorithms won’t produce suitable results in this scenario

18 Threshold If we merely select a threshold and set pixel values below it to black and above it to white we lose a lot of information

19 Threshold The human visual system is so good that we can still see the picture (in our minds) even though the data (taken in by the eyes) is minimal

20 Dither By replacing individual pixels with a pattern of binary values, the human visual system can be fooled into seeing shades The problem with pure thresholding is that all of the error ends up in the pixel being processed With dithering, we attempt do distribute the error to surrounding pixels

21 Floyd-Steinberg Dithering For each pixel display the closest available color compute error = actualColor – displayedColor spread error over (weighted addition) neighboring actual pixels to the right and below 7 * error 16 1 * error 16 5 * error 16 3 * error 16 Current pixel

22 Floyd-Steinberg Dithering Again, the human visual system is so good that we can still see the picture (in our minds) even though the data (taken in by the eyes) is minimal

23 Dithering Other dithering techniques involve replacing pixels with patterns meant to approximate the amount of “ink” (intensity) on the page The downside of these approaches are that the display size is typically larger than the actual image

24 Chromatic Adaptation The human visual system interprets colors as being constant under varying illuminants –White looks white under fluorescent, incandescent, daylight, etc. (well, most of the time) We would like to do this algorithmically –We don’t know exactly how the human visual system achieves this goal

25 Chromatic Adaptation Using the XYZ color space (for whatever it is good for) requires knowledge of the ambient white point –e.g. D50, D65, etc. –This is referred to as relative colorimetry Through some mathematical magic –Given an X 1 Y 1 Z 1 point relative to a specific white point –That point can be converted to an X 2 Y 2 Z 2 point relative to a different white point

26 Chromatic Adaptation Thus, given an image taken under one light source, we can convert it to appear as though it was taken under a different light source This is the process known as Chromatic Adaptation There are various published ways to do this but the most widely used is Bradford Adaptation

27 Bradford Adaptation Bradford Transformation Matrix

28 Color Image Statistics All the obvious stuff –Count the number of unique colors –Count the number of “important” colors –Average red, green, blue –etc. All based on the color histogram

29 Color Histogram Not computationally feasible to create a linear histogram like we did for gray level images –Gray level images: 2 n bins for an n-bit image –For a color image n=24 which 16,777,216 bins So we resort to other forms

30 Color Histogram 3D histogram –Display the distribution as points in a 3D cube –Give the user tools to rotate the cube 2D histogram –2D array where the vertical axis is one color and the horizontal is another Bins represent count of colors with those two component values (third component is a wild card) –Amounts to planar projections of the 3D histogram

31 Color Histogram Neither approach is easy to use Both require the user to develop a sense of what they are looking at Color is hard!

32 Plugins I’ve posted plugins for –Floyd-Steinberg Dither –RGB to HSV –RGB to HLS –RGB to YPbPr –Bradford Chromatic Adaptation Transformation This merely repeat the math on page 290 – it does not do any image manipulations (just wanted to prove that the book didn’t have any errors)

33 [a few selected] References How the Retina Works – Helga Kolb American Scientist, Volume 91 Calculation From the Original Experimental Data of the CIE 1931 RGB Standard Observer Spectral Chromaticity Coordinates and Color Matching Functions – D.A. Broadbent University de Sherbrooke Eye, Brain, and Vision – David H. Hubel Scientific American Library 1988 RGB Coordinates of the Macbeth ColorChecker – Danny Pascale www.babelcolor.com The RGB Code: The Mysteries of Color Revealed – Danny Pascale www.babelcolor.com


Download ppt "Color. Summary Color is complex The human visual system is complex and very good at processing light Together they comprise a system that we aren’t even."

Similar presentations


Ads by Google