Changes between Version 41 and Version 42 of Tutorial/GeometricCalibration


Ignore:
Timestamp:
Jan 26, 2015, 11:11:52 AM (6 years ago)
Author:
vaillant1p
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorial/GeometricCalibration

    v41 v42  
    3131To repeat the calibration for several image series obtained with the same camera at the same position, different methods can be used.
    3232
    33 - Copy the xml to the appropriate location, with the same name (but extension .xml) and path as the flle containing the image series. This is however not appropriate in general as the xml file contains other information, in particular about image timing. 
     33- Copy the xml to the appropriate location, with the same name (but extension .xml) and path as the flle containing the image series. This is however not appropriate in general as the xml file contains other information, in particular about image timing.
    3434
    3535- Open with '''uvmat''' one of the image of the series to calibrate, select '''[Tools/geometric calibration]''', and in the GUI '''geometry_calib''', the menu bar '''[!Import/All]''', then press''' [APPLY]'''. For further repetitions, the GUI '''geometry_calib''' can be left opened while new image series are opened, and '''[APPLY]''' repeated each time without importing the calibration data again. [[BR]]
    3636
    3737- In case of many image series, use '''[REPLICATE]''' instead of '''[APPLY]''' in the GUI '''geometry_calib'''. Then select the 'campaign' to calibrate, i.e. the folder containing the series of experiments. Then in the new GUI '''browse_data''', select the set of experiments and the corresponding set of data series to which the calibration must apply (this is used like '''[Open campaign]''' in '''uvmat''').
    38 
    3938
    4039== Calibration with reference points ==
     
    5554To improve the precision we then apply the option 'linear' in '''calib_type''', which seeks a general linear transform, including rotation. The precision is indeed improved to about 1 pixel. The previous xml file has been saved with a ~, ('Dalsa1.xml~') so it can be reverted in case of error.
    5655
    57 == Calibration with a target grid ==
     56== 3D calibration with a target grid ==
    5857Most precise and general calibration relies on the use of a target grid. As an example, open in uvmat the image ima_6 in 'UVMAT_DEMO07_GeometryCalibration/Angles/Dalsa1' (accessible on http://servforge.legi.grenoble-inp.fr/pub/soft-uvmat/). Open the menu bar '''[Tools/geometric calibration] '''and pick four corner points ABCD with the mouse define the periphery of the phys grid selected for calibration. The first point A will define the phys axis origin while AB defines the x axis and AD the y axis. AB and DC should be parallel on the phys grid (see fig). Then select''' [!Tools/Detect grid] '''on the upper menu bar of''' geometry_calib''': you get a new GUI '''detect_grid''' in which you define (in phys units) the grid mesh and the positions of the  first and last points on each axis. A z position can be defiend as well, do not fill it in this example. The option white markers is selected (by default) indicating that the grid is white (the opposite option would be needed for a grid made of black crosses on a white background). After validation by '''[OK]''', the detected grid appears on uvmat.
    5958
     
    6665Once the grid has been marked, the calibration can be performed by the press button '''[APPLY]'''. We observe that the simple option 'rescale' is not appropriate in this case: a perspective effect is clearly visible, together with a non-linear deformation (grid lines are curved on the image). Therefore select the option '3D_quadr' which applies a 3D projection and quadratic correction. The grid image now appears of good quality in phys coordinates.
    6766
     67This 3D calibration relies on the [https://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/search?q=attachment%3A3D_view.pdf pinhole camera model] (see [https://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/search?q=wiki%3AUvmatHelp%23GeometryCalib UvmatHelp#GeometryCalib] section 8.1). It involves ''intrinsic parameters'' which characterize the optical system (camera and objective lens) and ''extrinsic parameters'' which describe the translation and rotation of the camera with respect to the physical coordinates. detailler sur le GUI. The intrinsic parameters are shown in the frame '''[Intrinsic Parameters] '''in the GUI '''geometry_calib'''. These are the focal lenghts (in pixel size on the sensor) '''[fx]''' and '''[fy]''',  the quadratic radial distortion coefficient '''[kc]''' and the coordinates '''[Cx]''' and '''[Cy]''' of the optical centre for this distortion (expressed in pixels on the image).
    6868
    69 '''Note:''' if the serie is missing some images (ie the increment from one image to another is not steady), '''uvmat''' will not allow you to use the arrow '''[->]''' to move from an image to another if the increment is set. To avoid this delete the number in [increment], you will then be able to go from an image to another.
     69== 3D calibration improved by multiple planes: ==
     70The calibration of previous section provides 3D information thanks to the inclination of the calibration grid, but the precision is not optimum, and the process would not converge for a grid perpendicular to the line of view. A more precise procedure consists in first determining the intrinsic parameters by mutiple views of the same grid with different inclinations, as shown in the example **.
    7071
    71 == 3D calibration with multiple planes: ==
     72Open su the grid image is correctly set, click on the '''[APPEND LIST]''' button in '''[Point Lists]'''. This will save the grid as 'img~.xml'. This document is saved in the same folder as the image. To open this document select '''[Import.../Calibration points]'''.
    7273
    73 The calibration of previous section provides 3D information thanks to the inclination of the calibration grid, but the precision is not optimum, and the process would not converge for a grid perpendicular to the line of view. A more precise procedure consists in first determining the intrinsic parameters by mutiple views of the same grid with different inclinations, as shown in the example **.
    74 
    75  with a corrects for 3D projection effects and gives some 3D indication. This is however made more precise by introducing different views of the same grid with different orientations, like shown in mages 1 to 5.
    76 The 3D options involve a full 3D calibration relying on the [attachment:3D_view.pdf pinhole camera model] (see [wiki:UvmatHelp#GeometryCalib] section 8.1).
    77 
    78 Once the grid image is correctly set, click on the '''[APPEND LIST]''' button in '''[Point Lists]'''. This will save the grid as 'img~.xml'. This document is saved in the same folder as the image. To open this document select '''[Import.../Calibration points]'''.
    79 
    80 Durind the calibration, some intrinsic parameters are determined and shown in [Intrinsic Parameters] in '''geometry_calib'''. These are the focal lenghts (in pixels on the captor) '''[fx]''' and '''[fy]''', the coordinates of the principal point center '''[Cx]''' and '''[Cy]''' and the radial distortion coefficient (due to the quadratic calibration) '''[kc]'''.
     74Durind the calibration, some intrinsic parameters are determined 
    8175
    8276Now that the calibration is made for the first image we need to do it for the other ones (you can also open the different grids 'img.ref~.xml' to skip the calibration). Once a document is open, the grid is shown in '''uvmat''', to save it in the '''[Point Lists]''' click on '''[APPEND LIST]''', it will appear below the first saved document.
     
    8680For the next calibration, to avoid any change on the intrinsic parameters, select the option '''3D_extrinsic'''. It applies a 3D projection and quadratic correction according to the intrinsic parameters.
    8781
     82'''Note:''' if the serie is missing some images (ie the increment from one image to another is not steady), '''uvmat''' will not allow you to use the arrow '''[->]'''  to move from an image to another if the increment is set. To avoid this  delete the number in [increment], you will then be able to go from an  image to another.
     83
    8884'''Note:''' These corrections take the hypothesis of ''z=0''. If you want to change and set the correct height of the grid, select '''[!Tools/Translate points]''' in '''geometry_calib''' and enter the correct value of ''z''.
    8985
    90 
    9186== '''Merging the images of several cameras:''' ==
    92 
    93 
    9487z position}}
    9588