1 / 33

CS559: Computer Graphics

CS559: Computer Graphics. Lecture 5: Color and Edge Li Zhang Spring 2008. Today. Eyes Cameras. Represented by a matrix. Image as a discreet function. Color Vision. Three kinds of cones:. Trichromacy. Experiment: Show a target color spectrum beside a user controlled color

fidelina
Download Presentation

CS559: Computer Graphics

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. CS559: Computer Graphics Lecture 5: Color and Edge Li Zhang Spring 2008

  2. Today • Eyes • Cameras

  3. Represented by a matrix Image as a discreet function

  4. Color Vision Three kinds of cones:

  5. Trichromacy • Experiment: • Show a target color spectrum beside a user controlled color • User has knobs that adjust primary sources to set their color • Primary sources are just lights with a fixed spectrum and variable intensity • Ask the user to match the colors – make their light look the same as the target • Experiments show that it is possible to match almost all colors using only three primary sources - the principle of trichromacy • Sometimes, have to add light to the target • In practical terms, this means that if you show someone the right amount of each primary, they will perceive the right color • This was how experimentalists knew there were 3 types of cones © University of Wisconsin, CS559 Spring 2004

  6. Trichromacy For almost any given E_target(λ), we can solve for [r,g,b] so that the displayed color looks indistinguishable from the target color to our eyes.

  7. RGB Cube Cyan (0,1,1) White(1,1,1) Yellow (1,1,0) Green(0,1,0) Blue (0,0,1) Magenta (0,1,1) Red (1,0,0) Black (0,0,0) Demo

  8. Other Color Space • Hue-Saturation-Value (HSV) [Alvy Smith, 1978] • Hue: dominant color component • Saturation: color purity • Value: lightness or brightness • HSV-RGB transformation http://alvyray.com/Papers/hsv2rgb.htm http://www.mandelbrot-dazibao.com/HSV/HSV.htm

  9. Other Color Space • L-A-B • L: luminance • A: position between magenta and green (negative values indicate green while positive values indicate magenta) • B: position between yellow and blue (negative values indicate blue and positive values indicate yellow) http://en.wikipedia.org/wiki/Lab_color_space http://en.wikipedia.org/wiki/CIE_1931_color_space

  10. Spatial resolution and color R G B original

  11. R G B Blurring the G component processed original

  12. R G B Blurring the R component processed original

  13. R G B processed Blurring the B component original

  14. Lab Color Component L A rotation of the color coordinates into directions that are more perceptually meaningful: L: luminance, a: magenta-green, b: blue-yellow a b

  15. L a b processed Bluring L original

  16. L a b processed Bluring a original

  17. L a b processed Bluring b original

  18. Application to image compression • (compression is about hiding differences from the true image where you can’t see them).

  19. Edge Detection • Convert a 2D image into a set of curves • Extracts salient features of the scene • More compact than pixels

  20. How can you tell that a pixel is on an edge?

  21. Edge detection • One of the most important uses of image processing is edge detection: • Really easy for humans • Really difficult for computers • Fundamental in computer vision • Important in many graphics applications

  22. What is an edge? • Q: How might you detect an edge in 1D?

  23. Gradients • The gradient is the 2D equivalent of the derivative: • Properties of the gradient • It’s a vector • Points in the direction of maximum increase of f • Magnitude is rate of increase • How can we approximate the gradient in a discrete image?

  24. Less than ideal edges

  25. Steps in edge detection • Edge detection algorithms typically proceed in three or four steps: • Filtering: cut down on noise • Enhancement: amplify the difference between edges and non-edges • Detection: use a threshold operation • Localization (optional): estimate geometry of edges, which generally pass between pixels

  26. Edge enhancement • A popular gradient magnitude computation is the Sobel operator: • We can then compute the magnitude of the vector (sx, sy).

  27. Results of Sobel edge detection

  28. Canny Edge Detector • Smooth image I with 2D Gaussian: • Find local edge normal directions for each pixel • Along this direction, compute image gradient • Locate edges by finding max gradient magnitude (Non-maximum suppression)

  29. Non-maximum Suppression • Check if pixel is local maximum along gradient direction • requires checking interpolated pixels p and r

  30. The Canny Edge Detector original image (Lena)

  31. The Canny Edge Detector magnitude of the gradient

  32. The Canny Edge Detector After non-maximum suppression

  33. Canny Edge Detector original Canny with Canny with • The choice of depends on desired behavior • large detects large scale edges • small detects fine features

More Related