



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




T (X) = R ∗ X + t = Y (1) ⇒ X = T −^1 (Y (i, j)) (2) It(i, j) = L(Is(X)) (3)
(a) Write a program to rigidly transform an image. Perform counter- clockwise rotation around the image center. Use the following specifi- cation:
C/C++ : ./rigidTransform input.pgm output.pgm angle TrX TrY MATLAB: rigidTransform( inputFile, outputFile, angle, TrX ,TrY) Units : angle (degrees), translation (pixel unit)
(b) Take any image of your choice, rotate it by 35◦^ and translate it by (− 1. 5 , 5 .5) pixels.
Estimate the perspective projection matrix M of a camera given a set of object points, Pi = (xi, yi, zi, 1), and their image coordinates, (ui, vi). Let the rows of 3 × 4 camera matrix M be denoted as mt 1 , mt 2 , and mt 3. The relation between the object points in the 3D scene and their image coordinates becomes:
ui = mt 1 Pi/mt 3 Pi vi = mt 2 Pi/mt 3 Pi (4) ⇒ (m 1 − uim 3 )tPi = 0, (m 2 − vim 3 )tPi = 0 (5)
The given set of n point pairs result in 2n homogenous linear equations (Eq-5) in the 12 unknown elements of M, expressed as Pm = 0, where
P 1 t 0 t^ −u 1 P 1 t 0 t^ P 1 t −v 1 P 1 t
......... P (^) nt 0 t^ −unP (^) nt 0 t^ P (^) nt −vnP (^) nt
m ≡
m 1 m 2 m 3
Since each point pair yields two constraints, we need at least six such pairs to solve for m using a linear least squares method. The normal- ized eigen vector of PtP corresponding to the smallest eigen value will minimize |Pm|^2. Refer sections 2.2.2, 3.1.1, and 3.2.1 (Forsyth and Ponce). Write a program to solve for M, given a set of n point pairs. Using the recovered matrix M to project Pi onto the image plane and compute mean square error between actual and estimated 2D image points. Code Formats - C,C++ : ./camCalib Pts2D.txt Pts3D.txt MATLAB : camCalib( ’Pts2D.txt’, ’Pts3D.txt’ ) Data : Pts2D.txt, Pts3D.txt files are posted online. Output: < print 3 x 4 M matrix >
Figure 1: Images of building before and after perspective correction. Source:f-spot.com
that there is sufficient overlap between the two images, to let the user select at least four correspondences from the two images. C/C++ : ./prspCorrection input.pgm output.pgm (OR) C/C++ (without GUI) : ./prspCorrection input.pgm output.pgm x1 y x2 y2 x3 y3 x4 y MATLAB: prspCorrection( inputImageFile, outputImageFile )
ing points. Note that when F is accurate, epipolar line should pass through the corresponding point. Comment on results in the report.
C/C++ : Use GLUT/OpenGL, QT, GTK, etc. to display images and collect correspondences. ./getFmatrix img1.pgm img2.pgm MATLAB : use ginput() to read mouse-clicks. getFmatrix( img1File, img2File )