1Panoramas and Calibration15-463: Rendering and Image ProcessingAlexei Efros…with a lot of slides stolen from Steve Seitz and Rick SzeliskiWhy Mosaic?Are you getting the whole picture?• Compact Camera FOV = 50 x 35°Slide from Brown & Lowe2Why Mosaic?Are you getting the whole picture?• Compact Camera FOV = 50 x 35°• Human FOV = 200 x 135°Slide from Brown & LoweWhy Mosaic?Are you getting the whole picture?• Compact Camera FOV = 50 x 35°• Human FOV = 200 x 135°• Panoramic Mosaic = 360 x 180°Slide from Brown & Lowe3mosaic PPMosaic as Image ReprojectionThe mosaic has a natural interpretation in 3D• The images are reprojected onto a common plane• The mosaic is formed on this plane• Mosaic is a synthetic wide-angle camera• Max FOV?PanoramasWhat if you want a 360° field of view?mosaic Projection Cylinder4• Map 3D point (X,Y,Z) onto cylinderCylindrical projectionXYZunit cylinderunwrapped cylinder• Convert to cylindrical coordinatescylindrical image• Convert to cylindrical image coordinatesCylindrical reprojectionHow to map from a cylinder to a planar image?XYZside viewtop-down viewimage coords• Convert to image coordinates– divide by third coordinate (w)• Apply camera projection matrix– w = image width, h = image height5Cylindrical panoramasSteps• Reproject each image onto a cylinder• Blend • Output the resulting mosaicWhat are the assumptions here?Cylindrical image stitchingWhat if you don’t know the camera rotation?• Solve for the camera rotations– Note that a rotation of the camera is a translation of the cylinder!6Full-view Panorama++++++++Different projections are possible7f = 180 (pixels)Cylindrical reprojectionf = 380f = 280Image 384x300top-down viewFocal length – the dirty secret…What’s your focal length, buddy?Focal length is (highly!) camera dependant• Can get a rough estimate by measuring FOV:• Can use the EXIF data tag (might not give the right thing)• Can use several images together and try to find f that would make them match• Can use a known 3D object and its projection to solve for f• Etc.There are other camera parameters too:• Optical center, non-square pixels, lens distortion, etc.8Camera calibrationDetermine camera parameters from known 3D points or calibration object(s)1. internal or intrinsic parameters such as focal length, optical center, aspect ratio:what kind of camera?2. external or extrinsic (pose) parameters:where is the camera in the world coordinates?• World coordinates make sense for multiple cameras / multiple imagesHow can we do this?Approach 1: solve for projection matrixPlace a known object in the scene• identify correspondence between image and scene• compute mapping from scene to image9Direct linear calibrationSolve for Projection Matrix Π using least-squares (just like in homework)Advantages:• All specifics of the camera summarized in one matrix• Can predict where any world point will map to in the imageDisadvantages:• Doesn’t tell us about particular parameters• Mixes up internal and external parameters– pose specific: move the camera and everything breaksProjection equation• The projection matrix models the cumulative effect of all parameters• Useful to decompose into a series of operationsΠXx===1************ZYXssysx−−=11010000100001100'0'0311333311333xxxxxxcycxyfsxfs000TIRΠprojectionintrinsics rotation translationidentity matrixApproach 2: solve for parametersA camera is described by several parameters• Translation T of the optical center from the origin of world coords• Rotation R of the image plane• focal length f, principle point (x’c, y’c), pixel size (sx, sy)• blue parameters are called “extrinsics,” red are “intrinsics”• Solve using non-linear optimization10DistortionRadial distortion of the image• Caused by imperfect lenses• Deviations are most noticeable for rays that pass through the edge of the lensNo distortion Pin cushion BarrelDistortion11Radial distortionCorrect for “bending” in wide field of view lensesUse this instead of normal projectionMulti-plane calibration Images courtesy Jean-Yves Bouguet, Intel Corp.Advantage• Only requires a plane• Don’t have to know positions/orientations• Good code available online!– Intel’s OpenCV library:http://www.intel.com/research/mrl/research/opencv/– Matlab version by Jean-Yves Bouget: http://www.vision.caltech.edu/bouguetj/calib_doc/index.html– Zhengyou Zhang’s web site: http://research.microsoft.com/~zhang/Calib/12Homography revisitedx = PRTX X ~ T-1R-1P-1xx1= P1R1T1T2-1R2-1P2-1x2= Mx2M is 4x4 but if all points X are on a plane, we can drop the last row and get our homography matrix H:x1~ Hx2Now, if the camera only rotates (no translation):H = K1R1R2-1K2-1Therefore, our homography has only 3,4 or 5 DOF, depending if focal length is known, same, or different.• This makes image registration much better behaved−−=Π=11010000100001100'0'0311333311333xxxxxxcycxyfsxfsXx000TIRΠK R TPImage registrationHow do we determine alignment between images?• Direct (pixel-based) alignment• One possibility: block matching (correlation), i.e., find minimum squared error• Another possiblility: Fourier-domain correlation [Brown’92]• But have to be more clever when more DOF are needed[]2),(01),(),(),(∑−++=yxyxIvyuxIvuE13Image registrationHow do we determine alignment between images?• Feature-based Alignment• Match features between images and use as correspondences• But matching is tricky:– Features look like each other– Features don’t look like themselves when
View Full Document