Changes between Version 10 and Version 11 of Tutorial/CorrelationImageVelocimetryOptimisation
 Timestamp:
 Jan 27, 2015, 11:09:45 PM (9 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Tutorial/CorrelationImageVelocimetryOptimisation
v10 v11 2 2 3 3 = [wiki:Tutorial] / Correlation Image Velocimetry: optimisation of parameters = 4 To improve the results , come back to the GUI '''CIV''', and follow these successive steps, corresponding to a sequence of operations.4 To improve the results from the previous tutorial, open again in the GUI '''series, '''and enter the file ''frame_1.png'' in ''UVMAT_DEMO01_pair/images. S''elect the ACTION 'civ_series' which opens the new GUI '''civ_input'''''''. You may import existing processing parameters by pushing the button [[wiki:ImportParam !ImportParam]] at the top left of the GUI '''civ_input''': open the parameter file ''images.civ/0_XML/frame_1.xml'' in the browser, or fill the GUI by hand as follows. 5 5 6 6 = Time interval = 7 7 The 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’. The choice of image pair is done in [!!ListPairCiv1]. 8 8 9 == Correlation box, shift and search box==10 Once the image pair has been chosen, the main parameters are the size of the correlation box in both directions ('''[num_!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 subimages 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.9 == Parameters for Civ1 == 10 Once the image pair has been chosen, the next parameter is the size of the correlation box in both directions ('''[num_!CorrBoxSize]_1]''' and '''_2'''), expressed in pixels. A smaller box of course improves the spatial resolution but it involves less statistics and false vectors may result from holes in the particle seeding. The particles are densely packed in this example, so we can significantly reduce the size from the default value [25,25] to [19,13] (in image pixels). The use of a elongated box along ''x'' allows to optimize the resolution in the direction ''y'', to deal with the transverse shear. 11 11 12 Select the '''[CIV1]''' check box so the corresponding parameters show up. Improve the spatial resolution by selecting smaller correlation boxes in the '''civ1''' menu, for instance '''[num_!CorrBoxSize_1, 2]''', to 19 and 13 (image pixels). This is possible because of the high density particl seeding. The use of a elongated box along ''x'' allows to optimize the resolution in the direction ''y'', to deal with the strong vertical shear.12 The next parameters are ('''[num_!SearchBoxSize_1]''' and '''_2''') and '''[num_SearchBoxShift_1]''', and '''_2''', which determine the box in which the subimage of the first frame is allowed to move to match the second frame. This can be adjusted from a prior estimate of the extrema of each velocity component (expressed in pixel displacement). Introduce [min, max] =[ 2; 6] for ’u’ and [3; 3] for ’v’, and press the button '''[Search Range]'''. The optimum search ranges and shifts (for the given correlation box) are now displayed: [33 25] and [2 0] respectively. 13 13 14 The 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.14 The PIV operation is conveniently visualised by pressing the button '''[!TestCiv1]''' in the GUI '''civ'''. Then the image appears in a new GUI '''view_field''', in which the mouse motion displays the correlation function as a color map in a secondary window. The resulting vector is shown as a line pointing to the correlation maximum. The corresponding correlation and search boxes are shown in the image. 15 15 16 It is now possible to adjust the search range, using prior knowledge on extremal velocities, see histograms displayed by '''uvmat''' in pixel coordinates. We introduce estimated bounds on each velocity component, [min] to 2 and [max] to 6 for ’u’ and (3, 3) for ’v’, and press the button '''[Search Range]'''. The optimum search ranges and shifts (for the given correlation box) are now displayed: [33 25] and [2 0] respectively.16 Unselect all operations except '''Civ1''' and validate the parameters by pressing '''[OK]'''. Then run 'civ_series' in the GUI '''series '''and look at the result by pressing '''[STATUS]''', and open the .nc result file. 17 17 18 Let us run again PIV with '''[!CorrBoxSize]'''=[19 13] and '''[!SearchBoxSize]'''=[27 25] with '''[Shift]'''=0. (limiting ourselves to CIV1), and visualise 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. Using '''[!TestCiv1]''' , it can be seen that the correlation maximum is indeed on the edge of the Search box, a lot of black error flags will thus be seen on the velocity image. Then come back to the good parameters.18 To observe the influence of the search box, come back to the GUI civ_input, set '''[!CorrBoxSize]'''=[19 13] and '''[!SearchBoxSize]'''=[27 25] with '''[Shift]'''=0, and visualise 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. Using '''[!TestCiv1]''' , it can be seen that the correlation maximum is indeed at the edge of the Search box in the main flow with u$\simeq$4 (while a gap of 2 pixels is required to properly determine the maximum without edge effect). 19 19 20 == !CorrSmooth == 21 The parameter '''[num_!CorrSmooth]''' is used to fit the correlation data with a smooth function to obtain the maximum with subpixel precision. We generally keep the default value 1. 20 of research of the expressed in pixels. For each velocity vector, the correlation box is moved within the search box to optimise the image correlation between the two subimages 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 can be also introduced to minimise the search area in the presence of a mean flow. 22 21 23 == Measurement grid and mask == 24 The 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. If the mesh is below half the correlation box size, the added velocity vectors become redondant as they correspond to overlapping subimages. 22 The parameter '''[num_!CorrSmooth]''' is used to fit the correlation data with a Gaussian function to obtain the maximum with subpixel precision. We generally keep the default value 1, while the value 2 should be more appropriate for larger particles (with wider correlation maximum). 23 24 The 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 anyway limited by the size of the correlation box, so that velocity vectors become redondant when the subimages highly overlap those of the neighboring vector. Then the choice Dx=Dy=10, about half the correlation box, provides a good optimum. 25 25 26 26 Finally select the '''Mask option''' like in the previous tutorial.