数码相机定位的最优化方法(matlab程序)

上传人:kms****20 文档编号:37432342 上传时间:2018-04-16 格式:DOC 页数:2 大小:30.50KB
返回 下载 相关 举报
数码相机定位的最优化方法(matlab程序)_第1页
第1页 / 共2页
数码相机定位的最优化方法(matlab程序)_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《数码相机定位的最优化方法(matlab程序)》由会员分享,可在线阅读,更多相关《数码相机定位的最优化方法(matlab程序)(2页珍藏版)》请在金锄头文库上搜索。

1、数码相机定位的最优化方法数学建模 MATLAB 程序figure figu = imread(mathmodel2008a.bmp,bmp) ; figu = figu(:,:,1)100; image(100*figu) ; colormap(gray(256) ; I = figu ; BW2 = edge(I,canny); figure ; image(100*BW2) ; colormap(gray(256) ; p1 = BW2(1:384,1:380) ; p2 = BW2(1:384,381:490) ; p3 = BW2(1:384,491:end) ; p4 = BW2(3

2、85:end,1:380) ; p5 = BW2(385:end,381:end) ; figure ; for i = 1 : 5eval(subplot(2,3,i) ; image(100*p,num2str(i),) ;) ;colormap(gray(256) ;axis equal end card = 0 0 ; 0 380 ; 0 490 ; 384 0 ; 384 380 ; for i = 1 : 5vi,vj = find(eval(p,num2str(i) ;card(i,:) = card(i,:) + mean(vi),mean(vj) ; end card7 =

3、(card-repmat(384 512,5,1) )/3.78,1577/3.78*ones(5,1) card5 = card - repmat(card(1,:),5,1) dist2p10 = diag(sqrt(card5*card5) ; thetas450 = acos(card5(4,5,:)*card5(2,:)./ .(dist2p10(2)*dist2p10(4:5) ; card6(1,:) = 0 0 ; card6(2,:) = norm(card5(2,:),0 ; card6(3,:) = norm(card5(3,:),0 ; card6(4,:) = dis

4、t2p10(4)*cos(thetas450(1),sin(thetas450(1) ; card6(5,:) = dist2p10(5)*cos(thetas450(2),sin(thetas450(2) ;x = -200 -500 500 , 2 5 -5; f = camera(x) ; g= -50 0 50 ; -20 0 50 ; 50 0 50 ; -50 0 -50 ; 50 0 -50h = repmat(x(1:3),5,1),f,g; figure plot3(0,0,0,w.) ; hold on for i = 1 : 5plot3(h(i,1),h(i,2),h(

5、i,3),*) ;%相机坐标图像plot3(h(i,4),h(i,5),h(i,6),+) ;%光线与成像平面交点图像plot3(h(i,7),h(i,8),h(i,9),d) ;%特征点图像 end card2 = f; card3 = card2 - repmat(card2(1,:),5,1) %实际相点相对 A 点坐标 figure ; plot3(card3(:,1),card3(:,2),card3(:,3),k.,markersize,10) hold on %各点间连线图 plot3(card3(1:3,1),card3(1:3,2),card3(1:3,3),k) plot3

6、(card3(1 4,1),card3(1 4,2),card3(1 4,3),k) plot3(card3(4 5,1),card3(4 5,2),card3(4 5,3),k) plot3(card3(3 5,1),card3(3 5,2),card3(3 5,3),k) dist2p1 = diag(sqrt(card3*card3) thetas45 = acos(card3(4,5,:)*card3(2,:)./ .(dist2p1(2)*dist2p1(4:5) card4(1,:) = 0 0 ; card4(2,:) = norm(card3(2,:),0 ;%相对 A 点的距离 card4(3,:) = norm(card3(3,:),0 ; card4(4,:) = dist2p1(4)*cos(thetas45(1),sin(thetas45(1) card4(5,:) = dist2p1(5)*cos(thetas45(2),sin(thetas45(2) card4 = 3.78*card4潇哥爱娜妹 2013.03.31

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号