CS4501: Introduction to Computer Vision Projective Geometry and Light Various slides from previous courses by: D.A. Forsyth (Berkeley / UIUC), I. Kokkinos (Ecole Centrale / UCL). S. Lazebnik (UNC / UIUC), S. Seitz (MSR / Facebook), J. Hays (Brown / Georgia Tech), A. Berg (Stony Brook / UNC), D. Samaras (Stony Brook) . J. M. Frahm (UNC), V. Ordonez (UVA).
Last Class What is a camera? Who invented cameras? Image Formation
Today’s Class • Practical Session on Photography • Camera Parameters • Brief Introduction to Projective Geometry (Computer Graphics) • Light
About the Course CS4501-008: Introduction to Computer Vision • Instructor: Vicente Ordonez • Email: vicente@virginia.edu • Website: http://vicenteordonez.com/vision/ • Class Location: Thornton Hall E316 • Class Times: Monday-Wednesday 2pm - 3:15pm • Piazza: http://piazza.com/virginia/spring2018/cs4501008/home 4
Teaching Assistants + Office Hours Fengyang Zhang Gautam Somappa Siva Sivaraman Wednesday 3:30 to 4:30pm (Rice 436) Tuesday 3pm to 4pm (Rice 340) Monday 4pm to 5pm (Rice 436) Thursday 2pm to 3pm (Rice 340) Thursday 3pm to 4pm (Rice 340) Tuesday 2pm to 3pm (Rice 436)
Cameras
What do you need to make a camera from scratch?
Camera obscura
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) • CMOS • http://electronics.howstuffworks.com/digital-camera.htm Slide by Steve Seitz
Sensor Array CMOS sensor
Digital Camera Pipeline Slide by Steve Seitz
Cameras Nikon D90 Nikon D3300 $1200 $700
How to Shoot Photos in Manual? • Shutter time • Aperture • ISO • Focus / Auto-focus (Yes, you can shoot in manual and also probably should focus in manual)
Small Shutter Time / Speed http://www.photographymad.com/pages/view/shutter-speed-a-beginners-guide
Long Shutter Time
Long Shutter Time
Very Long Shutter Time – 25 seconds https://www.davemorrowphotography.com/shutter-speed-chart
Long Shutter Time? Think of Buying a Tripod Manfrotto Mountaineer Carbon Fiber Tripod $200 Aluminum Tripod $140 Carbon Fiber Tripod $1300
Large vs Small Aperture http://www.pgphotoclub.com/articles/aperture.html
ISO – Should be small ideally https://www.exposureguide.com/iso-sensitivity/
Final Thoughts - Take with grain of salt • Shooting in Automatic, especially in low light conditions will often go the easy route of just increasing the ISO all the way up • Sometimes in low light conditions instead you want to increase the shutter time to compensate the low light, or increase the aperture. (or use Flash) • No shame in using Automatic in a clear day, unless trying to achieve some effect.
Projection: world coordinates à image coordinates . é X ù ê ú = P Y ê ú ê ú Z ë û . . Z f Y V . Camera Center (0, 0, 0) U é ù U = V p ê ú If X = 2, Y = 3, Z = 5, and f = 2 ë û What are U and V?
Projection: world coordinates à image coordinates . é X ù ê ú = P Y ê ú ê ú Z ë û . . Z f Y V . Camera Center (0, 0, 0) U é ù U = V p ê ú f 2 ë û = - U X * = - U 2 * Z 5 f 2 = - V Y * = - V 3 * Z 5
Projection: world coordinates à image coordinates . é X ù ê ú = P Y Optical ê ú Center ê ú Z ë û ( u 0 , v 0 ) . . f Z Y v . Camera Center (t x , t y , t z ) u é u ù = v p ê ú ë û
Homogeneous coordinates Conversion Converting to homogeneous coordinates homogeneous image homogeneous scene coordinates coordinates Converting from homogeneous coordinates
Homogeneous coordinates Invariant to scaling é ù é ù x kx é ù é ù kx x ê ú ê ú = Þ = kw w k y ky ê ú ê ú ê ú ê ú ky y ë û ë û ê ú ê ú kw w w kw ë û ë û Homogeneous Cartesian Coordinates Coordinates Point in Cartesian is ray in Homogeneous
Projection matrix (Word Coordinates to Image Coordinates) R,t j w X k w O w i w x [ ] X x : Image Coordinates: (u,v,1) x = K R t K : Intrinsic Matrix (3x3) R : Rotation (3x3) Intrinsic Camera Properties: K t : Translation (3x1) X : World Coordinates: (X,Y,Z,1) Extrinsic Camera Properties: [R t] Slide Credit: Savarese
Projection matrix X x Intrinsic Assumptions Extrinsic Assumptions • No rotation • Unit aspect ratio • Camera at (0,0,0) • Optical center at (0,0) K • No skew é ù x é ù é ù u f 0 0 0 ê ú [ ] X y ê ú ê ú ê ú x = K I 0 = w v 0 f 0 0 ê ú ê ú ê ú z ê ú ê ú 1 0 0 1 0 ë û ë û ê ú 1 ë û Slide Credit: Savarese
Remove assumption: known optical center Intrinsic Assumptions Extrinsic Assumptions • No rotation • Unit aspect ratio • Camera at (0,0,0) • No skew é ù x é u ù é f 0 u 0 ù ê ú [ ] X 0 y ê ú ê ú x = ê ú K I 0 = w v 0 f v 0 ê ú ê ú 0 ê ú z ê ú ê ú 1 0 0 1 0 ê ú ë û ë û 1 ë û
Remove assumption: square pixels Intrinsic Assumptions Extrinsic Assumptions • No skew • No rotation • Camera at (0,0,0) é ù x a é u ù é 0 u 0 ù ê ú 0 [ ] X y ê ú ê ú ê ú x = = b K I 0 w v 0 v 0 ê ú ê ú 0 ê ú z ê ú ê ú 1 0 0 1 0 ê ú ë û ë û 1 ë û
Remove assumption: non-skewed pixels Intrinsic Assumptions Extrinsic Assumptions • No rotation • Camera at (0,0,0) é ù x a é u ù é s u 0 ù ê ú [ ] X 0 y ê ú ê ú x = ê ú K I 0 = b w v 0 v 0 ê ú ê ú 0 ê ú z ê ú ê ú 1 0 0 1 0 ê ú ë û ë û 1 ë û Note: different books use different notation for parameters
Oriented and Translated Camera R j w X t k w O w i w x
Allow camera translation Intrinsic Assumptions Extrinsic Assumptions • No rotation é ù x a é u ù é 0 u ù é 1 0 0 t ù ê ú [ ] X 0 x y ê ú ê ú ê ú x = ê ú K I t = b w v 0 v 0 1 0 t ê ú ê ú ê ú 0 y ê ú z ê ú ê ú ê ú 1 0 0 1 0 0 1 t ê ú ë û ë û ë û z 1 ë û
Slide Credit: Saverese 3D Rotation of Points Rotation around the coordinate axes, counter-clockwise: é ù 1 0 0 ê ú a = a - a R ( ) 0 cos sin ê ú x ê ú a a 0 sin cos ë û p b b ’ é ù cos 0 sin g ê ú b = R ( ) 0 1 0 ê ú p y y ê ú - b b sin 0 cos ë û g - g é ù cos sin 0 ê ú g = g g R ( ) sin cos 0 ê ú z z ê ú 0 0 1 ë û
Allow camera rotation [ ] X x = K R t é ù x a é u ù é s u ù é r r r t ù ê ú 0 11 12 13 x y ê ú ê ú ê ú ê ú = b w v 0 v r r r t ê ú ê ú ê ú 0 21 22 23 y ê ú z ê ú ê ú ê ú 1 0 0 1 r r r t ê ú ë û ë û ë û 31 32 33 z 1 ë û
Degrees of freedom [ ] X x = K R t 5 6 é ù x a é u ù é s u ù é r r r t ù ê ú 0 11 12 13 x y ê ú ê ú ê ú ê ú = b w v 0 v r r r t ê ú ê ú ê ú 0 21 22 23 y ê ú z ê ú ê ú ê ú 1 0 0 1 r r r t ê ú ë û ë û ë û 31 32 33 z 1 ë û
Things to Remember for Quiz • Pinhole camera model • Focal length in the pinhole camera model • Shutter Time / Aperture / ISO • Homogeneous Coordinates • Extrinsic Camera Properties and Intrinsic Camera Properties • Describe mathematically (and intuitively) the conversion process from World Coordinates to Image Coordinates
Light • What determines the color of a pixel? Figure from Szeliski
BRDF (Bidirectional reflectance distribution function) Slide by Aaron Bobick
BRDF (Bidirectional reflectance distribution function) Slide by Aaron Bobick
Reflection Slide by Aaron Bobick
Reflection Slide by Aaron Bobick
Diffuse Reflection – Lambertian Surface / BRDF Light intensity does • not depend on the outgoing direction. Only incoming. It is independent of • where the viewer stands. Smooth surface, not • glossy. Can think of any examples? Slide by Aaron Bobick
Slide by Aaron Bobick
The other extreme – Only Specular Reflection Slide by Aaron Bobick
Pr Problem in Compute ter Vision: Intrinsic Image Decomposition Given this Extract this Images by Marc Serra
Pr Problem in Computer Vision: Shape from Shading Given this Extract this Images by Aaron Bobick
Same ideas used in Computer Graphics • Ray Tracing • Radiosity • Photon Mapping
Phong Reflection Model Slide by Aaron Bobick
Phong Reflection Model https://en.wikipedia.org/wiki/Phong_reflection_model
Phong Reflection Model - Recap https://en.wikipedia.org/wiki/Phong_reflection_model
Phong Reflection Model - Recap https://en.wikipedia.org/wiki/Phong_reflection_model
Phong Reflection Model - Recap https://en.wikipedia.org/wiki/Phong_reflection_model
Recommend
More recommend