Ignore:
Timestamp:
Mar 24, 2010, 12:36:53 PM (11 years ago)
Author:
sommeria
Message:

minor improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r61 r62  
    929929data=read_geometry_calib(Coord_cell);
    930930nbpoints=size(data.Coord,1); %nbre of calibration points
    931 if nbpoints<4
    932     msgbox_uvmat('ERROR','four points must be selected by the mouse to delimitate the detection area')
     931if nbpoints~=4
     932    msgbox_uvmat('ERROR','four points must be selected by the mouse, beginning by the new x axis, to delimitate the phs grid area')
    933933end
    934934corners_X=(data.Coord(end-3:end,4)); %pixel absissa of the four corners
    935935corners_Y=(data.Coord(end-3:end,5));
     936
     937%reorder the last two points if needed
     938angles=angle((corners_X-corners_X(1))+i*(corners_Y-corners_Y(1));
     939if abs(angles(4)-angles(2))>abs(angles(3)-angles(2))
     940      X_end=corners_X(4);
     941      Y_end=corners_Y(4);
     942      corners_X(4)=corners_X(3);
     943      corners_Y(4)=corners_Y(3);
     944      corners_X(3)=X_end;
     945      corners_Y(3)=Y_end;
     946end
    936947
    937948%read the current image
Note: See TracChangeset for help on using the changeset viewer.