Changeset 227 for trunk/src/geometry_calib.m
- Timestamp:
- Mar 31, 2011, 1:42:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r213 r227 441 441 %------------------------------------------------------------------------ 442 442 % determine the parameters for a calibration by a linear transform matrix (rescale and rotation) 443 function GeometryCalib=calib_linear(Coord,handles) %TO UPDATE443 function GeometryCalib=calib_linear(Coord,handles) 444 444 %------------------------------------------------------------------------ 445 445 X=Coord(:,1); … … 461 461 GeometryCalib.fx_fy(2)=(a_Y1(3)/a_X1(2))*GeometryCalib.fx_fy(1); 462 462 GeometryCalib.CoordUnit=[];% default value, to be updated by the calling function 463 GeometryCalib.Tx_Ty_Tz=[a_X1(1) a_Y1(1) 1]; 463 %GeometryCalib.Tx_Ty_Tz=[a_X1(1) a_Y1(1) 1]; 464 GeometryCalib.Tx_Ty_Tz=[a_X1(1)/GeometryCalib.fx_fy(1) a_Y1(1)/GeometryCalib.fx_fy(2) 1]; 464 465 R(1,:)=R(1,:)/GeometryCalib.fx_fy(1); 465 466 R(2,:)=R(2,:)/GeometryCalib.fx_fy(2); … … 1030 1031 ind_sub_x=round(XLim); 1031 1032 ind_sub_y=np(1)-round(YLim); 1032 Mfiltre=AxeData.A( [ind_sub_y(2):ind_sub_y(1)],ind_sub_x,:);1033 Mfiltre=AxeData.A(ind_sub_y(2):ind_sub_y(1) ,ind_sub_x,:); 1033 1034 Mfiltre_norm=double(Mfiltre); 1034 1035 Mfiltre_norm=Mfiltre_norm/sum(sum(Mfiltre_norm)); … … 1064 1065 if ~isempty(ObjectData.Coord) 1065 1066 if isequal(option,'phys') 1066 ObjectData.Coord=ObjectData.Coord(:, [1:3]);1067 ObjectData.Coord=ObjectData.Coord(:,1:3); 1067 1068 elseif isequal(option,'px')||isequal(option,'') 1068 ObjectData.Coord=ObjectData.Coord(:, [4:5]);1069 ObjectData.Coord=ObjectData.Coord(:,4:5); 1069 1070 else 1070 1071 msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be '''', px or phys ') … … 1135 1136 function MenuDetectGrid_Callback(hObject, eventdata, handles) 1136 1137 %------------------------------------------------------------------------ 1137 %% initiate the grid1138 CalibData=get(handles.geometry_calib,'UserData');%get information stored on the GUI geometry_calib1139 grid_input=[];%default1140 if isfield(CalibData,'grid')1141 grid_input=CalibData.grid;%retrieve the previously used grid1142 end1143 [T,CalibData.grid,white_test]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T1144 set(handles.geometry_calib,'UserData',CalibData)%store the phys grid parameters for later use1145 1146 1138 %% read the four last point coordinates in pixels 1147 1139 Coord_cell=get(handles.ListCoord,'String');%read list of coordinates on geometry_calib … … 1149 1141 nbpoints=size(data.Coord,1); %nbre of calibration points 1150 1142 if nbpoints~=4 1151 msgbox_uvmat('ERROR','four points must have be selected by the mouse , beginning by the new x axis, to delimitate the phys grid area')1143 msgbox_uvmat('ERROR','four points must have be selected by the mouse to delimitate the phys grid area; the Ox axis will be defined by the two first points') 1152 1144 return 1153 1145 end … … 1165 1157 corners_Y(3)=Y_end; 1166 1158 end 1159 1160 %% initiate the grid 1161 CalibData=get(handles.geometry_calib,'UserData');%get information stored on the GUI geometry_calib 1162 grid_input=[];%default 1163 if isfield(CalibData,'grid') 1164 grid_input=CalibData.grid;%retrieve the previously used grid 1165 end 1166 [T,CalibData.grid,white_test]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T 1167 set(handles.geometry_calib,'UserData',CalibData)%store the phys grid parameters for later use 1168 1169 1167 1170 1168 1171 %% read the current image, displayed in the GUI uvmat
Note: See TracChangeset
for help on using the changeset viewer.