Chapter 2: Image processing and computer vision Camera models and parameters Ch2. Cameras v0.b2
Chapter 2: Image processing and computer vision Camera models and parameters Ch2. Cameras v.0.b2 1
Will Learn these in this chapter Mathematical model of a camera Intrinsic(static)parameters of a camera(Mint3x3 Focal length(f) for fixed focal length, non-zoomed cameras Image center(Ox, Oy) Pixel width/height(Sx, Sy) Extrinsic(dynamic) parameters of a camera ext 3 Rotation(R)and Translation (T) of a camera Characteristics of r and t Image formation and projection matrix P3x4 Ch2. Cameras v0.b2
Will Learn these in this chapter Mathematical model of a camera Intrinsic (static) parameters of a camera (Mint3x3) • Focal length (f) for fixed focal length, non-zoomed cameras • Image center (Ox,Oy) • Pixel width/height (Sx,Sy) Extrinsic (dynamic) parameters of a camera (Mext3x4) Rotation (R) and Translation (T) of a camera Characteristics of R and T Image formation and projection matrix P3x4 Ch2. Cameras v.0.b2 2
Motivations Digital cameras are everywhere Develop applications for cameras Help to choose a good camera Ch2. Cameras v0.b2
Motivations • Digital cameras are everywhere. • Develop applications for cameras. • Help to choose a good camera. Ch2. Cameras v.0.b2 3
Camera model) Intrinsic parameters I extrinsic parameters I projection Bd to 2D projection http://upload.wikimediaorg/wikipedia/en/8/81/pinhole-camera.png Pinhole Camera Perspective model U=F* X/Z V=F*Y/Z Screen or ccd World https:lenswikipediaorg/wiki/charge-couplEddevicecenter sensor Y V 素v Screen Or Thin lens CCD Ch2. Cameras v0.b2 or a pin hole sensor
Camera model | Intrinsic parameters | extrinsic parameters | projection 3D to 2D projection Perspective model u=F*X/Z v=F*Y/Z F Z Y v World center F Thin lens or a pin hole Virtual Screen or CCD https://en.wikipedia.org/wiki/Charge-coupled_device sensor Real Screen Or CCD sensor Pinhole Camera http://upload.wikimedia.org/wikipedia/en/8/81/Pinhole-camera.png v Ch2. Cameras v.0.b2 4
Camera model) Intrinsic parameters I extrinsic parameters I projection Perspective World Coordinates Projective Modelmat t=l On=10.0.0 (World center) (,Y, Z) V-aXIs image R Yc-axis Camera u Coordinates Zc-axis Principal axis≤- 0,0,0) c(Image center(Camera center) u-aXIs length C-aXIs Ch2. Cameras v0.b2
Camera model | Intrinsic parameters | extrinsic parameters | projection Perspective Projective • Model M at t=1 c (Image center, ox ,oy ) F=focal length image Oc=(0,0,0) (Camera center) Yc-axis Zc-axis Xc-axis v-axis u-axis (X,Y,Z) (u,v) Camera Coordinates. World Coordinates Z Yw w Xw Rc , Tc Principal axis OW=(0,0,0) (World center) Ch2. Cameras v.0.b2 5
Camera model) Intrinsic parameters I extrinsic parameters I projection Inspection exercise Explain what are these variables F=( focal length) C=ox, oy Zc= principal axis Ow=Camera center (u, v) image 2-D axes Xc,Yc, Zc)3-D axes Focal length is the length between the lens and the image screen Camera center is the origin of the camera coordinate system Principal axis is the vector perpendicular to the image and intersects with the camera center Image Center is the center the 2d image or the point that the principal axis intersects with the image Ch2. Cameras v.O. b2 6
Camera model | Intrinsic parameters | extrinsic parameters | projection Inspection exercise • Explain what are these variables. – F =(focal length) – C=(ox,oy) – Zc = principal axis – Ow =Camera center – (u,v) image 2-D axes – (Xc,Yc,Zc) 3-D axes • Focal length is the length between the lens and the image (screen) • Camera center is the origin of the camera coordinate system • Principal axis is the vector perpendicular to the image and intersects with the camera center • Image Center is the center the 2D image , or the point that the principal axis intersects with the image Ch2. Cameras v.0.b2 6
Camera model) Intrinsic parameters I extrinsic parameters I projection The most important concept for a camera is the Image formation process 3D Object points Xw YwZw world coordinates Step1 Motion of camera(Rcam=R, Tcam) Camera Coordinates result→Xc,YcZ Step2 Projection of camera(F Result> image(x,y) Ch2. Cameras v0.b2
Camera model | Intrinsic parameters | extrinsic parameters | projection The most important concept for a camera is the image formation process • 3D Object points (Xw,Yw,Zw): world coordinates Step2: Projection of camera (F) Result → image (x,y) Step1: Motion of camera (Rcam=Rc -1 ,Tcam) Camera Coordinates result → Xc ,Yc ,Zc Ch2. Cameras v.0.b2 7
Camera model) Intrinsic parameters I extrinsic parameters I projection Step1 Motion of camera (Rcam Tcam)Camera Coordinates result→XCYC,ZC Positive rotation angle about an axis: The thumb is pointing to the axis direction, a positive Camera coordinates rotation angle is the same direction as the other fingers (R) Thumb cam pointing and t cam Axis C direction Yw eh Right hand coordinates world coordinates) W Ch2 Came
Camera model | Intrinsic parameters | extrinsic parameters | projection Step1 Motion of camera (Rcam,Tcam) Camera Coordinates result → Xc,Yc,Zc Yc Zc Xc Xw Zw Yw Rcam=(Rc) -1 , and Tcam=Tc Right-hand coordinates (world coordinates) Positive rotation angle about an axis: The thumb is pointing to the axis direction, a positive rotation angle is the same direction as the other fingers. Thumb pointing Axis direction y x Camera coordinates z Ch2. Cameras v.0.b2 8
Camera model) Intrinsic parameters I extrinsic parameters I projection Rotation notations: Roll pitch yaw in aviation systems They are the same systems- you will see it if you turn the plane up side down). It is called the right hand system http://www.grcnasagov/www/k-12/aIrplanE/rotaTions.html Xw(Pitch angle Center of Pitch Axis pitch Roll Axis/V Yw +Yaw Yaw Axis Zw(Roll angle)V Right-hand coordinates Yw (Yaw angle)
Camera model | Intrinsic parameters | extrinsic parameters | projection Rotation notations: Roll pitch yaw in aviation systems They are the same systems– (you will see it if you turn the plane up side down). It is called the Right hand system. • Xw Right-hand coordinates Yw (Yaw angle) Zw (Roll angle) Xw (Pitch angle) http://www.grc.nasa.gov/WWW/k-12/airplane/rotations.html Zw Yw y x z Ch2. Cameras v.0.b2 9
Camera model Intrinsic parameters extrinsic parameters projection A revision of basic matrix operations in case%matlab you forgot them A=[138 62-9 1075] a=d e f=6 9 LB B=[210 1075 p q 346 7-2-1 g 346 A'=A=transpose of A=b e h=327 A AB note: transposition means rows become columns and columns become rows A+B A*B=d*j+e*m+f*pd*k+e*n+∫*qd*1+e·0+f*r Answer:>> gj+h'm+ip g'k+h'n+ig 81+h*0+i*r a= 138T210 1*2+3*7+8*31*1+3°(-2)+8*41*0+3*(-1)+8*6 1610 62-97-2-1=6*2+2*7+(-9)*36*1+2*(-2)+(-9)*46*0+2*(-1)+(-9)*6 327 10751346」L10*2+7*7+5*310+1+7*(-2)+5*410°*0+7*(-1)+5*6 8-95 472745 A*B= 472745 1-34-56 1+23+18+01348 841623 A+B=6+72 A+B= 10+37+45+6131111 348 130-10 If r a 3 x 3 rotation matrix, RT=R- andR*R=R*R=1=0 1 0 131111 Ch2. cameras v0.b2 10
Camera model | Intrinsic parameters | extrinsic parameters | projection A revision of basic matrix operations in case you forgot them = = = = = − + + + + − − − + + + + = = − + + + − + + − + + + − + − + − + − + − + + + − + + − + = − − = − + + + + + + + + + + + + + + + + + + = − = = = = = − − = = − = − − 0 0 1 0 1 0 1 0 0 If is a 3 3 rotation matrix, , and * * 13 11 11 13 0 10 3 4 8 10 3 7 4 5 6 6 7 2 2 9 1 1 2 3 1 8 0 84 16 23 1 - 34 - 56 47 27 45 10*2 7*7 5*3 10*1 7*( 2) 5*4 10*0 7*( 1) 5*6 6*2 2*7 ( 9) *3 6*1 2*( 2) ( 9) *4 6*0 2*( 1) ( 9) *6 1*2 3*7 8*3 1*1 3*( 2) 8*4 1*0 3*( 1) 8*6 3 4 6 7 2 1 2 1 0 10 7 5 6 2 9 1 3 8 * * * * * * * * * * * * * * * * * * * * * * * * * * * * note : transposition means rows become columns and columns become rows , 8 9 5 3 2 7 1 6 10 transpose of A 3 4 6 7 2 1 2 1 0 , 10 7 5 6 2 9 1 3 8 1 1 ' R R R R R R R I A B g j h m i p g k h n i q g l h o i r d j e m f p d k e n f q d l e o f r a j b m c p a k b n c q a l b o c r A B c f i b e h a d g A A p q r m n o j k l B g h i d e f a b c A T T T %matlab A=[1 3 8 6 2 -9 10 7 5] B=[2 1 0 7 -2 -1 3 4 6] A’ A*B A+B Answer:>> A’= 1 6 10 3 2 7 8 -9 5 A*B= 47 27 45 -1 -34 -56 84 16 23 A+B= 3 4 8 13 0 -10 13 11 11 Ch2. Cameras v.0.b2 10