Ignore:
Timestamp:
Jun 21, 2024, 4:51:59 PM (7 days ago)
Author:
sommeria
Message:

civ_3D corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r1143 r1148  
    982982end
    983983
     984
     985
     986%% read the current image, displayed in the GUI uvmat
     987huvmat=findobj(allchild(0),'Name','uvmat');
     988UvData=get(huvmat,'UserData');
     989A=UvData.Field.A;%currently displayed image
     990npxy=size(A);
     991
    984992%% initiate the grid in phys coordinates
    985993CalibData=get(handles.geometry_calib,'UserData');%get information stored on the GUI geometry_calib
     
    987995if isfield(CalibData,'grid')
    988996    grid_input=CalibData.grid;%retrieve the previously used grid
     997else
     998   %S=skewness(double(reshape(A,1,[])));
     999   A=double(A);
     1000   A=A-mean(mean(A));
     1001   S=mean(mean(A.*A.*A))/(mean(mean(A.*A)))^1.5
     1002   grid_input.CheckWhite=sign(S);%propose white markers if image skewness>0, black markers otherwise
    9891003end
    9901004[T,CalibData.grid,CalibData.grid.CheckWhite,CalibData.grid.FilterWindow]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T
     
    9921006X=[CalibData.grid.x_0 CalibData.grid.x_1 CalibData.grid.x_0 CalibData.grid.x_1]';%corner absissa in the phys coordinates (cm)
    9931007Y=[CalibData.grid.y_0 CalibData.grid.y_0 CalibData.grid.y_1 CalibData.grid.y_1]';%corner ordinates in the phys coordinates (cm)
    994 
    995 %% read the current image, displayed in the GUI uvmat
    996 huvmat=findobj(allchild(0),'Name','uvmat');
    997 UvData=get(huvmat,'UserData');
    998 A=UvData.Field.A;%currently displayed image
    999 npxy=size(A);
    10001008
    10011009%% calculate transform matrices for plane projection: rectangle assumed to be viewed in perspective
     
    10341042Rangx=DataOut.Coord_x;% x coordinates of first and last pixel centres in phys
    10351043Rangy=DataOut.Coord_y;% y coordinates of first and last pixel centres in phys
     1044
     1045
     1046%% inverse the image in the case of black lines
    10361047if CalibData.grid.CheckWhite
    10371048    Amod=double(Amod);%case of white grid markers: will look for image maxima
Note: See TracChangeset for help on using the changeset viewer.