pin hole cameras warp functions
play

Pin Hole Cameras & Warp Functions Instructor - Simon Lucey - PowerPoint PPT Presentation

Pin Hole Cameras & Warp Functions Instructor - Simon Lucey 16-423 - Designing Computer Vision Apps Today Pinhole Camera. Homogenous Coordinates. Planar Warp Functions. Example of SLAM for AR Taken from: H. Liu et al.


  1. Pin Hole Cameras & Warp Functions Instructor - Simon Lucey 16-423 - Designing Computer Vision Apps

  2. Today • Pinhole Camera. • Homogenous Coordinates. • Planar Warp Functions.

  3. Example of SLAM for AR Taken from: H. Liu et al. “Robust Keyframe-based Monocular SLAM for Augmented Reality”, ISMAR 2016.

  4. Example of SLAM for AR Taken from: H. Liu et al. “Robust Keyframe-based Monocular SLAM for Augmented Reality”, ISMAR 2016.

  5. Example of SLAM for AR Taken from: H. Liu et al. “Robust Keyframe-based Monocular SLAM for Augmented Reality”, ISMAR 2016.

  6. Motivation Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  7. Pinhole Camera Taken from: http://img.gawkerassets.com/img/18w7i1umpzoa9jpg/original.jpg

  8. Pinhole Camera Instead model impossible but more convenient Real camera image virtual image is inverted Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  9. Pinhole Camera Terminology Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  10. Normalized Camera By similar triangles: Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  11. Focal length parameters Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  12. Focal length parameters Can model both • the effect of the distance to the focal plane • the density of the receptors with a single focal length paramete r φ In practice, the receptors may not be square: S o use different focal length parameter for x and y dims Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  13. Offset parameters • Current model assumes that pixel (0,0) is where the principal ray strikes the image plane (i.e. the center) • Model offset to center Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  14. Skew parameter • Finally, add skew parameter • Accounts for image plane being not exactly perpendicular to the principal ray Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  15. Radial distortion Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  16. Camera & World Coordinates w “world coordinate frame” o u

  17. Camera & World Coordinates “camera coordinate frame” w 0 w u 0 o 0 “world coordinate frame” o u  u 0 �  ω 1 �  u �  τ x � ω 2 + = w 0 ω 3 ω 4 w τ z

  18. Camera & World Coordinates Rotation Matrix Translation Vector  u 0 �  ω 1 �  u �  τ x � ω 2 + = w 0 ω 3 ω 4 w τ z

  19. Position and orientation of camera • Position w =(u,v,w) T of point in the world is generally not expressed in the frame of reference of the camera. • Transform using 3D transformation or Point in frame of Point in frame of reference of camera reference of world

  20. Constraints on Ω • As is a rotation matrix it is constrained by the following, Ω Ω T Ω = I det( Ω ) = 1 • We refer to these matrices as belonging to the Special Orthogonal Group - SO(3). • How many degrees of freedom do you think has ? Ω

  21. Something to try • In MATLAB type, >> R1 = orth(randn(3,3)); >> R1(:,end) = det(R1)*R1(:,end); >> R2 = orth(randn(3,3)); >> R2(:,end) = det(R2)*R2(:,end); • If you form a new matrix as a linear combination of R1 & R2, >> R3 = 0.5*R1 + 0.5*R2; • Does R3 lie in SO(3) ?

  22. Reminder: Convex Set 18

  23. Reminder: Convex Set 18

  24. Reminder: Convex Set 18

  25. Reminder: Non-Convex Set 19

  26. Reminder: Non-Convex Set 19

  27. Reminder: Non-Convex Set 19

  28. Complete pinhole camera model • Intrinsic parameters (stored as intrinsic matrix) • Extrinsic parameters Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  29. Complete pinhole camera model • For short: • Question: is a linear function? Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  30. Perspective Transform

  31. Learning extrinsic parameters N ˆ X Ω , ˆ τ = min η { x n − pinhole[ w n , Λ , Ω , τ ] } Ω , τ n =1 e.g. η { x } = || x || 2 2 Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  32. Learning intrinsic parameters N ˆ X Λ = min Λ [min η { x n − pinhole[ w n , Λ , Ω , τ ] } ] Ω , τ n =1 e.g. η { x } = || x || 2 2 Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  33. Camera Calibration • Use 3D target with known 3D points. Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  34. For you to try….. • There exists camera calibration tools in MATLAB, • see Bouget’s Calibration Toolbox in MATLAB. • Or if you prefer, • you can use OpenCV’s tutorial. • What are the intrinsics of your device? • How sensitive are vision algorithms to the correct intrinsics?

  35. Today • Pinhole Camera. • Homogenous Coordinates. • Planar Warp Functions.

  36. Homogeneous Coordinates • Convert 2D coordinate to 3D • To convert back Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  37. Geometric interpretation Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  38. Pinhole camera • Camera model: • In homogeneous coordinates: (linear!) Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  39. Pinhole camera • Writing out these three equations • Eliminate λ to retrieve original equations Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  40. Adding in extrinsics Or for short: Or even shorter: Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  41. Today • Pinhole Camera. • Homogenous Coordinates. • Planar Warp Functions.

  42. Planar Warp Functions • Consider viewing a planar scene • There is now a 1 to 1 mapping between points on the plane and points in the image • We will investigate models for this 1 to 1 mapping – Euclidean – Similarity – Affine – Homography

  43. Piecewise planarity Many scenes are not planar, but are nonetheless piecewise planar Can we match all of the planes to one another?

  44. Euclidean warp • Consider viewing a fronto-parallel plane at a fixed distance D. • In homogeneous coordinates, the imaging equations are: Plane at Point is on 3D rotation matrix known plane becomes 2D (in plane) ( w =0) distance D Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  45. Euclidean warp • Simplifying • Rearranging the last equation Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  46. Euclidean warp Homogeneous: Cartesian: For short: Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  47. Euclidean warp Homogeneous: Cartesian: For short: How many unknowns? Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  48. More to read… • Prince et al. • Chapter 14, Section 1 & 3. • Chapter 15, Section 1.

Recommend


More recommend