Changes between Version 25 and Version 26 of Tutorial/ParticleImageVelocimetry


Ignore:
Timestamp:
Jan 21, 2015, 12:23:24 AM (10 years ago)
Author:
sommeria
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorial/ParticleImageVelocimetry

    v25 v26  
    1313The PIV computation is accessed from uvmat by the upper bar command '''[Run/PIV]''', or from '''series''' by selecting the function '''civ_series'''. The name 'CIV' means '''C'''orrelation '''I'''maging '''V'''elocity to stress that the method relies on image correlation, which evaluates the displacement of image textures, not necessarily from particles. Note that an older GUI ''''civ'''' is also available, but it is obsolete and not used here.
    1414
    15 A new GUI '''civ_input''' now appears. In the menu '''[!ListCompareMode]''', keep the default option 'PIV'. Keep also the default option 'Di=0|1' for the image pair (menu tag '''[!ListPairCiv1]'''). Keep also the default parameters in the frame '''CIV1''' and press '''OK''', so the GUI '''civ_input''' desappears.  Then press '''[RUN] ''' in the GUI''' series''' to run the calculation. The button '''[RUN]''' is then colored to yellow until the computation is finished.
     15A new GUI '''civ_input''' now appears. In the menu '''[!ListCompareMode]''', keep the default option 'PIV'. Keep also the default option 'Di=0|1' for the image pair (menu tag '''[!ListPairCiv1]'''). Keep also the default parameters in the frame '''CIV1''' and press '''OK''', so the GUI '''civ_input''' desappears.  Then press '''[RUN] ''' in the GUI''' series''' to run the calculation. The button '''[RUN]''' is then colored to yellow until the computation is finished.
    1616
    1717The operation produces a  file with format netcdf, named with extension '''.nc''', in a folder called ''Images.civ''. This can be viewed by pressing '''[STATUS] '''in the GUI '''series''', which displays the result file ''frame_1-2.nc''. The index string '_1-2' indicates that it results from images 1 and 2. Select the file name and press '''[OPEN]''' to open it directly with '''uvmat''', or use the browser of '''uvmat'''.
     
    3636
    3737== Other vector color representations ==
    38 Vector color can also  represent another quantity, as chosen in the menu '''[!ColorScalar] ''' in the frame '''[Vectors]'''. For instance the vector length 'norm(U,V)' can be used. Then a color continuous 64 color code is appropriate, as set in the menu '''[!ColorCode]'''. The color code extrema are set by '''[num_!MinVec] ''' and '''[num_MaxVec]''', choose for instance 0 and 5 respectively.''''''
     38Vector color can also  represent another quantity, as chosen in the menu '''[!ColorScalar] ''' in the frame '''[Vectors]'''. For instance the vector length 'norm(U,V)' can be used. Then a color continuous 64 color code is appropriate, as set in the menu '''[!ColorCode]'''. The color code extrema are set by '''[num_!MinVec] ''' and '''[num_MaxVec]''', choose for instance 0 and 5 respectively.'''''''''''
    3939
    4040== Derived fields ==
     
    4545[[Image(contours.JPG)]]
    4646
    47 To get the vorticity field, 'vort' , and other spatial derivatives, you need to come back to the GUI''' series''' with images as input and action civ_series'''. '''In''' civ_input''', select the check boxes '''[FIX1] ''' and  '''[PATCH1] ''' , validate the input with '''[OK]''', then press '''[RUN]''' in the GUI '''series'''. A question box appears to warn about the existence of the result file, answer '''[OK]''' to refresh it with the new data. This will produce an interpolated velocity field and their spatial derivatives in the same netcdf file.  After this operation vorticity can be visualized in the GUI  '''uvmat''', selecting the option 'vort'''' ''' in the popup  menu '''[FieldName]'''. 
     47To get the vorticity field, 'vort' , and other spatial derivatives, you need to come back to the GUI''' series''' with images as input and action civ_series'''. '''In''' civ_input''', select the check boxes '''[FIX1] ''' and  '''[PATCH1] ''' , validate the input with '''[OK]''', then press '''[RUN]''' in the GUI '''series'''. A question box appears to warn about the existence of the result file, answer '''[OK]''' to refresh it with the new data. This will produce an interpolated velocity field and their spatial derivatives in the same netcdf file.  After this operation vorticity can be visualized in the GUI  '''uvmat''', selecting the option 'vort'''' ''' in the popup  menu '''[FieldName]'''.
    4848
    4949== Superposing image and vectors ==
    50 It can be useful to visually superpose the images to the velocity field. This is done  by selecting the option 'vec(U,V)'  in the popup menu '''[FieldName] '''and  'image' in the popup menu '''[FieldName_1]''', located just below''' ''' in the upper frame '''[Input]'''.  To remove the image, select the blank option in '''[FieldName_1]''' .
     50It can be useful to visually superpose the images to the velocity field. This is done  by selecting the option 'vec(U,V)'  in the popup menu '''[!FieldName] '''and  'image' in the popup menu '''[!FieldName_1]''', located just below''' ''' in the upper frame '''[Input]'''.  To remove the image, select the blank option in '''[!FieldName_1]''' .
    5151
    52 Similarly, the velocity vectors can be superposed to the vorticity field, selecting 'vort'''' ''' in '''[FieldName_1]''' instead of 'image'''''''.
     52Similarly, the velocity vectors can be superposed to the vorticity field, selecting 'vort'''' ''' in '''[!FieldName_1]''' instead of 'image'''''''.'''
    5353
    5454= From pixel displacement to velocity =
    55 So far all PIV results have been expressed as image displacement expressed in pixels. Conversion to velocity requires timing information and geometric calibration, as described in [wiki:Tutorial/GeometricCalibration geometric calibration]. Both pieces of information must be stored in an xml file named'' 'images.xml''' in the same folder as the folder '''images''' containing the images.
     55So far all PIV results have been expressed as image displacement expressed in pixels. Conversion to velocity requires timing information and geometric calibration, as described in [wiki:Tutorial/GeometricCalibration geometric calibration]. Both pieces of information must be stored in an xml file named'' 'images.xml''' in the same folder as the folder '''images''' containing the images.'''''
    5656
    57 First introduce the time interval, Dt=0.02 s, by creating a text file with the following content, using any text editor (with output in plain text), and save it with name '' 'images.xml''' (in Windows system, be carefull to avoid any additional hidden extension).
     57First introduce the time interval, Dt=0.02 s, by creating a text file with the following content, using any text editor (with output in plain text), and save it with name '' 'images.xml''' (in Windows system, be carefull to avoid any additional hidden extension).'''''
    5858
    5959{{{
     
    6969</ImaDoc>
    7070}}}
    71 Then open the image with uvmat. The label 'xml' should appear in the upper right box [[wiki:TimeName !TimeName]] and time value beside it in [[https://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/search?q=wiki%3ATimeName !TimeValue]]. 
     71Then open the image with uvmat. The label 'xml' should appear in the upper right box [[!TimeName]] and time value beside it in [[!TimeValue]].
    7272
    7373Now repeat the PIV operation to include the time information in the result (in the absence of time information the file index is taken as default value).
    7474
    75 To introduce  the geometric calibration, use the method described in [https://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/search?q=wiki%3ATutorial%2FGeometricCalibration geometric calibration]. The velocity field is then displayed in terms of physical velocity. To come back to the image coordinates, use the box''' [transform_fct]''' on the left : select to blank instead of ’phys’.
     75To introduce  the geometric calibration, use the method described in [https://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/search?q=wiki%3ATutorial%2FGeometricCalibration geometric calibration], section 'Simple scaling'. The velocity field is then displayed in terms of physical velocity. To come back to the image coordinates, use the box''' [!!TransformName]''' on the left : select to blank instead of ’phys’.
    7676
    7777Note that the netcdf file has not been by changed by calibration, whose rescaling is introduced after reading the file. This means that calibration can be provided, and possibly updated, after the PIV processing.
     
    8080The first parameter to adjust is the time interval between images, which should be sufficiently long to provide a displacement of a few pixels. The measurement precision is typically 0.2 pixel, so that a displacement of 4 pixels, as in the example, provides a relative precision of 5 %. A larger displacement would be preferable in terms of precision but may yield to poor image correlation and ’false vectors’.
    8181
    82 Once the image pair has been chosen, the main parameters are the size of the correlation box in both directions ([Bx], [By]) and the size of the search box, ([SearchX],[SearchY]), expressed in pixels. For each velocity vector, the correlation box is moved within the search box to optimise the image correlation between the two sub-images inside the correlation box. To allow for a displacement of d pixels, the search box size must exceed the correlation box by at least d+2 on both sides, so 2d+4. A systematic shift [ShiftX],[ShiftY] can be also introduced to minimise the search area in the presence of a mean flow.
     82Once the image pair has been chosen, the main parameters are the size of the correlation box in both directions (['''[num_[wiki:CorrBoxSize !CorrBoxSize]_1]''' and _2) and the size of the search box, ('''[num_! SearchBoxSize_1] '''and _2), expressed in pixels. For each velocity vector, the correlation box is moved within the search box to optimise the image correlation between the two sub-images inside the correlation box. To allow for a displacement of d pixels, the search box size must exceed the correlation box by at least d+2 on both sides, so 2d+4. A systematic shift '''[num_SearchBoxShift_1]''', and _2, can be also introduced to minimise the search area in the presence of a mean flow.
    8383
    84 The parameter [Rho(image)] is used to fit the correlation data with a smooth function to obtain the maximum with sub-pixel precision. We generally keep the default value 1.
     84The parameter '''[num_!!CorrSmooth]''' is used to fit the correlation data with a smooth function to obtain the maximum with sub-pixel precision. We generally keep the default value 1.
    8585
    86 The parameters [Dx] and [Dy] define the mesh of the measurement grid, in pixels. Reduce them to get more vectors, but keep in mind that the spatial resolution is limited by the width of the correlation box.
     86The parameters '''[num_Dx]''' and '''[num_Dy] '''define the mesh of the measurement grid, in pixels. Reduce them to get more vectors, but keep in mind that the spatial resolution is limited by the size of the correlation box.
    8787
    88 The PIV operation is conveniently visualised by pressing the button [TEST_civ1] in the GUI civ. Then the image appear in a new GUI view_field, in which the mouse motion displays the correlation function, which appears in a secondary window, see figure. The resulting vector is shown as a line pointing to the correlation maximum. The corresponding correlation and search boxes are shown in the image. Let us run again PIV with Search x,y=(31,31). Many black vectors are obtained...
     88The PIV operation is conveniently visualised by pressing the button '''[!!TestCiv1]''' in the GUI civ. Then the image appear in a new GUI '''view_field''', in which the mouse motion displays the correlation function, which appears in a secondary window, see figure. The resulting vector is shown as a line pointing to the correlation maximum. The corresponding correlation and search boxes are shown in the image. Let us run again PIV with [wiki:CorrBoxSize !CorrBoxSize]=[25 25] and [wiki:SearchBoxSize !SearchBoxSize]=[33,33], limiting ourselves to CIV1, and visualisae the result with '''uvmat'''. Many black vectors (F=-2) are obtained, showing that the search domain is too small, so that the correlation maximum is constrained by the limited search interval. Repeat the operation with ! [https://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/search?q=wiki%3ASearchBoxSize SearchBoxSize]=[35,33], then the arrows are not black anymore.
    8989
    9090= Masks =