Processing of two-dimensional velocity fields for reconstructing three-dimensional flow patterns

The paper is concerned with the obtaining three-dimensional velocity fields of a gas or liquid flow based on the available cross-sections of this flow. The descriptions of the main optical methods for studying flows are designed to construct a cross-section of the observed process, but it would be much more informative to obtain information in the visualization not in the cross-section of a volume, but in this volume itself. The paper deals with obtaining three-dimensional flow velocity fields using various approximation methods. The method of estimating the most suitable approximating function is also given. The determination of the optimal type of approximation for the reconstruction of the three-dimensional velocity field was tested on an artificially created vortex.


Introduction
Applied to physically perceived objects, three-dimensional scanning is a systematic process of determining the coordinates of points belonging to the surfaces of complex-profile physical objects in order to subsequently obtain their spatial mathematical models that can be modified using CAD (Computer-Aided Design) systems.
A three-dimensional model, in contrast to a two-dimensional one, allows you to get much more information about the object or phenomenon under study. As for the visualization of flows, nowadays, threedimensional visualization methods have become quite popular in this area as well. Descriptions of the main optical methods for studying flows are destined to construct a cross section of the observed process, however, it would be much more informative when visualizing to receive information not in a cross section of any volume, but in this volume itself. In fact, it is much more convenient to select the region of interest from the experimental data from a three-dimensional model of the flow, rather than adjusting the setup each time so as to observe the cross section of interest to the experimenter.
Particle Track Velocimetry (PTV) and Particle Image Velocimetry (PIV) methods are among the most common and modern among the group of flow visualization methods. These methods, like the LDA methods, allow one to obtain information on the distribution of the flow rate; however, in contrast to the LDA, their implementation is simpler [1][2][3][4][5]. Currently, PIV complexes are being actively developed using the principle of tomography. Digital Tracer Flow Imaging (Tomo-PIV) tomography is the latest technology for 3D velocity measurement. Velocity data are obtained from the results of mutual comparison of threedimensional images of particles of two successively obtained reconstructions. The technology is completely digital, it allows you to work with a high density of tracked particles (information) and build denser vector fields compared to sparse 3D particle tracking fields. In contrast to the PIV scanning technique, this method allows you to get a truly instantaneous image throughout the entire volume. Tomo PIV is designed to work with fast streams that require the choice of small time intervals between images, and is easily modified for higher time resolutions due to the use of high-speed cameras [6][7][8][9][10][11][12]. Tracer particles within the investigated volume are illuminated by a high-power pulsed light source, and the reflected light is simultaneously recorded, usually from 4 directions of view, using CCD cameras. The 3D particle distribution is built using the tomographic reconstruction algorithm (MART) in the form of volumetric image elements with the distribution of light intensity. The particle displacement within the selected interrogation window is calculated by the 3D cross-correlation method based on the reconstructed particle distributions in two images, using an extended iterative mesh generation algorithm with a deformed interrogation window [13]. All this indicates the relevance of research in this direction.

Cross-correlation processing
In view of the fact that the global goal of the system being created is the construction of flow velocity volumetric fields, its software should include cross-correlation processing of experimental images. Crosscorrelation processing consists in finding the correlation function of the corresponding interrogation windows of two images. The cross-correlation processing scheme is shown in figure 2.
Both images (reference and measurement) are divided into areas -interrogation windows. Accordingly, the first processing parameter is the size of the interrogation window. Its size should be such that the vector field of displacements of elements can be considered uniform. In addition, the algorithm can have an overlap of the interrogation windows, and it is usually set as a percentage. The cross-correlation function is represented as the convolution of one image segment with another where m, n characterize the size of the image. Having calculated the correlation function for two interrogation windows, to find the offset in this area, it is necessary to find the maximum of the correlation function. The maximum can be found by enumerating the function value at all points, but taking into account the discreteness of the image, the maximum in this case is found with pixel precision.
To increase the accuracy to subpixel, it is necessary to interpolate the correlation function by points near the maximum. Three-point interpolation with a parabola and a curve in the form of a Gaussian distribution is often used for this. In this case, the additional offset is determined by the formulas [15] where R is the correlation function; dx, dy -specific positions of maximums with pixel precision. The above algorithm was implemented in MATLAB, and tested on the images shown in figure 3.
In the course of the program, a vector field of displacements with subpixel precision is built. An example of the program's operation for test images is shown in figure 4. When implementing this algorithm, it is also worth adding the ability to filter by the maximum vector size in order to exclude erroneous vectors from the picture.
The processing results showed that there are two vortices in the flow, which corresponds to the expectations from the program.

3D flow reconstruction
As a simulation of the experiment, the following solution was undertaken: each subsequent cross section of the vortex is formed by displacing the PIV pair of its images by a known distance in pixels, which is illustrated in figure 5. Each plane is spaced from the other along the z axis by 2 millimeters.   The PIV images of the vortex (figure 3) were first shifted by 24 pixels horizontally and vertically, resulting in the G plane. Then the G plane was shifted vertically by another 30 pixels, and the B plane was obtained. As a result, we have a three-dimensional vortex, the spatial distribution of which needs to be restored. Figure 6 shows the examples for the reference PIV vortex image. For each PIV of a pair of images corresponding to its plane, a flux field was obtained using the algorithm described in the previous section. To predict the behavior of the field in the space between the planes, it is necessary to work with the data describing the position of the vectors in the interrogation window.
For forecasting, the following types of approximation were used: linear, exponential, polynomials from the second to the fifth degree. Thus, during processing, first the coefficients corresponding to the approximating function are found, and then curves are constructed that allow obtaining the desired projections of the field vectors in the space between the planes with a given step. Examples of approximation are showed in figure 8.
As a result, a set of pictures was obtained, corresponding to the predicted spatial distribution of the vortex field. To determine the quality of the approximation, the predicted plane was taken, located between the planes R and G, and it was also compared with the plane that we consider the reference. Since the algorithm for obtaining planes G and B is known, the reference plane can be easily obtained by displacing the plane of the vortex R by only half the distance -namely, by 12 pixels. Figure 8 shows the vortex fields obtained by approximation by a second-order polynomial and experimentally.
As an estimate of the approximations, was used the determination of the relative error for each component (x, y) of the vector located in the interrogation window. The set of values was further summarized in histograms for the convenience of presenting error data (figure 9).   The error distributions show us that the bulk of the approximation errors is in the range of 0-15%. To determine the most optimal approximation, the weighted average error was calculated for each of the distributions: • Approximation by a linear function: 1.67% and 1.79%; • Approximation by exponential function: 1.84% and 2.01%; • Approximation by a second order polynomial: 1.58% and 1.72%; • Approximation by a third order polynomial: 1.74% and 1.79%; • Fourth order polynomial approximation: 2.08% and 2.17%; • Fifth order polynomial approximation: 2.50% and 2.88%.
As the results show, the most favorable option is the approximation by a second-order polynomial. Moreover, in this case, the error in predicting the vector field does not exceed 10%, which can be considered a completely satisfactory result.

Conclusion
At present, optical research methods are finding more and more application in various studies. A big advantage of optical methods is non-contact, which is why they pay considerable attention to them. In addition, it is known that a huge amount of information that a person received and still receives comes from the optical range. Due to physiological characteristics, we often cannot see what is happening right in front of us. In this case, computer processing techniques help, which are aimed at improving the quality and reducing the time to obtain the result.
In this work was successfully implemented an algorithm that constructs an offset field from PIV frames. The algorithm is implemented in the form of a program that allows you to work in real time, using photographs from a camera connected to a computer as initial data. Also, for the obtained PIV displacements in the program, it is possible to construct predicted data to obtain a volumetric flow picture with the determination of the optimal plane approximation algorithm. In the future, it is planned to test the algorithm on real data in order to identify shortcomings.