Changeset 693 for trunk/src/geometry_calib.m
- Timestamp:
- Oct 29, 2013, 12:28:57 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r682 r693 50 50 % Edit the above text to modify the response to help geometry_calib 51 51 52 % Last Modified by GUIDE v2.5 02-Sep-2013 16:47:2752 % Last Modified by GUIDE v2.5 29-Oct-2013 06:46:10 53 53 54 54 % Begin initialization code - DO NOT edit … … 114 114 set(handles.Copy,'Position',[151 Height-394 120 30])% rank 6 115 115 set(handles.CLEAR_PTS,'Position',[297 Height-394 120 30])% rank 6 116 set(handles.ClearLine,'Position',[297 Height-364 120 30])% rank 6 116 117 set(handles.phys_title,'Position',[38 Height-426 125 20])% rank 7 117 118 set(handles.CoordUnit,'Position',[151 Height-426 120 30])% rank 7 … … 230 231 Data=get(handles.ListCoord,'Data'); 231 232 Data(:,6)=zeros(size(Data,1),1); 232 Data(index,6)= 1;% indicate in the list the point with max deviation (possible mistake)233 Data(index,6)=-1;% indicate in the list the point with max deviation (possible mistake) 233 234 set(handles.ListCoord,'Data',Data)% indicate in the list the point with max deviation (possible mistake) 234 235 figure(handles.geometry_calib) … … 881 882 huvmat=findobj(allchild(0),'Name','uvmat'); 882 883 UvData=get(huvmat,'UserData'); 883 A=UvData.Field.A; 884 A=UvData.Field.A;%currently displayed image 884 885 npxy=size(A); 885 886 X=[CalibData.grid.x_0 CalibData.grid.x_1 CalibData.grid.x_0 CalibData.grid.x_1]';%corner absissa in the phys coordinates (cm) 886 887 Y=[CalibData.grid.y_0 CalibData.grid.y_0 CalibData.grid.y_1 CalibData.grid.y_1]';%corner ordinates in the phys coordinates (cm) 887 888 888 %calculate transform matrices for plane projection 889 %calculate transform matrices for plane projection: rectangle assumed to be viewed in perspective 889 890 % reference: http://alumni.media.mit.edu/~cwren/interpolator/ by Christopher R. Wren 890 891 B = [ X Y ones(size(X)) zeros(4,3) -X.*corners_X -Y.*corners_X ... … … 898 899 899 900 % transform grid image into 'phys' coordinates 900 GeometryCalib.CalibrationType=' linear';901 GeometryCalib.CalibrationType='3D_linear'; 901 902 GeometryCalib.fx_fy=[1 1]; 902 903 GeometryCalib.Tx_Ty_Tz=[Amat(1,3) Amat(2,3) 1]; … … 918 919 DataOut=phys(Data,Calib); 919 920 rmpath(fullfile(path_UVMAT,'transform_field')) 920 Amod=DataOut.A; 921 Amod=DataOut.A;% current imgage expressed in 'phys' coord 921 922 Rangx=DataOut.AX; 922 923 Rangy=DataOut.AY; … … 936 937 ind_range_y=ceil(abs(GeometryCalib.R(2,2)*CalibData.grid.Dy/3));% range of search of image ma around each point obtained by linear interpolation from the marked points 937 938 nbpoints=size(T,1); 939 %lokk for image maxima around each expected pgrid point 938 940 for ipoint=1:nbpoints 939 941 i0=1+round((T(ipoint,1)-Rangx(1))/Dx);%round(Xpx(ipoint)); … … 962 964 Delta(ipoint,2)=(y_shift+ind_y_max+j0min-j0-1)*Dy; 963 965 end 964 Tmod=T(:,(1:2))+Delta; 965 [Xpx,Ypx]=px_XYZ(GeometryCalib,Tmod(:,1),Tmod(:,2)); 966 % for ipoint=1:nbpoints 967 % Coord{ipoint,1}=num2str(T(ipoint,1),4);%display coordiantes with 4 digits 968 % Coord{ipoint,2}=num2str(T(ipoint,2),4);%display coordiantes with 4 digits 969 % Coord{ipoint,3}=num2str(T(ipoint,3),4);%display coordiantes with 4 digits; 970 % Coord{ipoint,4}=num2str(Xpx(ipoint),4);%display coordiantes with 4 digits 971 % Coord{ipoint,5}=num2str(Ypx(ipoint),4);%display coordiantes with 4 digits 972 % end 966 Tmod=T(:,(1:2))+Delta;% 'phys' coordinates of the detected points 967 Tmod(:,2)=flipdim(Tmod(:,2),1);% inverse the order of y coordinates 968 [Xpx,Ypx]=px_XYZ(GeometryCalib,Tmod(:,1),Tmod(:,2));% image coordinates of the detected points 973 969 Coord=[T Xpx Ypx zeros(size(T,1),1)]; 974 970 set(handles.ListCoord,'Data',Coord) … … 1250 1246 Data=get(handles.ListCoord,'Data'); 1251 1247 Data(:,6)=zeros(size(Data,1),1); 1252 Data(iline,6)= 1;% mark the selected line1248 Data(iline,6)=-1;% mark the selected line 1253 1249 set(handles.ListCoord,'Data',Data) 1254 1250 update_calib_marker(Data(iline,:)) … … 1340 1336 set(hhh,'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range]) 1341 1337 end 1338 1339 %------------------------------------------------------------------------ 1340 % --- Executes on button press in ClearLine: remove the selected line in the table Coord 1341 %------------------------------------------------------------------------ 1342 function ClearLine_Callback(hObject, eventdata, handles) 1343 1344 Coord=get(handles.ListCoord,'Data'); 1345 ind=find(Coord(:,6));%find the marker '-' for line selection 1346 if isempty(ind) 1347 msgbox_uvmat('WARNING','no line suppressed, select a line in the table') 1348 else 1349 answer=msgbox_uvmat('INPUT_Y-N',['suppress line ' num2str(ind) '?']); 1350 if isequal(answer,'Yes') 1351 Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark 1352 Coord(ind,:)=[]; 1353 PLOT_Callback(hObject,eventdata,handles) 1354 set(handles.APPLY,'BackgroundColor',[1 0 1]) 1355 set(handles.ListCoord,'Data',Coord); 1356 end 1357 end
Note: See TracChangeset
for help on using the changeset viewer.