资源描述:
《摄影测量学单像空间后方交会程序设计作业复习过程.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、精品好文档,推荐学习交流usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespace单像空间后方交会{classProgram{staticvoidMain(string[]args){intx0,y0,i,j;doublef,m;Console.Write("请输入像片比例尺:");m=double.Parse(Console.ReadLine());Console.Write("请输入像片的内方位元素x0:");//
2、均以毫米为单位x0=int.Parse(Console.ReadLine());Console.Write("请输入像片的内方位元素y0:");y0=int.Parse(Console.ReadLine());Console.Write("请输入摄影机主距f:");f=double.Parse(Console.ReadLine());Console.WriteLine();//输入坐标数据double[,]zuobiao=newdouble[4,5];for(i=0;i<4;i++){for(j=0;j<5;j++){if(j<3)
3、{Console.Write("请输入第{0}个点的第{1}个地面坐标:",i+1,j+1);zuobiao[i,j]=double.Parse(Console.ReadLine());}else{Console.Write("请输入第{0}个点的第{1}个像点坐标:",i+1,j-2);zuobiao[i,j]=double.Parse(Console.ReadLine());}}Console.WriteLine();}//归算像点坐标for(i=0;i<4;i++){for(j=3;j<5;j++){if(j==3)zuobi
4、ao[i,j]=zuobiao[i,j]-x0;elsezuobiao[i,j]=zuobiao[i,j]-y0;}}//计算和确定初值doublezs0=m*f,xs0=0,ys0=0;for(i=0;i<4;i++){仅供学习与交流,如有侵权请联系网站删除谢谢7精品好文档,推荐学习交流xs0=xs0+zuobiao[i,0];ys0=ys0+zuobiao[i,1];}xs0=xs0/4;ys0=ys0/4;//逐点计算误差方程系数double[,]xishu=newdouble[8,6];for(i=0;i<8;i+=2){d
5、oublex,y;x=zuobiao[i/2,3];y=zuobiao[i/2,4];xishu[i,0]=xishu[i+1,1]=-1/m;xishu[i,1]=xishu[i+1,0]=0;xishu[i,2]=-x/(m*f);xishu[i,3]=-f*(1+x*x/(f*f));xishu[i,4]=xishu[i+1,3]=-x*y/f;xishu[i,5]=y;xishu[i+1,2]=-y/(m*f);xishu[i+1,4]=-f*(1+y*y/(f*f));xishu[i+1,5]=-x;}//计算逆阵doub
6、le[,]dMatrix=matrixChe(matrixTrans(xishu),xishu);double[,]dReturn=ReverseMatrix(dMatrix,6);Console.WriteLine("逆矩阵为:");if(dReturn!=null){matrixOut(dReturn);}//求解过程doublephi0=0,omega0=0,kappa0=0;intq=0;double[,]r=newdouble[3,3];double[,]jinsi=newdouble[4,2];double[]chazh
7、i=newdouble[8];double[]jieguo=newdouble[6];double[,]zhong=matrixChe(dReturn,matrixTrans(xishu));do{//计算旋转矩阵rr[0,0]=Math.Cos(phi0)*Math.Cos(kappa0)-Math.Sin(phi0)*Math.Sin(omega0)*Math.Sin(kappa0);r[0,1]=-Math.Cos(phi0)*Math.Sin(kappa0)-Math.Sin(phi0)*Math.Sin(omega0)*M
8、ath.Cos(kappa0);r[0,2]=-Math.Sin(phi0)*Math.Cos(omega0);r[1,0]=Math.Cos(omega0)*Math.Sin(kappa0);r[1,1]=Math.Cos(omeg