您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 相对定向—绝对定向解法
相对定向—绝对定向解法实验报告1、实验代码1.1根据所给同名像点的像平面坐标进行相对定向,求解相对的相对定向元素functionxP=xiangduidingxiang(Lxy,Rxy,f)%UNTITLEDSummaryofthisfunctiongoeshere%Detailedexplanationgoeshere%设置相对定向元素是初始值u=0;v=0;w=0;q=0;k=0;bu=Rxy(1,1)-Lxy(1,1);while(1)%求解余弦元素a1=cos(q)*cos(k)-sin(q)*sin(w)*sin(k);a2=-cos(q)*sin(k)-sin(q)*sin(w)*cos(k);a3=-sin(q)*cos(w);b1=cos(w)*sin(k);b2=cos(w)*cos(k);b3=-sin(w);c1=sin(q)*cos(k)+cos(q)*sin(w)*sin(k);c2=-sin(q)*sin(k)+cos(q)*sin(w)*cos(k);c3=cos(q)*cos(w);R=[a1,a2,a3;b1,b2,b3;c1,c2,c3];[n,m]=size(Lxy);u2=[];v2=[];w2=[];fori=1:nu2(i)=a1*Rxy(i,1)+a2*Rxy(i,2)-a3*f;v2(i)=b1*Rxy(i,1)+b2*Rxy(i,2)-b3*f;w2(i)=c1*Rxy(i,1)+c2*Rxy(i,2)-c3*f;endfori=1:nu1(i)=Lxy(i,1);v1(i)=Lxy(i,2);w1(i)=-f;endbv=bu*u;bw=bu*v;fori=1:nN1(i)=(bu*w2(i)-bw*u2(i))/(u1(i)*w2(i)-u2(i)*w1(i));N2(i)=(bu*w1(i)-bw*u1(i))/(u1(i)*w2(i)-u2(i)*w1(i));endfori=1:na(i)=-u2(i)*v2(i)*N2(i)/w2(i);b(i)=-(w2(i)+v2(i)*v2(i)/w2(i))*N2(i);c(i)=u2(i)*N2(i);d(i)=bu;e(i)=-v2(i)*bu/w2(i);l(i)=N1(i)*v1(i)-N2(i)*v2(i)-bv;end%组成法方程系数阵AA=zeros(n,5);%c个控制点,A:c行,5列fori=1:nA(i,1)=a(i);A(i,2)=b(i);A(i,3)=c(i);A(i,4)=d(i);A(i,5)=e(i);L(i,1)=l(i);end%求解改正数XX=inv((A')*A)*(A')*L;q=q+X(1,1);w=w+X(2,1);k=k+X(3,1);u=u+X(4,1);v=v+X(5,1);%求解改正数绝对值的最大项,判断最大项是否小于限差Xabs=abs(X);aaa=max(Xabs);ifaaa0.00003%当改正数中绝对值最大的改正数小于限差0.00003break;%后跳出循环,计算结果已经收敛endxP=[u,v,q,w,k];end1.2根据所给控制点的像平面坐标,求解控制点的模型坐标functionM=calmodelcord(xP,Lxy,Rxy,f,m)h(1,:)=[0,0,0,0,0,0];bu=(Lxy(1,1)-Rxy(1,1))*m;bv=bu*xP(1);bw=bu*xP(2);h(2,:)=[bu,bv,bw,xP(3),xP(4),xP(5)];M=qianfang(h,Lxy,Rxy,f);end1.3利用控制点的地面摄影测量坐标和模型坐标求解相对立体模型的绝对定向元素function[jP,Accuracy]=jueduidingxiang(M,G)%UNTITLEDSummaryofthisfunctiongoeshere%Detailedexplanationgoeshere%设置绝对定向元素是初始值Xs=0;Ys=0;Zs=0;q=0;w=0;k=0;r=1;[n,m]=size(G);gt=sum(G)/n;gm=sum(M)/n;fori=1:n%Mg(i,:)=M(i,:)-gm;%Gg(i,:)=G(i,:)-gt;Mg(i,:)=M(i,:);Gg(i,:)=G(i,:);end%组成法方程系数阵A%A=zeros(3*n,4);%c个控制点,A:2c行,6列A=zeros(3*n,7);fori=1:nA(3*i-2,:)=[1,0,0,Mg(i,1),-Mg(i,3),0,-Mg(i,2)];A(3*i-1,:)=[0,1,0,Mg(i,2),0,-Mg(i,3),Mg(i,1)];A(3*i-0,:)=[0,0,1,Mg(i,3),Mg(i,1),Mg(i,2),0];endwhile(1)%求解余弦元素a1=cos(q)*cos(k)-sin(q)*sin(w)*sin(k);a2=-cos(q)*sin(k)-sin(q)*sin(w)*cos(k);a3=-sin(q)*cos(w);b1=cos(w)*sin(k);b2=cos(w)*cos(k);b3=-sin(w);c1=sin(q)*cos(k)+cos(q)*sin(w)*sin(k);c2=-sin(q)*sin(k)+cos(q)*sin(w)*cos(k);c3=cos(q)*cos(w);R=[a1,a2,a3;b1,b2,b3;c1,c2,c3];L=zeros(3*n,1);fori=1:nl(i,:)=Gg(i,:)-r*Mg(i,:)*R'-[Xs,Ys,Zs];L(3*i-2)=l(i,1);L(3*i-1)=l(i,2);L(3*i-0)=l(i,3);end%求解改正数XX=inv((A')*A)*(A')*L;q=q+X(5,1);w=w+X(6,1);k=k+X(7,1);r=r+X(4,1);Xs=Xs+X(1,1);Ys=Ys+X(2,1);Zs=Zs+X(3,1);%q=q+X(1,1);w=w+X(2,1);k=k+X(3,1);r=r+X(4,1);%Xs=Xs+X(1,1);Ys=Ys+X(2,1);Zs=Zs+X(3,1);%求解改正数绝对值的最大项,判断最大项是否小于限差Xabs=abs(X);%X2=X(1:3);X2=X(1:7);aaa=max(X2);ifaaa0.00003%当改正数中绝对值最大的改正数小于限差0.00003break;%后跳出循环,计算结果已经收敛endV=A*X-L;Qx=inv((A')*A);m=sqrt(V'*V/(3*n-7));mx=m*sqrt(Qx(1,1));my=m*sqrt(Qx(2,2));mz=m*sqrt(Qx(3,3));mr=m*sqrt(Qx(4,4));mq=m*sqrt(Qx(5,5));mw=m*sqrt(Qx(5,5));mk=m*sqrt(Qx(7,7));Accuracy=[m,mx,my,mz,mr,mq,mw,mk];jP=[Xs,Ys,Zs,q,w,k,r];end1.4根据同名像点在左右像片上的坐标,运用相对定向-绝对定向求解其对应的地面点在摄影测量坐标系中的坐标functionG=modeltoground(M,jP)%UNTITLEDSummaryofthisfunctiongoeshere%DetailedexjPlanationgoeshere%设置绝对定向元素是初始值Xs=jP(1);Ys=jP(2);Zs=jP(3);q=jP(4);w=jP(5);k=jP(6);r=jP(7);%求解余弦元素a1=cos(q)*cos(k)-sin(q)*sin(w)*sin(k);a2=-cos(q)*sin(k)-sin(q)*sin(w)*cos(k);a3=-sin(q)*cos(w);b1=cos(w)*sin(k);b2=cos(w)*cos(k);b3=-sin(w);c1=sin(q)*cos(k)+cos(q)*sin(w)*sin(k);c2=-sin(q)*sin(k)+cos(q)*sin(w)*cos(k);c3=cos(q)*cos(w);R=[a1,a2,a3;b1,b2,b3;c1,c2,c3];[n,m]=size(M);G=zeros(n,3);fori=1:nG(i,:)=r*M(i,:)*R'+[Xs,Ys,Zs];endend2、实验结果点号左片右片地面摄影测量坐标xyxyXYZGCP116.01279.963-73.9378.7065083.2055852.099527.925GCP288.5681.134-5.25278.1845780.025906.365571.549GCP313.362-79.37-79.122-78.8795210.8794258.446461.81GCP482.24-80.027-9.887-80.0895909.2644314.283455.484151.75881.555-39.95378.463214.618-0.231-76.0160.036349.88-0.792-42.201-1.022486.243-1.346-7.706-2.112548.135-79.962-44.438-79.736内方位元素:f=152.000mm,x0=0,y0=0相对定向元素xP=-0.02330.03540.01600.01970.0159精度xAccuracy=0.00040.01390.00600.01100.00680.0047控制点模型坐标M=156.936953481233785.310912313082-1489.78372028151846.996568864545777.568121579323-1453.74298179100137.064504568123-813.912928625571-1559.18310839356848.337950390061-825.212755553314-1567.93979157696控制点地面摄影测量坐标G=5083.2055852.099527.9255780.025906.365571.5495210.8794258.446461.815909.2644314.283455.484绝对定向元素jP=4989.990418301155058.391183895982015.932707725130.006366143570830820.0001719809659343390.08693178225995710.998202595968240精度jAccuracy=5.0713842812432411.33514559405495.624788573722556.218723144364650.002897437680264940.007221625088790500.007221625088790500.00292249179908379同名像点模型坐标M=156.936953481233785.310912313082-1489.78372028151846.996568864545777.568121579323-1453.74298179100137.064504568123-813.912928625571-1559.18310839356848.337950390061-825.212755553314-1567.93979157696501.182474572058786.460796681501-1471.84466430219147.511281621562-2.32394422877021-1533.84285172236496.993543733293-7.82730676502133-1514.49516133642847.202456098722-13.27982924
本文标题:相对定向—绝对定向解法
链接地址:https://www.777doc.com/doc-4959413 .html