# Stereo Digital Image Correlation in MATLAB
## 2 Framework Theory
### Correlation  
ADIC3D uses correlation to track a subset, a cluster of pixels, between images. The specimen's surface requires an isotropic, random pattern with high information content such that subsets are tracked reliably. Correlation operates on two images: a reference image, \(F\), representing the specimen in its relaxed state and a deformed image, \(G\), representing the specimen after experiencing displacement and/or deformation. Correlation determines how a subset of the reference image, called a reference subset (\(\mathbf{f}\)), must displace and deform such that it matches a corresponding subset in the deformed image, called an investigated subset (\(\mathbf{g}\)). This is referred to as the correspondence problem, which is mathematically defined as the objective function. For a more detailed discussion on the correspondence problem, the reader is referred to the authors' previous paper [53].  
Note that correlation operates solely within the distorted sensor CS and is unconcerned with which camera the distorted sensor CS belongs to. Thus, in Sections 2.3 and 3.2, the subscript \(s_{j}\) is dropped from \(\mathbf{x}_{s_{j}}\) (i.e., \(\mathbf{x}\)) to simplify the mathematics.  
To understand how the objective function is comprised of the SF, the interpolation method and correlation criterion first consider that the \(i^{\text{th}}\) pixel position of \(\mathbf{f},\mathbf{x}_{i}=\left[\begin{array}{cc}x_{i}&y_{i}\end{array}\right]^{T}\)is represented by the reference subset center position, \(\mathbf{x}^{o}=\left[\begin{array}{cc}x^{o}&y^{o}\end{array}\right]^{T}\), and the distance from \(\mathbf{x}^{o}\) to \(\mathbf{x}_{i}\), \(\Delta\mathbf{x}_{i}=\left[\begin{array}{cc}\Delta\mathbf{x}_{i}&\Delta\mathbf{y}_{i} \end{array}\right]^{T}\), as  
\[\mathbf{x}_{i}=\Delta\mathbf{x}_{i}+\mathbf{x}^{o}. \tag{6}\]  
The SF, \(\mathbf{W}\), determines how the pixel positions of \(\mathbf{f}\) displace as a result of the displacement and deformation of \(\mathbf{f}\), which is quantified by the shape function parameters (SFPs), \(\mathbf{P}\). The SF does this by modifying \(\Delta\mathbf{x}_{i}\) as  
\[\Delta\mathbf{x}_{i}^{\prime}=\left[\begin{array}{c}\Delta\mathbf{x}_{i}^{\prime} \\ \Delta\mathbf{y}_{i}^{\prime}\end{array}\right]=\mathbf{W}(\Delta\mathbf{x}_{i},\mathbf{P}). \tag{7}\]  
The pixel positions of \(\mathbf{f}\) after displacement and deformation, \(\mathbf{x}_{i}^{\prime}=\left[\begin{array}{cc}\mathbf{x}_{i}^{\prime}&y_{i}^{ \prime}\end{array}\right]^{T}\), (referred to as query points) are determined as  
\[\mathbf{x}_{i}^{\prime}=\Delta\mathbf{x}_{i}^{\prime}+\mathbf{x}^{o}. \tag{8}\]  
Thus \(\Delta\mathbf{x}_{i}^{\prime}\) represents the distance from the center of \(\mathbf{f}\) to \(\mathbf{x}_{i}^{\prime}\). The light intensity values of \(G\) are interpolated at \(\mathbf{x}_{i}^{\prime}\) to obtain \(\mathbf{g}\). Thus, \(\mathbf{g}\) represents a portion of \(G\) at a location described by the displacement SFPs with the deformation defined by the SFPs having been removed. The correlation criterion quantifies the degree of similarity between \(\mathbf{f}\) and \(\mathbf{g}\).