%display the imageimshow('image.jpg');%get the coordinate of three points of the imagep=ginput(3)%print + sign on the selected pointhold onplot(p(1,1),p(1,2),'+r')plot(p(2,1),p(2,2),'+r')plot(p(3,1),p(3,2),'+r')%get real coordinate of selected pointpg=input('Enter the real coordinate of selectd point')%[1 2;7 2;5 6]%calculate intrinsic matixA=[pg(1,1),pg(1,2),1,0,0,0,0,0,0;0,0,0,pg(1,1),pg(1,2),1,0,0,0;0,0,0,0,0,0,pg(1,1),pg(1,2),1;pg(2,1),pg(2,2),1,0,0,0,0,0,0;0,0,0,pg(2,1),pg(2,2),1,0,0,0;0,0,0,0,0,0,pg(2,1),pg(2,2),1;pg(3,1),pg(3,2),1,0,0,0,0,0,0;0,0,0,pg(3,1),pg(3,2),1,0,0,0;0,0,0,0,0,0,pg(3,1),pg(3,2),1;]b=[p(1,1);p(1,2);1;p(2,1);p(2,2);1;p(3,1);p(3,2);1]x=A\bp=[x(1) x(2) x(3);x(4) x(5) x(6);x(7) x(8) x(9)]pr=p(1:3,1:2)[q,r]=qr(pr)r=r(1:2,1:2)l=r(1:2,2:2)%check the resulttitle ('click on any point')pt=ginput(1)plot(pt(1,1),pt(1,2),'marker','O')pc=r\[pt(1,1);pt(1,2)]text(pt(1,1),pt(1,2),['(',num2str(pc(1,1)) ',' num2str(pc(2,1)),')'])%matlab 2015b
Show admin stats