440 | | The names of the created objects are listed in the menu '''[!ListObject]'''. The properties of the object selected in this menu can be viewed by activating the check box '''[!CheckViewObject]'''. Check '''[!CheckEditObject]''' to allow object editing with '''set_object.fig'''. The selected object is plotted in magenta, while the inactive ones are in blue. The field plot resulting from projection can be viewed in the GUI view_field.fig by activating '''[!CheckViewField]'''. This option is automatically selected when a new object is created. Then the projection object used for the main plotting window in UVMAT can be selected by the menu '''[!ListObject_1]''' which reproduces the list of available objects. The active objects are plotted in magenta, while the inactive ones are in blue.The object can be deleted by pressing '''[DeleteObject]'''. |
441 | | |
442 | | The properties of the projection objects can be extracted as a Matlab structure using the menu bar command '''[Export/field in workspace]''' of '''uvmat.fig'''. Those are contained in the cell of structures ''Data_uvmat.[wiki:ProjObject]''. |
| 440 | The names of the created objects are listed in the menu '''[!ListObject]'''. The properties of the object selected in this menu can be viewed by activating the check box '''[!CheckViewObject]'''. Check '''[!CheckEditObject]''' to allow object editing with '''set_object.fig'''. The selected object is plotted in magenta, while the inactive ones are in blue. The field plot resulting from projection can be viewed in the GUI view_field.fig by activating '''[!CheckViewField]'''. This option is automatically selected when a new object is created. Then the projection object used for the main plotting window in UVMAT can be selected by the menu '''[!ListObject_1]''' which reproduces the list of available objects. The active objects are plotted in magenta, while the inactive ones are in blue.The object can be deleted by pressing '''[[wiki:DeleteObject !DeleteObject]]'''. |
| 441 | |
| 442 | The properties of the projection objects can be extracted as a Matlab structure using the menu bar command '''[Export/field in workspace]''' of '''uvmat.fig'''. Those are contained in the cell of structures ''Data_uvmat.[wiki:ProjObject !ProjObject]''. |
458 | | * ''' !ProjMode: ''': specifies the method of projection of coordinates and field, as described in [#a6.3Projectionmodes next sub-section]. |
459 | | |
460 | | * ''' Angle: ''': three component rotation vector which defines the orientation of the object coordinate axis, for 'plane' and 'volume'. In 2D, this rotation vector has only one component along z, defining a rotation angle in the plane (expressed in degrees). This applies also to the main axis of 'ellipse' and 'rectangle'. In 3D, line objects ('line', 'polyline','rectangle','polygon','ellipse') are assumed contained in a plane, and 'Angle' defines the orientation of this plane. |
| 458 | * ''' !ProjMode: '''specifies the method of projection of coordinates and field, as described in [#a6.3Projectionmodes next sub-section]. |
| 459 | |
| 460 | * ''' Angle: '''three component rotation vector which defines the orientation of the object coordinate axis, for 'plane' and 'volume'. In 2D, this rotation vector has only one component along z, defining a rotation angle in the plane (expressed in degrees). This applies also to the main axis of 'ellipse' and 'rectangle'. In 3D, line objects ('line', 'polyline','rectangle','polygon','ellipse') are assumed contained in a plane, and 'Angle' defines the orientation of this plane. |
468 | | * 'volume': RangeX, RangeY, rangeZ (two values each) define a selected volume in the data set. |
469 | | |
470 | | * ''' DX: ''', ''' DY: ''', ''' DZ: ''':mesh along each coordinate defining a grid for interpolation. |
471 | | |
472 | | * ''' Coord: ''': matrix with two (for 2D fields) or three columns defining the object position. |
| 468 | * 'volume': RangeX, RangeY, RangeZ (two values each) define a selected volume in the data set. |
| 469 | |
| 470 | * ''' DX: ''', ''' DY: ''', ''' DZ: '''mesh along each coordinate defining a grid for interpolation. |
| 471 | |
| 472 | * ''' Coord: ''' matrix with two (for 2D fields) or three columns defining the object position. |
547 | | -'''scalar:''' to plot scalar fields as images. The variable representing the scalar is selected in the first column '''[scalar]''', with coordinates respectively selected in '''[Coord_x] ''' and '''[Coord_y]'''. Alternatively, matrix index can be used as coordinate if the options '''[matrix index]'''('''[!CheckDimensionX]''' and '''[!CheckDimensionY]''') are selected. |
548 | | |
549 | | -'''vectors:''' to plot vector fields. The x and y vector components are selected in the first (...) and second columns, while the coordiantes are selected in '''[coord_x_vector] ''' and '''[coord_y_vector]'''. If no variable is selected in '''[coord_x_scalar] ''' or '''[coord_y_scalar] ''' ( blank selected at first line), the index is used as coordinate. A scalar, set in ..., can be represented as vector color. |
550 | | |
551 | | The attribute or variable considered as 'time' can be also chosen in the Panel '''[Time]'''. From the menu '''[!SwitchVarIndexTime]''', the time can be considered as the ''file index'', a global ''attribute'', a dimension ''variable'', or a ''dimension index''. Selection of ''attribute'' gives way to a list of global attribute tags in the menu '''[!TimeName]'''. Selection of variable gives way to a list of vartiables, while selection of ''dimension'' gives a list of dimension names. |
552 | | |
553 | | In the case of a 3D input field, the fig is set to uvmat. A middle plane of cut is automatically selected. This can be moved then with the slider on the interface set_object (see section 5). The default cuts are made at constant z coordiante, but any of the three initial coordiantes can be used as z coordinate, using the menu coord_z. |
| 547 | -'''scalar:''' to plot scalar fields as images. The variable representing the scalar is selected in the first column '''[scalar]''', with coordinates respectively selected in '''[Coord_x] ''' and '''[Coord_y]'''. Alternatively, matrix index can be used as coordinate if the options '''[matrix index]'''('''[CheckDimensionX]''' and '''[CheckDimensionY]''') are selected. |
| 548 | |
| 549 | -'''vectors:''' to plot vector fields. The x and y vector components are selected in the first (...) and second columns, while the coordinates are selected in '''[coord_x_vector] ''' and '''[coord_y_vector]'''. If no variable is selected in '''[coord_x_scalar] ''' or '''[coord_y_scalar] ''' ( blank selected at first line), the index is used as coordinate. A scalar, set in ..., can be represented as vector color. |
| 550 | |
| 551 | The attribute or variable considered as 'time' can be also chosen in the Panel '''[Time]'''. From the menu '''[!SwitchVarIndexTime]''', the time can be considered as the ''file index'', a global ''attribute'', a dimension ''variable'', or a ''dimension index''. Selection of ''attribute'' gives way to a list of global attribute tags in the menu '''[!TimeName]'''. Selection of variable gives way to a list of variables, while selection of ''dimension'' gives a list of dimension names. |
| 552 | |
| 553 | In the case of a 3D input field, the fig is set to uvmat. A middle plane of cut is automatically selected. This can be moved then with the slider on the interface set_object (see section 5). The default cuts are made at constant z coordiante, but any of the three initial coordinates can be used as z coordinate, using the menu coord_z. |
574 | | The 3D options involve a full 3D calibration relying on the [attachment:3D_view.pdf pinhole camera model]. The method was first proposed by R.Y. Tsai, 'An Efficient and Accurate Camera Calibration Technique for 3D Machine Vision'. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, Miami Beach, FL, pp. 364-374, 1986). We use a more recent version, with the toolbox [->http://www.vision.caltech.edu/bouguetj/calib_doc/] . 3D calibrations are done in two steps. The camera'' intrinsic parameters'', which are the focal length and the quadratic deformation coefficient, are first determined by different views of the same grid observed at different angles. Then the ''extrinsic parameters'', which represent the rotation angles and translation of the physical coordinates with respect to the camera, are obtained with a single image of the grid positioned in a known plane $z=cte$. The option 3D_extrinsic allows the user to do only the second step from known intrinsic parameters. Those depend only on the camera with its objective lens and focus adjustement. Note that these 3D options require a calibration grid, with a sufficient number of calibration points covering the whole image. |
| 574 | The 3D options involve a full 3D calibration relying on the [attachment:3D_view.pdf pinhole camera model]. The method was first proposed by R.Y. Tsai, 'An Efficient and Accurate Camera Calibration Technique for 3D Machine Vision'. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, Miami Beach, FL, pp. 364-374 (1986). We use a more recent version, with the toolbox [->http://www.vision.caltech.edu/bouguetj/calib_doc/] . 3D calibrations are done in two steps. The camera'' intrinsic parameters'', which are the focal length and the quadratic deformation coefficient, are first determined by different views of the same grid observed at different angles. Then the ''extrinsic parameters'', which represent the rotation angles and translation of the physical coordinates with respect to the camera, are obtained with a single image of the grid positioned in a known plane $z=cte$. The option 3D_extrinsic allows the user to do only the second step from known intrinsic parameters. Those depend only on the camera with its objective lens and focus adjustement. Note that these 3D options require a calibration grid, with a sufficient number of calibration points covering the whole image. |
585 | | -'''Simple scaling''': a simple scaling, in pixels/cm, can be introduced by the menubar command '''[Tools/Set scale]''', which displays a set of four reference points in the table '''[!ListCoord]'''. The tool 'ruler', from the menu bar command '''[Tools/ruler]''' of '''uvmat.fig''', can be useful to get the scaling. The default origin of the physical coordinates is set by default to the lower left image corner. Use the tool 'translate points', described below, to change the origin. |
| 585 | -'''Simple scaling''': a simple scaling, in pixels/cm, can be introduced by the menubar command '''[Tools/Set scale]''', which displays a set of four reference points in the table '''[!!ListCoord]'''. The tool 'ruler', from the menu bar command '''[Tools/ruler]''' of '''uvmat.fig''', can be useful to get the scaling. The origin of the physical coordinates is set by default to the lower left image corner. Use the tool 'translate points', described below, to change the origin. |
595 | | -''' Translation and rotation of calibration points: '''In general A translation or rotation (in physical space) can be introduced by the menu bar commands '''[!Tools/Translate points]''' and '''[!Tools/Rotate points]'''. In the case of rotation, the origin of the rotation, as well as the angle (in degree) must be introduced. The resulting coordinates appear in the list '''[!ListCoord]'''. |
596 | | |
597 | | -''' Recording calibration parameters: ''' Once the list of calibration points has been completed, press '''[APPLY]''', after selecting the appropriate option in '''[calib_type]'''. (see the previous [#a8.1Generalities sub-section 8.1]). Note that the 3D options require a sufficient number of calibration points (typically > 10) spread over the image with different values of z, or a tilted grid, see below. Calibration coefficients are recorded in the XML file <!ImaDoc> associated with the image currently opened by UVMAT. If previous calibration data already exist, the previous XML file is updated, but the original one is preserved with the extension .xml~. If no XML file already exists, it is created. The image transformation to phys coordinates can be directly seen on the '''uvmat.fig''' interface after completion of the command '''[APPLY]'''. |
| 595 | -''' Translation and rotation of calibration points: '''a translation or rotation (in physical space) can be introduced by the menu bar commands '''[!Tools/Translate points]''' and '''[!Tools/Rotate points]'''. In the case of rotation, the origin of the rotation, as well as the angle (in degree) must be introduced. The resulting coordinates appear in the list '''[!ListCoord]'''. |
| 596 | |
| 597 | -''' Recording calibration parameters: ''' Once the list of calibration points has been completed, press '''[APPLY]''', after selecting the appropriate option in '''[calib_type]''' (see the previous [#a8.1Generalities sub-section 8.1]). Note that the 3D options require a sufficient number of calibration points (typically > 10) spread over the image with different values of z, or a tilted grid, see below. Calibration coefficients are recorded in the XML file <!ImaDoc> associated with the image currently opened by UVMAT. If previous calibration data already exist, the previous XML file is updated, but the original one is preserved with the extension .xml~. If no XML file already exists, it is created. The image transformation to phys coordinates can be directly seen on the '''uvmat.fig''' interface after completion of the command '''[APPLY]'''. |
601 | | To calibrate at once a set of experiments, a better alternative is the command '''[REPLICATE]'''. Open a folder '''Campaign''', parent of the folders '''Experiment''' to treat. The GUI '''data_browser.fig''', also described in [#a3.7Dataorganisationinaproject section 3.7], then pops up. A two-column display appears, with the list of '''Experiments''' on the left and the list of corresponding '''DataSeries''' on the right. Select the list of experiments to calibrate, and a single camera name in '''DataSeries''', then validate by pressing '''OK'''. |
602 | | |
603 | | -'''3D calibration''': 3D projection is handled by the options in '''[calib_type]''' '3D_lin' or '3D_quad' ((if non-linear distortion is significant). By default, the set of calibration points is assumed to be contained in a single plane ''z''=0. For a correct determination of the 3D features, the normal to this plane must be tilted with respect to the line of view. Otherwise this problem of indetermination can be resolved by using a set of (typically 5-10) calibrations images using a plane grid with different tilting angles (for precision the grid must cover a large area of the view field). On each image, get calibration points with the tool '''[!Tools/Detect grid]''', introducing the appropriate grid mesh. Do not fill info on ''z'' coordinates. Store the points each time (without applying calibration at this stage), which fills the list [ListCoordFiles] of file names. Then introduce a last grid image which will be considered as defining the orientation of the ''z'' axis, perpendicular to the grid. Detect points on this last image, but instead of storing them, apply the calibration with the option 3D_linear or 3D_quadr. A non-zero ''z'' position of this grid can be introduced by a z translation performed with '''Tools/Translate points'''. |
604 | | |
605 | | -'''Intrinsic parameters''': the previous procedure first determines the extrinsic parameters which characterize the camera optics (focal lengths and nonlinear deformation parameter). Then the extrinsic parameters, translation and rotation of the camera with respect to the reference grid, are determined on the last grid image. if the same optics is used in a new experiment, it is possible to skip the multiplane detection, importing the intrinsic parameters from a previous <!ImaDoc> file by the menu bar tool '''[!Import/Intrinsic]''' parameters, then applying the calibration with the option '3D_extrinsic' with the reference grid image only. |
606 | | |
607 | | -'''Section planes:''' deducing the physical coordinates from image coordinates requires information on the section plane. The default assumption is that the objects in the image are in the plane used for calibration, but uvmat can handle volume scanning by a laser plane. A set of section planes can be defined by their origin positions and rotation angle vectors. Theses planes are labelled by a ''z index'', assumed to be the frame index j (case of volume scan), or the index i modulo the number of slices !NbSlice (case of 'multilevel' scan). These settings are stored in the xml file <!ImaDoc> as part of the section <!GeometryCalib> and can be edited from '''uvmat.fig''' with the menu bar command '''[Tools/set slice]'''. A dialog box '''set_slices''' appears for entering the first and last section plane positions ''z'', as well as the number of slices and the option 'volume_scan' ('multilevel' otherwise). In the absence of 3D scan put twice the same value for first and last z. Finally a tilt angle of the laser sheet, around the ''x'' and ''y'' axis, can be introduced, with a possible angular scanning from first to last section planes. After introduction of the plane position information, the z-index is displayed in the frame '''[FileIndices]''' of '''uvmat.fig'''. The local ''z'' position of the mouse pointer, assumed to lay on the current section plane, is then displayed in '''[text_display]'''. |
| 601 | To calibrate at once a set of experiments, a better alternative is the command '''[REPLICATE]'''. Open a folder '''Campaign''', parent of the folders '''Experiment''' to treat. The GUI '''data_browser.fig''', also described in [#a3.7Dataorganisationinaproject section 3.7], then pops up. A two-column display appears, with the list of '''Experiments''' on the left and the list of corresponding '''[wiki:DataSeries !DataSeries]''' on the right. Select the list of experiments to calibrate, and a single camera name in '''[wiki:DataSeries !DataSeries]''', then validate by pressing '''OK'''. |
| 602 | |
| 603 | -'''3D calibration''': 3D projection is handled by the options in '''[calib_type]''' '3D_lin' or '3D_quad' (if non-linear distortion is significant). By default, the set of calibration points is assumed to be contained in a single plane ''z''=0. For a correct determination of the 3D features, the normal to this plane must be tilted with respect to the line of view. Otherwise this problem of indetermination can be resolved by using a set of (typically 5-10) calibrations images using a plane grid with different tilting angles (for precision the grid must cover a large area of the view field). On each image, get calibration points with the tool '''[!Tools/Detect grid]''', introducing the appropriate grid mesh. Do not fill info on ''z'' coordinates. Store the points each time (without applying calibration at this stage), which fills the list [! ListCoordFiles] of file names. Then introduce a last grid image which will be considered as defining the orientation of the ''z'' axis, perpendicular to the grid. Detect points on this last image, but instead of storing them, apply the calibration with the option 3D_linear or 3D_quadr. A non-zero ''z'' position of this grid can be introduced by a z translation performed with '''!Tools/Translate points'''. |
| 604 | |
| 605 | -'''Intrinsic parameters''': the previous procedure first determines the extrinsic parameters which characterize the camera optics (focal lengths and nonlinear deformation parameter). Then the extrinsic parameters, translation and rotation of the camera with respect to the reference grid, are determined on the last grid image. If the same optics is used in a new experiment, it is possible to skip the multiplane detection, importing the intrinsic parameters from a previous <!ImaDoc> file by the menu bar tool '''[!Import/Intrinsic]''' parameters, then applying the calibration with the option '3D_extrinsic' with the reference grid image only. |
| 606 | |
| 607 | -'''Section planes:''' deducing the physical coordinates from image coordinates requires information on the section plane. The default assumption is that the objects in the image are in the plane used for calibration, but uvmat can handle volume scanning by a laser plane. A set of section planes can be defined by their origin positions and rotation angle vectors. Theses planes are labelled by a ''z index'', assumed to be the frame index j (case of volume scan), or the index i modulo the number of slices !NbSlice (case of 'multilevel' scan). These settings are stored in the xml file <!ImaDoc> as part of the section <!GeometryCalib> and can be edited from '''uvmat.fig''' with the menu bar command '''[Tools/set slice]'''. A dialog box '''set_slices''' appears for entering the first and last section plane positions ''z'', as well as the number of slices and the option 'volume_scan' ('multilevel' otherwise). In the absence of 3D scan put twice the same value for first and last z. Finally a tilt angle of the laser sheet, around the ''x'' and ''y'' axis, can be introduced, with a possible angular scanning from first to last section planes. After introduction of the plane position information, the z-index is displayed in the frame '''[[wiki:FileIndices !FileIndices]]''' of '''uvmat.fig'''. The local ''z'' position of the mouse pointer, assumed to lay on the current section plane, is then displayed in '''[text_display]'''. |
634 | | * <!ErrorMax> : maximum difference (in X and Y direction) between the image coordinates measured for the calibration points and the coordinates transformed from their physical coordinates. (using the function ''px_XYZ.m'' in UVMAT). |
635 | | |
636 | | * <!SourceCalib> set of the point coordinates used for calibration. |
637 | | |
638 | | * <!PointCoord> [x y z X Y] , where x,y,z are the physical coordinates of each point, X Y its image coordinates. |
639 | | |
640 | | * <!NbSlice_i> nbre of slices for the first field index i (multilevel case), =1 by default. |
641 | | |
642 | | * <!NbSlice_j> nbre of slices for the second index j (volume scan), =1 by default. |
643 | | |
644 | | * <!SliceCoord> [x y z] positions (nb lines) of the nb planes, where nb=NbSlice_i (multilevel case) or nb=NbSlice_j of j indices (volume scan), for parallel volume scan, x=y=0, z= slice height, for angular scan, [x,y,z]=[origin]. |
645 | | |
646 | | * <SliceDZ> step distance between planes. |
647 | | |
648 | | * <SliceDPhi> step angle for angular scan. |
| 634 | * <!ErrorMax>: maximum difference (in X and Y direction) between the image coordinates measured for the calibration points and the coordinates transformed from their physical coordinates (using the function ''px_XYZ.m'' in UVMAT). |
| 635 | |
| 636 | * <!SourceCalib>: set of the point coordinates used for calibration. |
| 637 | |
| 638 | * <!PointCoord>: [x y z X Y] , where x,y,z are the physical coordinates of each point, X Y its image coordinates. |
| 639 | |
| 640 | * <!NbSlice_i>: nbre of slices for the first field index i (multilevel case), =1 by default. |
| 641 | |
| 642 | * <!NbSlice_j>: nbre of slices for the second index j (volume scan), =1 by default. |
| 643 | |
| 644 | * <!SliceCoord>: [x y z] positions (nb lines) of the nb planes, where nb=[wiki:NbSlice !NbSlice]_i (multilevel case) or nb=[wiki:NbSlice !NbSlice]_j of j indices (volume scan), for parallel volume scan, x=y=0, z= slice height, for angular scan, [x,y,z]=[origin]. |
| 645 | |
| 646 | * <SliceDZ>: step distance between planes. |
| 647 | |
| 648 | * <SliceDPhi>: step angle for angular scan. |
652 | | Mask files are used to restrict the domain of CIV processing, to take into account fluid boundaries or invalid image zones. They must be stored as .png images with 8 bits, as described in [section 3.6->#sec3.6_mask]. Mas files are automatically recognised by '''uvmat.fig''' and '''civ.fig''' if they are named [filebase '_xxmask_' 'filenumber' '.png'], where xx is the number of masks (nbslices) used when the series of fields corresponds physically to a set of nbslices positions. The mask filenumber used is the image field number modulo nbslices. Use xx=1 in the default case of a fixed position and a single mask. Masks can be made by pressing the menu bar Tools/make mask on the GUI UVMAT. The mask is created interactively with the mouse on the current image. |
653 | | |
654 | | First open an input image file name with the browser, or the edit box and carriadge return. From the image name, a corresponding mask name is proposed in the lower edit box. It should be edited if a series of masks is made, in case of mutipositions (number nbslices) of the laser sheet in a series. The names must be [filebase '_xxmask' 'filenumber' '.png'], where xx is the number of masks (nbslices). The mask filenumber used is the image field number modulo nbslices. The filenumber can be incremented by the NEXT press button. |
| 652 | Mask files are used to restrict the domain of CIV processing, to take into account fluid boundaries or invalid image zones. They must be stored as .png images with 8 bits, as described in [section 3.6->#sec3.6_mask]. Mask files are automatically recognised by '''uvmat.fig''' and '''civ.fig''' if they are named [filebase '_xxmask_' 'filenumber' '.png'], where xx is the number of masks (nbslices) used when the series of fields corresponds physically to a set of nbslices positions. The mask filenumber used is the image field number modulo nbslices. Use xx=1 in the default case of a fixed position and a single mask. Masks can be made by pressing the menu bar Tools/make mask on the GUI UVMAT. The mask is created interactively with the mouse on the current image. |
| 653 | |
| 654 | First open an input image file name with the browser, or the edit box and carriage return. From the image name, a corresponding mask name is proposed in the lower edit box. It should be edited if a series of masks is made, in case of mutipositions (number nbslices) of the laser sheet in a series. The names must be [filebase '_xxmask' 'filenumber' '.png'], where xx is the number of masks (nbslices). The mask filenumber used is the image field number modulo nbslices. The filenumber can be incremented by the NEXT press button. |