Whole-field density measurements by digital image correlation

A novel application of Synthetic Schlieren in a laboratory set-up yields a quantitative measurement of the density field of two-dimensional, stratified or homogeneous, transparent fluids in a laboratory set-up using a single camera. This application obtains local values of the density without the need for tomographic reconstruction algorithms that require images taken from different directions through the fluid nor does the application require regularization. This is achieved by placing the camera at a large oblique angle with respect to the experimental set-up. This step is motivated by a fallacy observed when applying ray tracing in a classical configuration, in which the camera’s optical axis is perpendicular to the flat surface of a fluid container. The application is illustrated by the optical determination of static density fields of linearly and nonlinearly stratified fluids, as well as of multi-layered fluids. The application is validated by comparing with density profiles obtained from probe measurements of conductivity and temperature. Our application yields similar density and density gradient profiles as the probe while also providing a whole-field measurement without disturbing the fluid, and allowing the determination of dynamical density fields.


Introduction
The Synthetic Schlieren (Dalziel et al. 2000) or Background-Oriented Schlieren (BOS) (Meier 2002;Raffel 2015;Settles and Hargather 2017) techniques provide whole-field measurements of density gradients of perturbations that are superimposed on a stably stratified vertically dependent background stratification.When working with densitystratified fluids, the technique is usually called Synthetic Schlieren.One of the strengths of this technique is the simplicity of the experimental set-up.In a typical application, perturbations (internal gravity waves) are imaged.Two or more images are compared using Digital Image Correlation (DIC) (Sutton et al. 2009).This comparison yields the apparent displacements of stationary dots, fixed on a lightbank behind the tank.These dots appear to move due to perturbations of the fluid through which they are observed, which affect light refraction and paths between the images.These displacements are related to gradients of the index of refraction using a ray tracing model and to gradients of the density perturbations through the Gladstone-Dale relation.
There are several approaches to determine the density field from density gradients via post-processing.The density field can be obtained by solving a Poisson equation.This requires choosing a priori unknown boundary conditions.One downside is the propagation of uncertainties from Synthetic Schlieren-based perturbation density gradients to the perturbation density field calculation (Hazewinkel et al. 2011;Passaggia et al. 2020;Venkatakrishnan and GEA Meier 2004;Verso and Liberzon 2015).In compressible aerodynamics, multiple cameras and tomographic reconstructions (e.g., Grauer and Steinberg 2020;Molnar et al. 2023) are required or the use of a radon transformation plus a priori knowledge of the flow field (e.g., Braukmann et al. 2021).
In this paper, we present a novel application, in set-up similar to the Synthetic Schlieren technique, to measure the density field directly.The model in our application does not work on the density perturbations but on any density field: static and dynamic.This application provides a direct full-field measurement of a primitive variable (the density field) in fluid mechanics.We take images of stationary dots in three situations: (1) before filling a tank, through air, (2) after filling the tank with a homogeneous-density 175 Page 2 of 12 calibration fluid and (3) after filling the tank with our target (possibly stratified) fluid, whose density field is unknown and which potentially varies in space and time.DIC is performed to obtain displacements between the images.Using a ray tracing model, these displacements are related to the index of refraction.Through the Gladstone-Dale relation, a two-dimensional density field, a path integral of a threedimensional density volume, is determined.For comparison purposes, after obtaining the density field, the vertical derivative determines the vertical density gradient of the target fluid.
In the present paper, the camera is placed under an angle with respect to the water tank, see Fig. 1.An angle = 0 • corresponds to a classical Synthetic Schlieren set-up, where the optical axis of the camera is perpendicular to the walls of the water tank such that light rays are not refracted.The refraction of light rays has a dependence on incidence angle, which makes a naive application, without knowledge of fundamentals of light refraction, sensitive to noise.In Sect.2, we illustrate this naive application and analyze its shortcomings.We will show that the apparent pattern displacement can be magnified by placing our camera at nonzero angles , which ensures light rays are refracted more.Section 3 discusses the experimental set-up and the DIC technique, and parameters for a typical DIC calculation in our experiments are provided.In Sect.4, a full threedimensional forward model is derived, allowing large viewing angles : given an index of refraction field and experimental parameters, the displacement field can be computed.Because we place our camera under an angle, we do not observe the angle for which the displacements are zero.This requires a calibration procedure, which determines the angle and distance of our camera relative to the tank.Last, we discuss how to solve our inverse model: how to obtain the index of refraction from the experimentally obtained displacements and our forward model.
Section 5 presents measurements for three fluids: a two-layer system, a linear stratification and a nonlinear stratification.These are full-field measurements of the density and vertical density gradients.To validate these measurements, we horizontally average the density fields to compare the resulting density profiles with a second, independent measurement of these density profiles: a density measurement using a probe consisting of a conductivity and a temperature sensor.Section 6 discusses the novel application and offers suggestions for improvements.

Frontal view: simple model
To measure the density of a fluid in a tank, we start by using the classical approach that employs a frontal view-with the optical axis perpendicular to the experimental set-up.In Sect.2.1, a relation between the apparent displacements of the dots on a static pattern and index of refraction is derived.In Sect.2.2, this relation is used on measurement data to determine the density of a fluid.Large variations appear and in Sect.2.3 the failure of this naive approach is analyzed by deriving error estimates as a function of viewing angles.

Derivation simple model
Consider an experimental set-up where light rays travel from a light bench having a random dot pattern attached to it, through a water tank to a camera; see Fig. 2. We describe the camera as a pinhole camera.The paths of the light rays depend on the refractive index of the medium encountered inside the tank.We place a right-handed Cartesian coordinate system (xyz) on the image plane with the z-axis pointing in the direction of the optical axis of the camera.Another right-handed Cartesian coordinate system ( ) is located at the object plane.Note that points in the downward ( y < 0 ) gravity direction.The -axis is perpendicular to the experimental set-up, i.e., such that a light ray traveling along the -axis will not be refracted by the set-up.In the simple model, the angle = 0 and the z-and -directions are opposite and parallel to each other.For each light ray, we want to determine the -position where the light ray originated from, = x 6 .For now, consider light rays emitted at = 0 for which y = 0 .The light rays pass through the pinhole at x 1 = 0 having an angle x .Assuming the refractive index in each section of the set-up is constant, we can write for the light path, where ( x j , z j ) are the coordinates of the light ray at the start of each section and j x is the angle between the ray's propagation direction and the z-axis.When encountering a discontinuous change in refractive index (a refraction plane), we invoke Snell's law, where n j is the refractive index for the jth section.After repeated application of (1) and (2) and dropping the superscript 1 from the angle for the first section, the position is The displacement Δ is the difference in position between the constant reference state in which n f = n air , when the tank is filled with air, and the unknown state that we aim to determine in which n f = n , when the tank is filled with water of unknown refractive index n, (1) where the distance of camera to tank, L c , the glass thick- ness, L g , and the light-bank distance, L s , drop out.Inverting this relation, we obtain the unknown refractive index n as a function of the displacement Δ , For the displacement Δ similar relations to (4) and (5) hold.
To obtain the density from the refractive index, we use the Gladstone-Dale relation with the Gladstone-Dale constant from Dalziel et al. (2000),

Results naive application
Using this naive application, without knowledge of light refraction, we aim to measure the density of tap water optically.Figure 3 shows two frontal images of the experimental set-up: one without water in Fig. 3a and one with tap water in Fig. 3b.Applying DIC to the blue rectangle in Fig. 3b and the entire image in Fig. 3a yields the displacements in the top row of Fig. 4, in (a) horizontal, Δ , (b) vertical, Δ and (c) radial direction, Δ = √ 2 + 2 .Using ( 5) and ( 6) (6) n = 1.333 + 0.245( − 1.00).The density field in Fig. 4f looks best but still has a density range of 0.77 to 1.38 g/cm 3 .These density values are unphysical since the density of water without added salts is 1.0 g/cm 3 , and the maximum density of salt water is 1.2 g/cm 3 (at room temperature).The water in the tank is tap water, without added salts.Computing the difference between the horizontally averaged densities in Fig. 4d-f and the expected density 1.0 g/cm 3 through with M the number of (vertical) grid points, yields 35, 338 and 15 mg/cm 3 , respectively.

Analysis of simple model
At the point where light rays cross the water tank normal to the glass surface, there will be no refraction.Indeed, (4) shows that when the angle x goes to zero, ( 7) the displacement Δ goes to zero.Then, (5) takes on an indeterminate form.In any measurement, we have noise, resulting in uncertainties in (the measured values of) Δ and x .These uncertainties have a large effect on the value of n since the expected values of Δ and x are small.The Signal-to-Noise Ratio is low because our signal is small.
To solve this, we want x to always be nonzero and not too small.Then, according to (4), Δ does not approach zero and (5) does not take on an indeterminate form.This can already be observed in Fig. 4d-f: the calculated values for the density are much better in the periphery, when the light rays are away from the optical axis.
To amplify our signal, we want Δ and x to vary with n as much as possible.So, we want n to vary with Δ and x as little as possible.Figure 5 therefore shows a plot of the derivatives of n, given by ( 5), with respect to = Δ ∕L t and x (Nemoto 1992).The accuracy of the determination of the optical axis is determined by the noise level and n∕ x .The accuracy of the displacements is determined by the noise level, n∕ and the accuracy with which the optical axis was determined.The worst possible angle to measure at is 0 • , when the optical axis is perpendicular to the tank.Placing the camera at a nonzero angle with respect to the water tank thus slightly increases the noise in n, while increasing the signal; it definitely ensures the signal is nonzero.The Signal-to-Noise Ratio becomes larger because our signal increases more than our noise.
The cross section of the measured tank reduces with increasing viewing angle since we use only those light rays that travel along the full length of the tank.For a tank with width W t and length L t (as in Fig. 2), the aspect ratio AR = L t ∕W t and the relative loss in cross section is W loss = AR ⋅ tan .This is a lower limit on the loss of cross section since we ignored the difference in refractive index of the fluid in the tank, which can cause a large apparent background displacements for an air versus water measurement set.The width W t can also be limited by the field of view of the camera.For large viewing angles, the effective width that can be observed becomes impractically small, see Fig. 5.We have a trade-off: for increasing viewing angles both the error and the effective width decrease.

Experimental set-up and tracking displacements in images
In this section, we describe the experimental set-up and how to track displacements in images in Sect.3.1.Backwards mapping in DIC is discussed in Sect.3.2, and the use of a Region of Compensation is discussed in Sect.3.3.The novel application is in set-up similar to a Synthetic Schlieren measurement: a tank filled with water, a lightbank with uniform lightning covered by random dots and a camera.Light rays would emanate from the light-bank, be disturbed by the water in the tank and fall onto a camera.The density stratifications were constructed using the double bucket method (Oster 1965).For image acquisition, we used two different commercial monochromatic cameras (MD120MU-SY, XIMEA GmbH and AVT Pike F-505B).The main difference in set-up with Synthetic Schlieren is that the camera was placed under a horizontal angle of approximately 30 • , which can be achieved by moving and rotating the camera or rotating the tank and light-bank, see Fig. 1.
We used a tank with dimensions of 25 × 13 × 50 cm (width × length × height).The aspect ratio AR ≈ 0.5 .We filled the tank to approximately 30 cm height.The tank was made of glass plates with a thickness L g of 6 mm .We placed the camera at a distance L c of approximately 1 m .The tank was placed against the light-bank such that L s = 0.

Digital image correlation
Digital Image Correlation (DIC) is a technique to obtain deformation maps from images.We use second-order shape functions (Lu and Cary 2000) to handle large nonlinear deformations of multi-layered fluids with large density jumps along their interfaces.To attain subpixel accuracy, we interpolate our images with B-splines (Unser 1999).To obtain the deformations, we optimize a correlation coefficient C, the ZNSSD (Sutton et al. 2009).We solve this nonlinear least-squares problem by (1) providing an initial guess and (2) solving an iterative scheme.As an initial guess, we perform Template Matching (Bradski 2000) on a limited set of points to obtain rigid deformations with pixel accuracy.After applying DIC to obtain sub-pixel deformations of this set of points, we use reliability-guided DIC (Pan et al. 2012).As an iterative scheme, we use the Levenberg-Marquardt (LM) algorithm.For practical considerations for DIC, we refer to Sutton et al. (2009), in particular Chapter 10.
After obtaining the raw images, we average them (in case of static measurements) and prefilter them with a Gaussian blur with kernel size five.Then, the DIC technique is applied to the processed images to obtain the displacement fields.The displacement fields were confirmed with the software package DaVis 10.2.
Table 1 shows typical DIC parameters for our experiments.Additionally, the accuracy of the obtained displacements and densities is given.The determination of the vertical density gradient involves taking derivatives of the density field.This resembles a common application of DIC: the determination of strains from displacement data.We use central differences to obtain the derivatives.Information is low-pass filtered by a DIC subset.The step size oversamples and would unnecessarily amplify noise.5 The error in the displacements depends on the derivative of n with respect to = Δ ∕L t (blue) and the error in the determination of the optical axis (calibration) depends on the derivative with respect to x (red); both are a function of x .The angle x = 0 • is the worst angle to measure at.The relative reduction in the cross section of the measured tank is given by W loss , for different aspect ratio's (AR).A range in angles (in purple) is shown around a nonzero angle of = 30 • , which roughly indicates optimal viewing angles from the camera to the experimental set-up 175 Page 6 of 12 We chose to use a hamming window to filter the density field at the subset size scale.

Backwards mapping
In the measurements with stratified fluids with large density jumps, such as multi-layer fluids, we observed that the same dot pattern (subset) from the tap water fluid appeared on multiple locations in the stratified fluid.This was a problem for the DIC procedure: there was no bijection, no one-to-one correspondence, between the two images.When mapping backwards, performing DIC from the stratified fluid to the tap water fluid, the mapping is a surjection.This made the mapping solvable for the DIC procedure: every subset in the stratified fluid image had a single corresponding subset in the tap water fluid.Mapping backwards slightly improved the results for all measurements, even for stratified fluids without large density jumps.

Region of compensation
The experimental procedure takes time: recording images of the tank filled with air, filling the tank with water with a known index of refraction, recording for the calibration, emptying the tank, filling the tank with a stratified fluid and recording its density field.Sometimes in the experiments, small movements occurred: e.g., filling the tank with water moved the tank downward by about 0.2 pixel ≈ 0.03 mm .When the background dot pattern was attached to the tank, our model would erroneously attribute this displacement to the index of refraction.To determine whether there was movement, we employed a Region of Compensation (Pan et al. 2014): we observed regions the tank (and through the tank without fluid), where there should be no movement.If a uniform displacement was observed, this was subtracted from the displacement fields inside the tank.In Fig. 3b, we used the region above the water surface as Region of Compensation.

Viewing angle: full oblique model
We derive a full three-dimensional forward model in Sect.4.1, allowing large viewing angles .This is an extension of Eqs. ( 3) and ( 4).Because we place our camera under an oblique angle, we do not observe the angle for which the displacements are zero.In Sect.4.2, we describe a calibration procedure to determine the orientation of the camera with respect to the experimental set-up.Unlike the simple frontal model ( 5), we cannot invert the forward model to determine n.Therefore, we use an inverse model, which we solve in Sect.4.3.

Forward model
We construct a forward model, relating for each light ray i an index of refraction n i , position on the image plane x i = (x i , y i ) and parameters q to coordinates i = ( i , i , i = 0) where the light ray hits the light-bank (plane 6) for nonzero angles .Physically light rays emanate from the light-bank and fall onto the camera; mathematically, we reverse the direction of the light rays.The model (n i , q, x i ) uses ray tracing and Snell's law in three dimensions.We assume the light rays travel in straight lines.For details, we refer to Appendix 1.Since the image and object planes are not parallel, the magnification is a function of x i , even with a pinhole approximation.The forward model depends nonlinearly on the parameters q and the measurements x i (obtained from the DIC procedure).
We take our forward model twice, once for a deformed image with index of refraction field n(x, y) and once for a reference image with (typically constant) index of refraction n ref .The light rays originating from the same location on the light-bank end up on different locations on the image plane due to the different indices of refraction: For each light ray i, (8) holds and is decoupled from the other light rays.This description is the reverse of the situation depicted in Fig. 4, where light rays from two different locations on the object plane end up in the same location on the image plane.

Calibration
In our forward model in ( 8), we have used the parameters q = [a, b, c, L m ] T , defined in Fig. 6 and Appendix 1.
Coefficients a, b, c define the orientation of the lightbank object plane, and L m , the distance to the light-bank, measured along the line perpendicular to the camera from the pinhole.
To obtain parameters q , we perform a calibration measurement.We do not need to measure the position of the camera manually.The calibration consists of performing one extra measurement (two in total): we take a reference image, the tank filled with water with a known index of refraction n ref , and a calibration image, the tank without water (filled with air).
Since we have only four parameters to estimate (a, b, c and L m ) and many measurements (each grid point in the DIC procedure yields a separate equation ( 8)), we have an over-determined system.The method of least-squares yields the q that minimizes the sum of squares of the residuals.For each measurement x i , we have a measure of reliability, the correlation coefficient C, which is used as a weight w i in the least squares procedure with a lower limit L c > 0 .The sum is over all measured displacements.We use the LM algorithm to solve (9).In our experiments, (9) has one minimum that satisfies L c > 0.
One practical limit for the calibration is that the apparent background shift between air versus calibration fluid can become large.In Table 1, this shift is reported as 150 pixels ≈ 2.2 cm .If the tank becomes longer ( L t increases) or the width decreases, the aspect ratio (AR) becomes larger, see Fig. 5.If the aspect ratio is too large, there are no light rays that pass through the entire length of the fluid and our calibration fails.

Inverse model
Unlike the simple model, we cannot invert the forward model to obtain an expression for the index of refraction: we have an inverse model.We consider the unknown index of refraction as a perturbation on the reference state, n i = n ref + n i , i labeling the rays (pixels), and treat the problem of finding n i as an optimization problem: with lower and upper bounds 1.3 For each measurement x i , we solve (10) with the LM algorithm to find n i .In our experiments, (10) has one minimum within the given bounds.We use ( 6) to relate the indices of refraction we obtain from (10) to density values.By placing our camera under a horizontal angle , we amplified the signal in the horizontal direction.In ( 9) and (10), we used only the horizontal displacements and not some combination of the displacements to determine the parameters q and the perturbations n i .

Two-layer system
Figure 7 displays a measurement on a two-layer system: Fig. 7a shows the optically determined density field; Fig. 7b shows vertical density profiles from Fig. 7a in grey (after interpolation on a uniform grid) with the horizontally averaged profile shown in blue; and Fig. 7c shows the correlation coefficient C for each grid point as a function of depth.
The densities in the upper layer and in the lower layer are constant; an improvement with respect to the frontal view from Fig. 4. The interface between the two layers was a large density jump with a height of 8 mm , which smeared out and compressed the dots in the vertical direction.The displacement field Δx in Fig. 8 shows that the DIC procedure had difficulties mapping the interface.The variations in the displacement fields resulted in the density field around the interface not being horizontally constant.The correlation coefficient for almost all grid points in Figs. 7, 9 and 11 was higher than 0.99, indicating that the transformation (consisting of displacements, first-order and second-order shape functions) found by DIC for these grid points was an excellent match.When the correlation coefficient was less than 0.99, as in Fig. 7c, the DIC procedure indicated it had trouble explaining the variations found in the images.Thus, the correlation coefficient of the DIC procedure can be used as a diagnostic tool to detect such variations.

Stratified fluids
Figure 9 displays a measurement on a linearly stratified fluid with a layer of linearly increasing density with depth and a density jump to a layer with a higher density: Fig. 9a shows the optically measured density field; Fig. 9b shows vertical density profiles from Fig. 9a in grey (after interpolation on a uniform grid) with the horizontally averaged density profile in blue and the probe profile in red; and Fig. 9c shows the difference Δ between horizontally averaged and probe profiles (after interpolation).Near the bottom of the figures, a layer of high density fluid is visible.The red profile was obtained from a second independent measurement: a probe consisting of a conductivity and a temperature sensor, which was moved down and up through the water using a step motor.We used the measurement obtained during the undisturbed downward movement.The conductivity and temperature sensors were calibrated using an Anton Paar Handheld Density Meter DMA 35.
Figure 11 displays a measurement on a nonlinearly stratified fluid consisting of a layer ( 0 − 6, cm depth) of linearly (relatively slowly) increasing density, a layer of rapidly and nonlinearly increasing density ( 6 − 12, cm depth), and a layer of linearly increasing density ( > 12 cm depth).
The newly proposed optical determination of the density reproduces the density profiles obtained from the probe, see Figs. 9,10,11 and 12.To quantify the difference between the two methods, Figs. 9 and 11 report the difference ||Δ || 2 , calculated using ( 7).This difference is less than 2.9 mg/cm 3 , the resolution reported in Table 1, and much less than the errors found with a frontal view and discussed in Sect.2.2, where the smallest error was 15 mg/cm 3 .Also, the variation in the density is much smaller than in Fig. 4d-f and no unphysical density values are found.
The strength of static density fields of continuously density-stratified fluids is characterized by the buoyancy (or Brunt-Väisälä) frequency N 2 ( ) = (g∕ 0 ) d ∕d and depends on the vertical gradient of the density, with g the gravitational acceleration and 0 the constant part of the background density.The vertical gradient of the density was obtained by applying a central difference scheme on both the optically determined density field and the probe profile, see Figs. 10 and 12. Various features are reproduced by the optically determined density gradients; (1) the vertical density gradient is constant for the linear stratification in Fig. 10; and (2) the appearance of the double peaks at 8 cm and 10.5 cm depth for the nonlinear stratification in Fig. 12.
The density fields are approximately horizontally constant, as expected for stably stratified fluids at rest.However, patterns in the density field indicate that camera calibration can further improve the results, see for example Fig. 9a.

Discussion
We have introduced an optical, non-intrusive application of Synthetic Schlieren, to measure the background density field of a two-dimensional fluid using a single camera.By looking under a horizontal angle ( in Fig. 1), the signal was amplified: the light rays falling on the camera refract more under larger angles.Full-field densities for multilayered fluids, linearly stratified fluids and nonlinearly stratified fluids were obtained.These were validated by comparing the horizontally averaged density fields with density profiles obtained by a probe consisting of a conductivity and a temperature sensor.The newly proposed experimental application reproduces the density and density gradient profiles obtained from the probe.This provides a non-intrusive full-field measurement.It is thus possible to measure dynamically changing density fields.
The new application yields the density field without the need for tomographic reconstruction algorithms that require images taken from different directions through the fluid nor does the analysis require regularization.In set-up, our experiment is similar to Synthetic Schlieren, with the main differences being that we place our camera at an angle to view the experimental set-up and that we do not make use of the presence of a pre-existing, strong background vertical density gradient.Our model, relating displacements to densities, is fundamentally different from the model in Synthetic Schlieren, relating displacements to density gradients.We rely on differences in the viewing angle to refract the light rays differently, while in Synthetic Schlieren all light rays are assumed parallel.In Dalziel et al. (2007), simultaneous Synthetic Schlieren and Particle Image Velocimetry (PIV) measurements were performed.Simultaneous measurements with our new application and PIV to determine the density and velocity fields directly would allow greater insight into the dynamics of densitystratified flows.
In our model, we assume the glass plate (and the lightbank) to be planar.This assumption is under pressure during the experiments.It is important to fill the water tank to the same height during the experiments.Any difference in the water height will lead to a different pressure acting on the glass and could lead to a different curvature of the glass plane.In some of our experiments, we used a 2 m wide tank, filled with 75 l of salt water.This amount of water curved the glass plates outwards.We recommend an extra calibration step: image the random dots on the light-bank without the tank, then with an empty or filled tank.Any deviation, above the noise level of the camera, from a planar tank will be measurable.
Despite careful alignment of the set-up, residual misalignments were present.These can be further reduced by a general camera calibration.This ensures that straight lines in the experimental set-up (like the water surface and the boundaries of the tank) appear as straight lines in the acquired images.This yields a transformation of the images.With the DIC parameters from Table 1, this was likely the largest source of error.

Appendix A: Derivation forward model
This appendix describes equations governing the forward model and how the forward model depends on the calibration parameters q = [a, b, c, L m ] T .We assume a pinhole model for our camera.After the light rays exit the pinhole, the model is a repeated calculation of the intersection of lines (light rays) and planes (glass plates and light-bank) and the application of Snell's law in three dimensions.We place a Cartesian coordinate system (xyz) on the image plane with the z-axis pointing in the direction of the optical axis of the camera.All the light entering the camera travels through the pinhole and falls on the image plane.

Plane definition
The mathematical definition of a plane is where e = (a, b, c) is the unit normal vector of the plane, x 0 = (x 0 , y 0 , z 0 ) is the position vector to a point (x 0 , y 0 , z 0 ) on the plane and x is an arbitrary position vector within the plane.Expanding (11) yields We assume each of the planes 2 to 6 in Fig. 2 are parallel to each other.Then, the parameters a, b and c are the same for each of these planes; only d changes.The distances in the normal direction of each plane are known, e.g., L s , L g , etc.Given the equation describing plane 6, with d = d 6 , we can compute the equations describing the other planes using

Direction cosines
Each pixel in our image corresponds to a physical location on the image plane with coordinates x = (x, y, −L f ) , where L f is the distance from the image plane to the pinhole in the z-direction.We calculate this distance with the thin lens equation where f is the focal length of the camera and L m is the distance from the pinhole to the light-bank (plane 6) along the z-axis.This distance is found from (12) for x = y = 0 .Then, d = −cL m .The physical coordinates x and y on the image plane are obtained from the pixel locations x p , y p and the pixel pitch of the image sensor, S p .S p has units μm/pixel.The physical coordinates are then found from the pixel locations by where x 0 p and y 0 p are the pixel locations of the center of the image and x 0 q and y 0 q are the locations (in pixels) on the image plane from which the light rays would intersect the experimental set-up at an angle of 90 • , Each light ray travels in a straight line from these coordinates x , through the pinhole, to the experimental set-up.We describe each of these light rays with direction cosines: At the pinhole, all light rays pass through the origin and have coordinates (0,0,0).

Intersection light rays and planes: homogeneous medium
The equation governing light rays in homogeneous media is where s = (s x , s y , s z ) is the initial position, I = ( , , ) the direction cosines, p = (p x , p y , p z ) the final position and l the length traveled along the light ray.
To intersect with a plane, the final position p must lie on that plane.Substituting (12) into (18) and solving for l yields Substituting this l into (18) yields the location where each light rays intersects with the plane.

Snell's law
To find the angle of incidence, I , and the sign of cos I , S, between the incoming light ray and the plane, we compute Snell's law is used to find the angle of refraction, T .The index of refraction of the medium through which the (15) x = S p (x p − x 0 p − x 0 q ), y = S p (y p − y 0 p − y 0 q ), (16) incoming ray travels is n I and n T for the outgoing ray.To find the direction cosines of the outgoing ray, T , we calculate

Distance camera: entry glass plane
The distance L c , the distance from the camera to the entry of the first glass plane is for normalized e = [a, b, c].In the calibration procedure, the parameters c and L m are determined, so determining the distance L c through (24) ensures internal consistency in the model.It is also a good indicator for the correctness of the calibration procedure in Sect.4.2.

Fig. 1
Fig.1The experimental set-up: the orientation of a camera with respect to the normal e from a water tank is given by the angle .A probe is hanging inside the tank, ready to move up and down to measure a density profile of a fluid.The tank is being filled through tubes on the right hand side of the tank.The camera's line of sight is indicated by a straight line

Fig. 2 AFig. 3
Fig.2A schematic view of the path of a light ray for a frontal placement of the camera with = 0 • .n air , n g and n f are the indices of refraction of, respectively, air, the glass tank walls and the fluid.x is the angle of a light ray with respect to the z-axis.Subsequently using air and water as fluid, light rays (solid and dashed red lines, respectively) starting at the same location on the image plane, z = 0 , originate from two different locations in the object plane, the light-bank.They appear to be a distance Δ apart, due to differences in refraction index of the fluid in the tank.Planes 2 -5 are refraction planes, 0 is the image plane, 1 the position of the pinhole and 6 the object plane.The lengths L ⟨⋅⟩ indicate the lengths between the planes in the -direction

Fig. 4
Fig. 4 Frontal model results ( = 0 • ) for the images in Fig. 3: the displacements in the top row in (a) horizontal, Δ , (b) vertical, Δ and (c) radial direction, Δ .Using (5) and (6), the densities in the Fig.5The error in the displacements depends on the derivative of n with respect to = Δ ∕L t (blue) and the error in the determination of the optical axis (calibration) depends on the derivative with respect to

Fig. 6 A
Fig. 6 A schematic view (greatly exaggerated) of the parameters q = [a, b, c, L m ] T .The orientation of plane 6 (the light-bank) changes with the normal vector e = (a, b, c) .The distance from the pinhole P to the plane changes with L m .The angle is the same as in Fig. 1.The numbers 0 and 6 correspond to the image and object planes in Fig. 2, respectively.The distance from the image plane to the pinhole to the object plane is different for each light ray (in red) Fig. 7 Measurement on a two-layer system: (a) the optically measured density field; (b) the vertical density profiles from (a) in grey with the horizontally averaged density profile in blue; and (c) the correlation coefficient C for each grid point as a function of depth

Fig. 8 Fig. 9 Fig. 11
Fig. 8 Zooming in on the interface of Fig. 7.The DIC procedure had difficulties mapping the displacements of the interface

Fig. 12
Fig. 12 (a) The optically measured vertical density gradient field for the nonlinearly stratified fluid shown in Fig. 11; and (b) the vertical density gradient profiles from (a) in grey with the horizontally averaged density gradient profile in blue and the probe density gradient profile in red (11) e ⋅ (x − x 0 ) = 0,(12) ax + by + cz + d = 0 with d = −ax 0 − by 0 − cz 0 .(13) d 2 = d − L s − 2L g − L t , d 3 = d − L s − L g − L t , d 4 = d − L s − L g , d 5 = d − L s .
d + as x + bs y + cs z a + b + c (20) cos I = e ⋅ I and S = sign cos I .

Table 1
Digital Image Correlation parameters for a measurement at an angle = 30 •