Changeset 1148 for trunk/src/geometry_calib.m
- Timestamp:
- Jun 21, 2024, 4:51:59 PM (7 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r1143 r1148 982 982 end 983 983 984 985 986 %% read the current image, displayed in the GUI uvmat 987 huvmat=findobj(allchild(0),'Name','uvmat'); 988 UvData=get(huvmat,'UserData'); 989 A=UvData.Field.A;%currently displayed image 990 npxy=size(A); 991 984 992 %% initiate the grid in phys coordinates 985 993 CalibData=get(handles.geometry_calib,'UserData');%get information stored on the GUI geometry_calib … … 987 995 if isfield(CalibData,'grid') 988 996 grid_input=CalibData.grid;%retrieve the previously used grid 997 else 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 989 1003 end 990 1004 [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 … … 992 1006 X=[CalibData.grid.x_0 CalibData.grid.x_1 CalibData.grid.x_0 CalibData.grid.x_1]';%corner absissa in the phys coordinates (cm) 993 1007 Y=[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 uvmat996 huvmat=findobj(allchild(0),'Name','uvmat');997 UvData=get(huvmat,'UserData');998 A=UvData.Field.A;%currently displayed image999 npxy=size(A);1000 1008 1001 1009 %% calculate transform matrices for plane projection: rectangle assumed to be viewed in perspective … … 1034 1042 Rangx=DataOut.Coord_x;% x coordinates of first and last pixel centres in phys 1035 1043 Rangy=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 1036 1047 if CalibData.grid.CheckWhite 1037 1048 Amod=double(Amod);%case of white grid markers: will look for image maxima
Note: See TracChangeset
for help on using the changeset viewer.