www.pudn.com > calibr8.zip > demo.m
clc format compact more off load samples/coords/syntcds load samples/coords/realcds addpath solvopt addpath solvopt/uncprobs addpath m echo on % % press enter to start the calibration with synthetic data pause clc [Te, Re, Ine, errs, cerrs] = calibr8( [1300, 353, 286, 0, 0], 7, 0.1, PC1, PC2, PC4, PC5 ); quiver( cerrs(:,1), cerrs(:,2), cerrs(:,3), cerrs(:,4) ) figure plot( errs(1,:) ) grid on zoom on % % Results of the calibration: % % intrinsic parameters of the camera (focal length, principal points, linear distortion coefficients): fl=Ine(1);pp=[Ine(2),Ine(3)];b=[Ine(4),Ine(5)];fl,pp,b % % estimated rotation matrix: Re % % appropriate euler angles (in degrees): [ox, fy, kz] = deeuler_deg( Re ) % % estimated rotation matrix: Te % % extracted translation vector: t = Re * Te(:,3) % %press enter to continue with calibration with real data pause close all clc [Te, Re, Ine, errs, cerrs] = calibr8( [1500, 353, 286, 0, 0], 7, 0.1, shot2, shot5, shot9, shot11 ); quiver( cerrs(:,1), cerrs(:,2), cerrs(:,3), cerrs(:,4) ) figure plot( errs(1,:) ) grid on zoom on % % Results of the calibration: % % intrinsic parameters of the camera (focal length, principal points, linear distortion coefficients): fl=Ine(1);pp=[Ine(2),Ine(3)];b=[Ine(4),Ine(5)];fl,pp,b % % estimated rotation matrix: Re % % appropriate euler angles (in degrees): [ox, fy, kz] = deeuler_deg( Re ) % % estimated rotation matrix: Te % % extracted translation vector: t = Re * Te(:,3) % press enter to finish pause close all % % thank you