Ignore:
Timestamp:
May 9, 2010, 10:40:18 AM (14 years ago)
Author:
sommeria
Message:

plot_field: test for multicomponent image (-> errormsg)
creat_grid: possibility of changing the figure name (for detect_grid)
geometry_calib: detect_grid improved (range of search adjusted from grid mesh)

bug repaired in translate points

uvmat: bug repair: dela with the case with several get_field GUI opened

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r84 r88  
    954954    grid_input=CalibData.grid;%retrieve the previously used grid
    955955end
    956 [T,CalibData.grid]=create_grid(grid_input);%display the GUI create_grid
     956[T,CalibData.grid]=create_grid(grid_input,'detect grid');%display the GUI create_grid
    957957set(handles.geometry_calib,'UserData',CalibData)%store the phys grid for later use
    958958
     
    10121012%Amax=max(max(Amod))
    10131013%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
     1014Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space
     1015Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space
     1016ind_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
     1017ind_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
    10151018nbpoints=size(T,1);
    10161019for ipoint=1:nbpoints
    1017     Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space
    1018     Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space
    10191020    i0=1+round((T(ipoint,1)-Rangx(1))/Dx);%round(Xpx(ipoint));
    10201021    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);
    10221023    x_profile=sum(Asub,1);
    10231024    y_profile=sum(Asub,2);
     
    10271028    x_shift=0;
    10281029    y_shift=0;
    1029     if ind_x_max+2<=2*ind_range+1 && ind_x_max-2>=1
     1030    if ind_x_max+2<=2*ind_range_x+1 && ind_x_max-2>=1
    10301031        Atop=x_profile(ind_x_max-2:ind_x_max+2);
    10311032        x_shift=sum(Atop.*[-2 -1 0 1 2])/sum(Atop);
    10321033    end
    1033     if ind_y_max+2<=2*ind_range+1 && ind_y_max-2>=1
     1034    if ind_y_max+2<=2*ind_range_y+1 && ind_y_max-2>=1
    10341035        Atop=y_profile(ind_y_max-2:ind_y_max+2);
    10351036        y_shift=sum(Atop.*[-2 -1 0 1 2]')/sum(Atop);
    10361037    end
    1037     Delta(ipoint,1)=(x_shift+ind_x_max-ind_range-1)*Dx;%shift from the initial guess
    1038     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;
    10391040end
    10401041Tmod=T(:,(1:2))+Delta;
     
    10781079end
    10791080Tabchar=cell2tab(Coord,'    |    ');
    1080 Tabchar=[Tabchar {'.....'}];
     1081Tabchar=[Tabchar; {'.....'}];
    10811082%set(handles.ListCoord,'Value',1)
    10821083set(handles.ListCoord,'String',Tabchar)
Note: See TracChangeset for help on using the changeset viewer.