www.gusucode.com > vision 源码程序 matlab案例代码 > vision/RefineCameraPosesAnd3DPointsExample.m
%% Refine Camera Poses and 3-D Points % %% % Load data for initialization. load('sfmGlobe'); %% % Refine the camera poses and points. [xyzRefinedPoints,refinedPoses] = ... bundleAdjustment(xyzPoints,pointTracks,cameraPoses,cameraParams); %% % Display the refined camera poses and 3-D world points. cameraSize = 0.1; for j = 1:height(refinedPoses) id = refinedPoses.ViewId(j); loc = refinedPoses.Location{j}; orient = refinedPoses.Orientation{j}; plotCamera('Location',loc,'Orientation',orient,'Size',... cameraSize,'Color','r','Label',num2str(id),'Opacity',.5); hold on end pcshow(xyzRefinedPoints,'VerticalAxis','y','VerticalAxisDir',... 'down','MarkerSize',45); grid on