Changeset 88 for trunk/src/geometry_calib.m
- Timestamp:
- May 9, 2010, 10:40:18 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r84 r88 954 954 grid_input=CalibData.grid;%retrieve the previously used grid 955 955 end 956 [T,CalibData.grid]=create_grid(grid_input );%display the GUI create_grid956 [T,CalibData.grid]=create_grid(grid_input,'detect grid');%display the GUI create_grid 957 957 set(handles.geometry_calib,'UserData',CalibData)%store the phys grid for later use 958 958 … … 1012 1012 %Amax=max(max(Amod)) 1013 1013 %image(Rangx,Rangy,uint8(255*Amod/Amax)) 1014 ind_range=10;% range of search of image ma around each point obtained by linear interpolation from the marked points 1014 Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space 1015 Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space 1016 ind_range_x=ceil(GeometryCalib.R(1,1)*CalibData.grid.Dx/3)% range of search of image ma around each point obtained by linear interpolation from the marked points 1017 ind_range_y=ceil(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 1015 1018 nbpoints=size(T,1); 1016 1019 for ipoint=1:nbpoints 1017 Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space1018 Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space1019 1020 i0=1+round((T(ipoint,1)-Rangx(1))/Dx);%round(Xpx(ipoint)); 1020 1021 j0=1+round((T(ipoint,2)-Rangy(1))/Dy);%round(Xpx(ipoint)); 1021 Asub=Amod(j0-ind_range :j0+ind_range,i0-ind_range:i0+ind_range);1022 Asub=Amod(j0-ind_range_y:j0+ind_range_y,i0-ind_range_x:i0+ind_range_x); 1022 1023 x_profile=sum(Asub,1); 1023 1024 y_profile=sum(Asub,2); … … 1027 1028 x_shift=0; 1028 1029 y_shift=0; 1029 if ind_x_max+2<=2*ind_range +1 && ind_x_max-2>=11030 if ind_x_max+2<=2*ind_range_x+1 && ind_x_max-2>=1 1030 1031 Atop=x_profile(ind_x_max-2:ind_x_max+2); 1031 1032 x_shift=sum(Atop.*[-2 -1 0 1 2])/sum(Atop); 1032 1033 end 1033 if ind_y_max+2<=2*ind_range +1 && ind_y_max-2>=11034 if ind_y_max+2<=2*ind_range_y+1 && ind_y_max-2>=1 1034 1035 Atop=y_profile(ind_y_max-2:ind_y_max+2); 1035 1036 y_shift=sum(Atop.*[-2 -1 0 1 2]')/sum(Atop); 1036 1037 end 1037 Delta(ipoint,1)=(x_shift+ind_x_max-ind_range -1)*Dx;%shift from the initial guess1038 Delta(ipoint,2)=(y_shift+ind_y_max-ind_range -1)*Dy;1038 Delta(ipoint,1)=(x_shift+ind_x_max-ind_range_x-1)*Dx;%shift from the initial guess 1039 Delta(ipoint,2)=(y_shift+ind_y_max-ind_range_y-1)*Dy; 1039 1040 end 1040 1041 Tmod=T(:,(1:2))+Delta; … … 1078 1079 end 1079 1080 Tabchar=cell2tab(Coord,' | '); 1080 Tabchar=[Tabchar {'.....'}];1081 Tabchar=[Tabchar; {'.....'}]; 1081 1082 %set(handles.ListCoord,'Value',1) 1082 1083 set(handles.ListCoord,'String',Tabchar)
Note: See TracChangeset
for help on using the changeset viewer.