Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Close
From: Marc Anderson <yulq2004@ya...>  20041117 02:58:42
Attachments:
Message as HTML

Hi, all vxl guys! The class vnl_levenberg_marquardt checks if the number of parameters is less than that of residuals before carrying out the minimization process, otherwise it'll returns false. This requirement prevents the estimation of homography between two images using the Gold Standard algorithm(H&Z book, p114), in which case the number of parameters is 2n+9 while the number of residuals is n. ( where n is the number of point correspondences ). Would someone get the idea to figure this issue out? Thanks! Leonard __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com 
From: Gehua Yang <yangg2@rp...>  20041118 18:02:02

First of all, Page 114, or Algorithm 3.7 is the Gold Standard Algorithm for estimating an AFFINE transformation, not homography. If homography is to be estimated, refer to Algorithm 3.3 on Page 98. There are two choices: Sampson error or Gold Standard error. For Sampson error, there are only 9 parameters(or one can choose other parameterization). As for Gold Standard error, there are 2n+9 variables. But there are 4n residuals: sum d(x_i, xhat_i)^2 + d(xpri_i, xhatpri_i)^2 Recall that LM takes a vector of residuals before squaring. for each d(.) function, there are two residuals. Another way to look at it is that each ideal point x hat brings in two parameters, but provides 4 constraints. Gehua  Original Message  From: Marc Anderson To: vxlusers@... Sent: Tuesday, November 16, 2004 9:58 PM Subject: [Vxlusers] Premise of vnl_levenberg_marquardt hold back Gold standard? > Hi, all vxl guys! > The class vnl_levenberg_marquardt checks if the number of parameters is > less than that of residuals before carrying out the minimization process, > otherwise it'll returns false. This requirement prevents the estimation of > homography between two images using the Gold Standard algorithm(H&Z book, > p114), in which case the number of parameters is 2n+9 while the number of > residuals is n. ( where n is the number of point correspondences ). Would > someone get the idea to figure this issue out? Thanks! 
From: Marc Anderson <yulq2004@ya...>  20041119 01:44:01

Gehua, Thanks for your reply! As I use the second edition of H&Z book, the algorithm on page 114 is 4.3. As for the number of residuals, I still do not quite understand why it's 4n. Since each point correspondence gives 2 residuals, i.e the squared distances in 2 images are d(x_i, xhat_i)^2 and d(xpri_i, xhatpri_i)^2. it ought to be 2n. below is the code segment of function f in my class derived from vnl_least_squares_function: void XXX:f(const vnl_vector<double>& x, vnl_vector<double>& fx) { ...... for ( int i = 0; i < n; i++ ) { ... fx[2*i] = squared_distance(x1[i], x1_h[i]); fx[2*i+1] = squared_distance(x2[i], x2_h[i]); } } I will be very grateful if you would be patient to give me a further explaination. Marc.  Gehua Yang <yangg2@...> wrote: > First of all, Page 114, or Algorithm 3.7 is the Gold > Standard Algorithm for > estimating an AFFINE transformation, not homography. > > If homography is to be estimated, refer to Algorithm > 3.3 on Page 98. There > are two choices: Sampson error or Gold Standard > error. For Sampson error, > there are only 9 parameters(or one can choose other > parameterization). As > for Gold Standard error, there are 2n+9 variables. > But there are 4n > residuals: > sum d(x_i, xhat_i)^2 + d(xpri_i, xhatpri_i)^2 > Recall that LM takes a vector of residuals before > squaring. for each d(.) > function, there are two residuals. Another way to > look at it is that each > ideal point x hat brings in two parameters, but > provides 4 constraints. > > > Gehua > >  Original Message  > From: Marc Anderson > To: vxlusers@... > Sent: Tuesday, November 16, 2004 9:58 PM > Subject: [Vxlusers] Premise of > vnl_levenberg_marquardt hold back Gold > standard? > > > > Hi, all vxl guys! > > > The class vnl_levenberg_marquardt checks if the > number of parameters is > > less than that of residuals before carrying out > the minimization process, > > otherwise it'll returns false. This requirement > prevents the estimation of > > homography between two images using the Gold > Standard algorithm(H&Z book, > > p114), in which case the number of parameters is > 2n+9 while the number of > > residuals is n. ( where n is the number of point > correspondences ). Would > > someone get the idea to figure this issue out? > Thanks! > > __________________________________ Do you Yahoo!? Meet the allnew My Yahoo!  Try it today! http://my.yahoo.com 
From: Gehua Yang <yangg2@rp...>  20041119 18:27:24

Recall that LM takes a vector of residuals BEFORE squaring. In this case, the function shall look like: fx[4*i] = x1[i][0]x1_h[i][0]; fx[4*i+1] = x1[i][1]x1_h[i][1]; fx[4*i+2] = x2[i][0]x2_h[i][0]; fx[4*i+3] = x2[i][1]x2_h[i][1]; > As for the number of residuals, I still do not quite > understand why it's 4n. Since each point > correspondence gives 2 residuals, i.e the squared > distances in 2 images are d(x_i, xhat_i)^2 and > d(xpri_i, xhatpri_i)^2. > it ought to be 2n. > > below is the code segment of function f in my class > derived from vnl_least_squares_function: > > void XXX:f(const vnl_vector<double>& x, > vnl_vector<double>& fx) > { > ...... > for ( int i = 0; i < n; i++ ) { > ... > fx[2*i] = squared_distance(x1[i], x1_h[i]); > fx[2*i+1] = squared_distance(x2[i], x2_h[i]); > } > } > > I will be very grateful if you would be patient to > give me a further explaination. > > Marc. > 
From: Xiaowei Li <nemesis@bi...>  20041119 07:22:25

Hi, Marc I think your code would be modified as the follow which yields 4n residuals: void XXX:f(const vnl_vector<double>& x, vnl_vector<double>& fx) { ...... for ( int i = 0; i < n; i++ ) { ... fx[4*i] = (x1[i].first, x1_h[i].first)^2; fx[4*i+1] = (x1[i].second, x1_h[i].second)^2; fx[4*i+2] = (x2[i].first, x2_h[i].first)^2; fx[4*i+3] = (x2[i].second, x2_h[i].second)^2; } } in which,x1[i].first refers to the "x" element of a 2D point,and x1[i].second the "y" element. Shawrie Lee regards. 