0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 if ~exist('.\Calib_Results.mat','file')
0015 disp('Calib_Results.mat is needed to proceed.');
0016 return;
0017 end
0018 if ~exist('rangeMatrix','var')
0019 disp('Range data needed, run Read data or Load.');
0020 return;
0021 end
0022
0023 disp('Manual Selection.');
0024
0025
0026
0027 if ~exist('deltaest','var')
0028 deltaest=[0;0;0];
0029 end
0030 deltaestin=input(['Enter initial estimate for translation vector ([]=',mat2str(deltaest',3),'):']);
0031 if ~isempty(deltaestin)
0032 deltaest=deltaestin(:);
0033 end
0034
0035 if ~exist('phiest','var')
0036 phiest=angvec2dcm([0;0;0]);
0037 end
0038 phiestin=input(['Enter initial estimate for rotation vector ([]=',mat2str(rad2deg(dcm2angvec(phiest))',3),'):']);
0039 if ~isempty(phiestin)
0040
0041 phiest=angvec2dcm(deg2rad(phiestin(:)));
0042 end
0043
0044
0045 [Nci,BoardCorners]=GetCameraPlanes('Calib_Results.mat',size(rangeMatrix,1));
0046
0047
0048
0049
0050 clstrs=zeros(size(rangeMatrix));
0051 boardclstrs=zeros(size(rangeMatrix,1),1);
0052 selectionnumbers=1:size(rangeMatrix,1);
0053
0054
0055 vscans=~isnan(Nci(1,:))';
0056 selectionnumbers(selectionnumbers>length(vscans))=[];
0057 selectionnumbers(~vscans(selectionnumbers))=[];
0058
0059 disp('Press Enter to skip or ''e'' to interrupt process.');
0060 f=figure;
0061 uisuspend(f);
0062 for cntr=selectionnumbers
0063 fprintf('Select points from scan no %d.',cntr);
0064 img=GetImage(cntr);
0065 if ~isempty(img);
0066 maximize(f);
0067 subplot 122;
0068 imshow(img,[]);
0069 subplot 121;
0070 else
0071 fprintf(' Image does not exist.');
0072 end
0073 fprintf('\n');
0074
0075 orientation=dcm2angvec(phiest);
0076 orientation=orientation(3);
0077 selind = SelectLaserPoints(angleVector+orientation,rangeMatrix(cntr,:));
0078 clf;
0079 if isempty(selind)
0080 continue;
0081 end
0082 if ~selind
0083 break;
0084 end
0085 clstrs(cntr,:)=selind+1;
0086 boardclstrs(cntr)=2;
0087 end
0088 close(f);
0089
0090 manclstrs=clstrs;
0091
0092
0093 selectionnumbers(~boardclstrs(selectionnumbers))=[];
0094
0095
0096 dispboardpts(angleVector,rangeMatrix,clstrs,boardclstrs,selectionnumbers);