|
|
Re: Non-linear optimization
Posted:
Mar 7, 2013 3:35 PM
|
|
"Matt J" wrote in message <kharnu$599$1@newscl01ah.mathworks.com>... > "Toan Cao" <toancv3010@gmail.com> wrote in message <khaats$7h6$1@newscl01ah.mathworks.com>... > > "Matt J" wrote in message <kh8dvs$imu$1@newscl01ah.mathworks.com>... > > > "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kh8bsc$bov$1@newscl01ah.mathworks.com>... > > > > "Matt J" wrote in message <kh89he$4al$1@newscl01ah.mathworks.com>... > > > > > > > > > f(x)=(sqrt(F(x)-f_low))^2 > > > > > > > > What you write is > > > > > > > > f(x) = abs(F(x)-f_low) = F(x)-f_low > > > > > > > > Minimizing f(x) is the same as minimizing F(x). How far do we get? > > > =============== > > > > > > That should really have been > > > > > > f(x)=sqrt(F(x)-f_low) > > > > > > min (f(x))^2 > > > > > > But yes, the above is equivalent to minimizing F(x). That's what we want. Now, however, you can feed f(x) to LSQNONLIN and run its Levenberg-Marquardt routine. > > > > Hi Matt J, > > > > I will summarize my function here again and wish to receive feedback! > > > > >Given two 3D point clouds (source point cloud (SPC) and target point cloud (TPC)). I would like to move each point of SPC to be coincide with each corresponding point of TPC. > > Each movement of each point of SPC is described by a Rotation matrix Ri and a translation vector Ti. > > Rotation matrix Ri is constrained: > > Rot(Ri)= (C1.C2)^2 + (C1.C3)^2 + (C2.C3)^2 +(C1.C1 -1)^2 +(C2.C2 -1)^2 + (C3.C3 -1)^2, where C1, C2, C3 are 3x1 column vectors of Ri. > > Given m points in SPC, the first term of cost function is: Sum(Rot(Ri)) where i =1:m > > If we call a point in SPC is Vi, its corresponding point in TPC is Ui, its transformed point is V'i. So, the second term of cost function is: Sum((V'i - Ui)^2), i=1:m > > -------------------------- > > I assume that (for simplicity) the third term for my cost function is Sum(norm(Ri-Rj)^2), i,j=1:m, i ~=j > > Now, my cost functiion : F = Sum(Rot(Ri)) +Sum((V'i - Ui)^2) +Sum(norm(Ri-Rj)^2), i=1:m > > > > I read document of optimization toolbox of matlab, It suggests that i can use LSQNONLIN for this function with Levenberg-Marquardt algorihm. With this routine, it requires we provide a vector-value function f(x)=[f{1}(x),f{2}(x),...,f{n}(x)]' for LSQNONLIN. > > > > Now, to use this routine, i will do: > > 1) f{1}(x)= (C1{i}.C2{i}), f{2}(x)= (C1{i}.C3{i}),..., (a set of functions for first term). > > f{k}(x) =(V'{i} - U{j}), f{k+1}(x) =(V'{i+1} - U{j+1}),...., (a set of functions for second term). > > f{h}(x)= norm(R{i}-R{j}) {i=h},... ,f{m}(x)=norm(R{i}-R{j}) {i=m}. (a set of functions for third term). > > => So, f(x) = [f{1}(x), f{2}(x),..., f{k}(x), f{k+1}(x),..., f{h}(x),..., f{m}(x)]' > > > > OR, i just give: > > 2) f{1}(x) = sqrt(Sum(Rot(Ri))), f{2}(x) = sqrt(Sum((V'i - Ui)^2)), f{3}(x) =sqrt(Sum(norm(Ri-Rj)^2)). > > => So, f(x) = [f{1}(x), f{2}(x), f{3}(x)]' > > With your experience, Which option (1 or 2) should i follow ? > ============ > > Toan, > > I think neither option is a good one because, as I have already told you, it looks like the Ri parameters are unnecessary. Also, I can give you a solution right now that you can verify, by direct subsititution, will globally minimize the function you have written with F(Ri,Ti)=0. The solution is > > Ri=eye(3) > Ti=Ui-Vi > > for all i=1..m
Hi Matt J,
Thanks for your consideration! Yes, i know what you mean in order to implement easily for my problem. However, in limited space of the text, i can not explain why i need rotation matrices to describe movements of points. It is reason i just explain main idea of the cost function. If you would like to know more, i can show the paper i read and want to implement, its title: "Embedded deformation for shape manipulation". Its cost function is expressed in section 4. So, when applying LSQNONLIN, i am confused which option (1 or 2) i use for f(x)=[f{1}(x),f{2}(x),...,f{n}(x)]' ? I am willing to receive any your suggestion for my case.
Best regards, Toan
|
|