Capturing light and color

Similar documents
Capturing Light in man and machine

Capturing Light in man and machine

Motion illusion, rotating snakes

Oversubscription. Sorry, not fixed yet. We ll let you know as soon as we can.

Waitlist. We ll let you know as soon as we can. Biggest issue is TAs

Capturing Light in man and machine

Capturing Light in man and machine

Capturing Light in man and machine. Some figures from Steve Seitz, Steve Palmer, Paul Debevec, and Gonzalez et al.

Capturing Light in man and machine

CMPSCI 670: Computer Vision! Color. University of Massachusetts, Amherst September 15, 2014 Instructor: Subhransu Maji

Overview. Pinhole camera model Projective geometry Vanishing points and lines Projection matrix Cameras with Lenses Color Digital image

Frequencies and Color

Light and Color. Computer Vision Jia-Bin Huang, Virginia Tech. Empire of Light, 1950 by Rene Magritte

Color. Phillip Otto Runge ( )

Today. Color. Color and light. Color and light. Electromagnetic spectrum 2/7/2011. CS376 Lecture 6: Color 1. What is color?

Unit 1: Image Formation

Histograms and Color Balancing

CSCI 1290: Comp Photo

CS 1699: Intro to Computer Vision. Color. Prof. Adriana Kovashka University of Pittsburgh September 22, 2015

Color. April 16 th, Yong Jae Lee UC Davis

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Color April 16 th, 2015

Lecture: Color. Juan Carlos Niebles and Ranjay Krishna Stanford AI Lab. Lecture 1 - Stanford University

Proj 2. Looks like the evaluation function changed in converting to Python, and 80% on Notre Dame is more tricky to reach.

Reading. 1. Visual perception. Outline. Forming an image. Optional: Glassner, Principles of Digital Image Synthesis, sections

Vision and Color. Reading. Optics, cont d. Lenses. d d f. Brian Curless CSE 557 Autumn Good resources:

Vision and Color. Brian Curless CSE 557 Autumn 2015

Vision and Color. Reading. The lensmaker s formula. Lenses. Brian Curless CSEP 557 Autumn Good resources:

Announcements. Color. Last time. Today: Color. Color and light. Review questions

Vision and Color. Reading. Optics, cont d. Lenses. d d f. Brian Curless CSEP 557 Fall Good resources:

Vision and Color. Brian Curless CSEP 557 Fall 2016

Cameras. CSE 455, Winter 2010 January 25, 2010

Reading. Lenses, cont d. Lenses. Vision and color. d d f. Good resources: Glassner, Principles of Digital Image Synthesis, pp

Projection. Announcements. Müller-Lyer Illusion. Image formation. Readings Nalwa 2.1

CSE 527: Introduction to Computer Vision

CS6670: Computer Vision

DIGITAL IMAGE PROCESSING

General Imaging System

Lecture 2: Color, Filtering & Edges. Slides: S. Lazebnik, S. Seitz, W. Freeman, F. Durand, D. Forsyth, D. Lowe, B. Wandell, S.Palmer, K.

Visual Perception. Readings and References. Forming an image. Pinhole camera. Readings. Other References. CSE 457, Autumn 2004 Computer Graphics

Introduction to Visual Perception & the EM Spectrum

Review. Introduction to Visual Perception & the EM Spectrum. Overview (1):

Image Formation and Capture

Projection. Readings. Szeliski 2.1. Wednesday, October 23, 13

Digital Image Processing Lec 02 - Image Formation - Color Space

Further reading. 1. Visual perception. Restricting the light. Forming an image. Angel, section 1.4

Vision. The eye. Image formation. Eye defects & corrective lenses. Visual acuity. Colour vision. Lecture 3.5

LENSES. INEL 6088 Computer Vision

Projection. Projection. Image formation. Müller-Lyer Illusion. Readings. Readings. Let s design a camera. Szeliski 2.1. Szeliski 2.

Color. Homework 1 is out. Overview of today. color. Why is color useful 2/11/2008. Due on Mon 25 th Feb. Also start looking at ideas for projects

Wireless Communication

19. Vision and color

IMAGE FORMATION. Light source properties. Sensor characteristics Surface. Surface reflectance properties. Optics

Image and Multidimensional Signal Processing

Building a Real Camera. Slides Credit: Svetlana Lazebnik

CS6670: Computer Vision

Mahdi Amiri. March Sharif University of Technology

The Human Visual System. Lecture 1. The Human Visual System. The Human Eye. The Human Retina. cones. rods. horizontal. bipolar. amacrine.

Digital Image Processing

Color. Some slides are adopted from William T. Freeman

Building a Real Camera

Digital Image Processing

Lecture 2 Digital Image Fundamentals. Lin ZHANG, PhD School of Software Engineering Tongji University Fall 2016

Color. Bilkent University. CS554 Computer Vision Pinar Duygulu

Lecture 8. Human Information Processing (1) CENG 412-Human Factors in Engineering May

Chapter 2: Digital Image Fundamentals. Digital image processing is based on. Mathematical and probabilistic models Human intuition and analysis

CS559: Computer Graphics. Lecture 2: Image Formation in Eyes and Cameras Li Zhang Spring 2008

Vision and color. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Image Processing - Intro. Tamás Szirányi

Dr F. Cuzzolin 1. September 29, 2015

Color Image Processing

Bettina Selig. Centre for Image Analysis. Swedish University of Agricultural Sciences Uppsala University

Cvision 2. António J. R. Neves João Paulo Silva Cunha. Bernardo Cunha. IEETA / Universidade de Aveiro

Color images C1 C2 C3

Color image processing

Color and Color Model. Chap. 12 Intro. to Computer Graphics, Spring 2009, Y. G. Shin

Digital Image Processing COSC 6380/4393

Images. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 38

Digital Image Processing. Lecture # 8 Color Processing

Multimedia Systems Color Space Mahdi Amiri March 2012 Sharif University of Technology

VC 14/15 TP2 Image Formation

IFT3355: Infographie Couleur. Victor Ostromoukhov, Pierre Poulin Dép. I.R.O. Université de Montréal

Color and perception Christian Miller CS Fall 2011

Visual Imaging and the Electronic Age Color Science

Human Vision, Color and Basic Image Processing

Prof. Feng Liu. Winter /09/2017

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Announcements. The appearance of colors

Visual Perception. Overview. The Eye. Information Processing by Human Observer

VC 11/12 T2 Image Formation

Digital Imaging Rochester Institute of Technology

VC 16/17 TP2 Image Formation

CS 565 Computer Vision. Nazar Khan PUCIT Lecture 4: Colour

COLOR and the human response to light

Vision 1. Physical Properties of Light. Overview of Topics. Light, Optics, & The Eye Chaudhuri, Chapter 8

Sensors and Sensing Cameras and Camera Calibration

CPSC 4040/6040 Computer Graphics Images. Joshua Levine

LIGHT AND LIGHTING FUNDAMENTALS. Prepared by Engr. John Paul Timola

Image and video processing (EBU723U) Colour Images. Dr. Yi-Zhe Song

Getting light to imager. Capturing Images. Depth and Distance. Ideal Imaging. CS559 Lecture 2 Lights, Cameras, Eyes

Transcription:

Capturing light and color Friday, 10/02/2017 Antonis Argyros e-mail: argyros@csd.uoc.gr Szeliski 2.2, 2.3, 3.1 1

Recap from last lecture Pinhole camera model Perspective projection Focal length and depth/field of view Lenses

Recap - Projection matrix Slide Credit: Saverese R,T j w X k w x i w O w x= K[ R t] X x: Image Coordinates: (u,v,1) K: Intrinsic Matrix (3x3) R: Rotation (3x3) t: Translation (3x1) X: World Coordinates: (X,Y,Z,1)

Adding a lens circle of confusion A lens focuses light onto the film There is a specific distance at which objects are in focus other points project to a circle of confusion in the image Changing the shape of the lens changes this distance

The long trip of light Light source properties Sensor characteristics Exposure Surface shape Optics Surface reflectance properties 5 Slide by L. Fei-Fei

What we will discuss today Geometry Relations between 3D world points and their 2D projections on the image Radiometry The relation of emitted light to the light that reaches the camera Photometry How to measure the light that reaches the camera Digitization The transformation of the spatio-temporally continuous signal to digital representations 6

A photon s life choices Absorption Diffusion Reflection Transparency Refraction Fluorescence Subsurface scattering? λ light source

A photon s life choices Absorption Diffusion Reflection Transparency Refraction Fluorescence Subsurface scattering λ light source

A photon s life choices Absorption Diffuse Reflection Reflection Transparency Refraction Fluorescence Subsurface scattering λ light source

A photon s life choices Absorption Diffusion Specular Reflection Transparency Refraction Fluorescence Subsurface scattering λ light source

A photon s life choices Absorption Diffusion Reflection Transparency Refraction Fluorescence Subsurface scattering λ light source

A photon s life choices Absorption Diffusion Reflection Transparency Refraction Fluorescence Subsurface scattering λ light source

A photon s life choices Absorption Diffusion Reflection Transparency Refraction Fluorescence Subsurface scattering λ 2 λ 1 light source

A photon s life choices Absorption Diffusion Reflection Transparency Refraction Fluorescence Subsurface scattering λ light source

Radiometry What determines the value of an image pixel? Radiance (L): energy carried by a ray Irradiance (E): energy arriving at the sensor Sensor characteristics 15

The journey of the light ray X = E t E d = π 2 cos 4 α 4 z' L Z = f ( E t) Camera response function: the mapping f from irradiance to pixel values 16 Source: S. Seitz, P. Debevec

Lambertian Reflectance In computer vision, surfaces are often assumed to be ideal diffuse reflectors with known dependence on viewing direction. Lambert s law: Viewed brightness does not depend on viewing direction, but it does depend on direction of illumination

What is color? Color is the result of interaction between physical light in the environment and our visual system Color is a psychological property of our visual experiences when we look at objects and lights, not a physical property of those objects or lights (S. Palmer, Vision Science: Photons to Phenomenology) Wassily Kandinsky (1866-1944), Murnau Street with Women, 1908 18

Electromagnetic spectrum Human Luminance Sensitivity Function 19

Beyond the visible spectrum γ - rays Χ - rays UV IR Long radiowaves 20

The Physics of Light: light sources Any source of light can be completely described physically by its spectrum: the amount of energy emitted (per time unit) at each wavelength 400-700 nm. Relative spectral power # Photons (per ms.) 400 500 600 700 Wavelength (nm.) 21 Stephen E. Palmer, 2002

The Physics of Light: light sources Some examples of the spectra of light sources A. Ruby Laser B. Gallium Phosphide Crystal 400 500 600 700 Wavelength (nm.) D. Normal Daylight # Rel. Photons power Rel. # Photons power Wavelength (nm.) 400 500 600 700 C. Tungsten Lightbulb Rel. # Photons power Rel. # Photons power 400 500 600 700 400 500 600 700 22 Stephen E. Palmer, 2002

The Physics of Light: reflectance spectra of surfaces Some examples of the reflectance spectra of surfaces % Light Reflected Red Yellow Blue Purple 400 700 400 700 400 700 Wavelength (nm) 400 700 23 Stephen E. Palmer, 2002

Interaction of light and surfaces Observed color is the result of interaction of light source spectrum with surface reflectance 24

The Eye The human eye is a camera (the best)! Iris - colored annulus with radial muscles Pupil - the hole (aperture) whose size is controlled by the iris Lens - changes shape by using ciliary muscles (to focus on objects at different distances) What s the film? photoreceptor cells (rods and cones) in the retina 25 Slide by Steve Seitz

Two types of light-sensitive receptors Cones cone-shaped less sensitive operate in high light color vision Rods rod-shaped highly sensitive operate at night gray-scale vision cone rod Stephen E. Palmer, 2002

Rod / Cone sensitivity

Density of rods and cones cone pigment molecules Rods and cones are non-uniformly distributed on the retina Rods responsible for intensity, cones responsible for color Fovea - Small region (1 or 2 ) at the center of the visual field containing the highest density of cones (and no rods). Less visual acuity in the periphery rod 28 Slide by Steve Seitz

Standardizing color experience We would like to understand which spectra produce the same color sensation from people under similar viewing conditions Color matching experiments Foundations of Vision, by Brian Wandell, Sinauer Assoc., 1995 29

Color matching experiment 30 Source: W. Freeman

Color matching experiment p 1 p 2 p 3 31 Source: W. Freeman

Color matching experiment p 1 p 2 p 3 32 Source: W. Freeman

Color matching experiment The primary color amounts needed for a match p 1 p 2 p 3 33 Source: W. Freeman

Trichromacy Three numbers seem to be sufficient for encoding color In color matching experiments, most people can match any given light with three primaries Exception: color blindness For the same light and same primaries, most people select the same weights 34

Grassman s Laws If two test lights can be matched with the same set of weights, then they are the same If we mix two test lights, then mixing the matches will match the result: Suppose A = u 1 P 1 + u 2 P 2 + u 3 P 3 and B = v 1 P 1 + v 2 P 2 + v 3 P 3. Then A+B = (u 1 +v 1 ) P 1 + (u 2 +v 2 ) P 2 + (u 3 +v 3 ) P 3. If we scale the test light, then the matches get scaled by the same amount: Suppose A = u 1 P 1 + u 2 P 2 + u 3 P 3. Then ka = (ku 1 ) P 1 + (ku 2 ) P 2 + (ku 3 ) P 3. 35

Color Sensing in Camera (RGB) 3-chip vs. 1-chip: quality vs. cost http://www.cooldictionary.com/words/bayer-filter.wikipedia Slide by Steve Seitz

Practical Color Sensing: Bayer Grid Estimate RGB at G cells from neighboring values Slide by Steve Seitz

Color Image R G B

Images in Matlab Images represented as a matrix Suppose we have a NxM RGB image called im im(1,1,1) = top-left pixel value in R-channel im(y, x, b) = y pixels down, x pixels to right in the b th channel im(n, M, 3) = bottom-right pixel in B-channel imread(filename) returns a uint8 image (values 0 to 255) Convert to double format (values 0 to 1) with im2double row column 0.92 0.93 0.94 0.97 0.62 0.37 0.85 0.97 0.93 0.92 0.99 0.95 0.89 0.82 0.89 0.56 0.31 0.75 0.92 0.81 0.95 0.91 0.89 0.72 0.51 0.55 0.51 0.42 0.57 0.41 0.49 0.91 0.92 0.92 0.93 0.94 0.97 0.62 0.37 0.85 0.97 0.93 0.92 0.99 G 0.96 0.95 0.88 0.94 0.56 0.46 0.91 0.87 0.90 0.97 0.95 0.95 0.89 0.82 0.89 0.56 0.31 0.75 0.92 0.81 0.95 0.91 0.71 0.81 0.81 0.87 0.57 0.37 0.80 0.88 0.89 0.79 0.85 0.89 0.72 0.51 0.55 0.51 0.42 0.57 0.41 0.49 0.91 0.92 0.49 0.62 0.60 0.58 0.92 0.50 0.93 0.60 0.94 0.58 0.97 0.50 0.62 0.61 0.37 0.45 0.85 0.33 0.97 0.93 0.92 0.99 0.96 0.95 0.88 0.94 0.56 0.46 0.91 0.87 0.90 0.97 0.95 0.86 0.84 0.74 0.58 0.95 0.51 0.89 0.39 0.82 0.73 0.89 0.92 0.56 0.91 0.31 0.49 0.75 0.74 0.92 0.81 0.95 0.91 0.71 0.81 0.81 0.87 0.57 0.37 0.80 0.88 0.89 0.79 0.85 0.96 0.67 0.54 0.85 0.89 0.48 0.72 0.37 0.51 0.88 0.55 0.90 0.51 0.94 0.42 0.82 0.57 0.93 0.41 0.49 0.91 0.92 0.49 0.62 0.60 0.58 0.50 0.60 0.58 0.50 0.61 0.45 0.33 0.69 0.49 0.56 0.66 0.96 0.43 0.95 0.42 0.88 0.77 0.94 0.73 0.56 0.71 0.46 0.90 0.91 0.99 0.87 0.90 0.97 0.95 0.86 0.84 0.74 0.58 0.51 0.39 0.73 0.92 0.91 0.49 0.74 0.79 0.73 0.90 0.67 0.71 0.33 0.81 0.61 0.81 0.69 0.87 0.79 0.57 0.73 0.37 0.93 0.80 0.97 0.88 0.89 0.79 0.85 0.96 0.67 0.54 0.85 0.48 0.37 0.88 0.90 0.94 0.82 0.93 0.91 0.94 0.89 0.49 0.49 0.41 0.62 0.78 0.60 0.78 0.58 0.77 0.50 0.89 0.60 0.99 0.58 0.93 0.50 0.61 0.45 0.33 0.69 0.49 0.56 0.66 0.43 0.42 0.77 0.73 0.71 0.90 0.99 0.86 0.84 0.74 0.58 0.51 0.39 0.73 0.92 0.91 0.49 0.74 0.79 0.73 0.90 0.67 0.33 0.61 0.69 0.79 0.73 0.93 0.97 0.96 0.67 0.54 0.85 0.48 0.37 0.88 0.90 0.94 0.82 0.93 0.91 0.94 0.89 0.49 0.41 0.78 0.78 0.77 0.89 0.99 0.93 0.69 0.49 0.56 0.66 0.43 0.42 0.77 0.73 0.71 0.90 0.99 0.79 0.73 0.90 0.67 0.33 0.61 0.69 0.79 0.73 0.93 0.97 0.91 0.94 0.89 0.49 0.41 0.78 0.78 0.77 0.89 0.99 0.93 R B

Color spaces How can we represent color? http://en.wikipedia.org/wiki/file:rgb_illumination.jpg

Color spaces: RGB Default color space 0,1,0 R (G=0,B=0) 1,0,0 0,0,1 G (R=0,B=0) Drawback: Non-perceptual: a change of the same amount in a color value, does not produce a change of about the same visual importance. B (R=0,G=0) Image from: http://en.wikipedia.org/wiki/file:rgb_color_solid_cube.png

Color spaces: HSV Intuitive color space H (S=1,V=1) S (H=1,V=1) V (H=1,S=0)

Color spaces: YCbCr Y=0 Y=0.5 Y (Cb=0.5,Cr=0.5) Cr Cb Y=1 Cb (Y=0.5,Cr=0.5) Cr (Y=0.5,Cb=05)

Color spaces: L*a*b* L (a=0,b=0) a (L=65,b=0) b (L=65,a=0)

If you had to choose, would you rather go without luminance or chrominance?

If you had to choose, would you rather go without luminance or chrominance?

Most information in intensity Only color shown constant intensity

Most information in intensity Only intensity shown constant color

Most information in intensity Original image

Lightness constancy http://web.mit.edu/persci/people/adelson/checkershadow_illusion.html 50

Lightness constancy http://web.mit.edu/persci/people/adelson/checkershadow_illusion.html 51

Chromatic adaptation The visual system changes its sensitivity depending on the luminances prevailing in the visual field Adapting to different brightness levels Changing the size of the iris opening (i.e., the aperture) changes the amount of light that can enter the eye Think of walking into a building from full sunshine Adapting to different color temperature The receptive cells on the retina change their sensitivity For example: if there is an increased amount of red light, the cells receptive to red decrease their sensitivity until the scene looks white again http://www.schorsch.com/kbase/glossary/adaptation.html 52

Name that color Πράσινο Κόκκινο Μπλέ Κίτρινο Πράσινο Κόκκινο Πορτοκαλί Μώβ Καφέ Κίτρινο Μαύρο 53

Digital camera A digital camera replaces film with a sensor array Each cell in the array is light-sensitive diode that converts photons to electrons Two common types Charge Coupled Device (CCD) Complementary metal oxide semiconductor (CMOS) http://electronics.howstuffworks.com/digital-camera.htm 54 Slide by Steve Seitz

Digitization Let s digitize this image We will assume a square sampling grid We will be varying the sampling density 55

Digitization A sample per red point Sampling interval Coarse sampling: 14 lines, 20 points / line Denser sampling: 68 lines, 100 points/line 56

Consequences of the sampling interval/rate Look at the fence Sampling interval White image! Grey image! 100 100 100 100 100 100 40 40 40 40 40 40 100 100 100 100 100 100 40 40 40 40 40 40 100 100 100 100 100 100 40 40 40 40 40 40 100 100 100 100 100 100 40 40 40 40 40 40 57

Consequences of the sampling interval/rate Look at the fence Sampling interval 40 100 40 100 40 40 100 40 100 40 40 100 40 100 40 Now the fence is visible! 40 100 40 100 40 58

Consequences of the sampling interval/rate Look at the repetitive pattern on the fence: Sampling intervals s' d s Case 1: s' = d Sampling interval equal to the period of the repetitive pattern Invisible fence Case 2: s = d/2 Sampling interval equal to half the period of the repetitive pattern Visible fence 59

Sampling theorem If the width of the thinnest structure is d, then the sampling interval should be at smaller than d/2 The repetitive pattern has a certain frequency. To maintain this frequency, sampling must be done with at least double this frequency (Nyquist rate) 60

Sampling Basic idea, in theory 23 Digitized image Continuous signal Dirac Delta Function 2D "Comb" δ(x,y) = 0 for x ǂ 0, y ǂ 0 s δ(x,y) dx dy = 1 f(x,y)δ(x-a,y-b) dx dy = f(a,b) 61

Sampling Basic idea, in practice... The ideal situation is not feasible in practice A sample corresponds to a region that has a certain area The value of a sample depends on the value of the continuous function over this area 23 s 62

as a result. The mixed pixel problem 63

Remember: Color sensing in camera: Color filter array Bayer grid Estimate missing components from neighboring values (demosaicing) 64 Source: Steve Seitz

Problem with demosaicing: color moire 65

Signal quantization Goal: Ok, we saw where to sample, what about the actual value measured at each sample? I(x,y) =.1583 volts =???? Digital value? 66

Quantization I(x,y) = continuous signal 0 I(x,y) M We need to quantize it in K levels/values 0,1,...K-1 K is usually a power of 2: K #Bits 2 1 4 2 8 3 16 4 32 5 64 6 128 7 256 8 We need to define the mapping between the (analog) input signal to the (digital) output signal. Several such mappings (linear, logarithmic, etc) 67

E.g., linear mapping uantization Level K-1 3 2 1 0 0 Signal Value M 68

Selection of K Continuous signal K=2 K=4 K=16 K=32 69

Selection of K K=2 (for each basic color) K=4 (for each basic color) 70

Loss during spatial sampling

Loss during quantization

Image histogram H The histogram of an image represents the number of pixels having a particular intensity / gray value 8 Pixel Count 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 Image M x N I max i= I min H ( i) = MN Gray Value 73

Image histogram & image content 1241 0 256 1693 0 256 74

Image histogram vs image properties Dark image Bright image Low contrast High contrast 75

Point processing An image processing operator defines an operator that, when applied at an input image f results in a new image g. The simplest of such operators are those that processing is independent of position in the image Such operators are called point processing operators 76

Point processing O = T(I) T 255 Output O 0 255 Input I 77

Point processing 1 1 1 0.5 0.5 0.5 0 0 0.5 1 4000 4000 0 0 0.5 1 4000 0 0 0.5 1 2000 2000 2000 0 0 100 200 0 0 0.5 1 0 0 0.5 1 78

Point processing 255 Output 0 Input 255 79

Contrast stretching 80

Point processing O = I γ γ < 1 : increase contrast in dark regions γ > 1 : increase contrast in bright regions 1 γ<1 0.5 γ=1 γ>1 0 0 0.5 1 81

γ=0.5 1 0.5 0 0 0.5 1 82

γ=3.0 1 0.5 4000 3500 3000 2500 2000 1500 1000 500 0 0 50 100 150 200 250 0 0 0.5 1 4000 3500 3000 2500 2000 1500 1000 500 0 83 0 50 100 150 200 250

Some basic types 84

Image negative 85