# Image Classification for Automated Image Cross-Correlation Applications in the Geosciences
## 2 Methods
### Image Cross-Correlation Processing  
Digital image correlation (DIC) developed following the advent of performant computer machines and digital photography in the early 1990s, and has been applied predominantly in fluid dynamics [26; 27] and satellite imagery [1]. The rationale behind DIC is to determine the field of motion using spatial cross-correlation between corresponding subsets of two images (image cross-correlation, ICC), where ICC analyses the texture of an image rather than specific recognisable elements (as in feature tracking methods [28; 29]). ICC can be computed in the spatial domain (direct cross-correlation, DCC) [1; 3; 26] or in the frequency domain (phase cross-correlation, PCC) using the discrete Fourier transform (DFT). In the former case, a subset of the original (master) image slides into a larger interrogation area of the slave image. In this respect, a two-dimensional (2D) correlation coefficient is computed for each possible position, and a map of correlation values is obtained. The coordinates of the element with the maximum correlation coefficient correspond to the displacement of the slave image in relation to the master. Although DCC requires high computational costs, it suffers less from decorrelation associated with motion, because it computes correlations between the same tiles in different positions (the Lagrangian approach). Conversely, the PCC computes the correlation between master and slave tiles (that are in the same position) into the image (the Eulerian approach). Therefore, part of the original texture is removed with respect to motion from the interrogation area, and this causes possible decorrelation. The PCC is computed through a complex product involving the Fourier transforms of the master and slave images, and this is equivalent to conducting a spatial cross-correlation in accordance to the convolution theorem. In our work, the ICC is operated in the phase domain, as it provides a faster computation [30; 31] process than DCC, but a similar performance [32]. Specifically, we use the two-step computation method proposed by [PERSON] et al. [33]. In the first run, the CC is computed with integer precision, thereby avoiding the zero-padding operation, and the centre of the slave matrix is then translated according to the shifts obtained. In the second run, the DFT is applied only to a small subset of the data to obtain subpixel accuracy. This method has the advantage of strongly limiting the zero-padding operation, thereby reducing the computational costs, and limiting the loss of information intrinsic in the PCC due to the Eulerian approach used in measurements [16; 31]. The processing chain adopted in this study is based upon the approach presented in [PERSON] et al. [34], and can be divided into four steps. First, certain image enhancement operations are conducted [12; 13; 14]. The scene illuminant is computed using principal components analysis (PCA) [35] and then subtracted from the trichromatic (RGB) image. The removal of the illuminant allows the reduction of possible low-frequency signals caused by illumination changes that can affect the computation of the DFT [36]. Subsequently, the image is converted to greyscale, and a sharpen mask is applied to enhance the details in the image texture. Such an operation aims to reduce any possible defocusing or blurring effects that are frequent in images acquired with limited illumination; in this respect, [PERSON] and [PERSON] [12] stated that the application of a sharpen mask can improve the ICC results in hazy situations. Second, the images are coregistered with respect to a common image to correct possible misalignments. The CC is computed on an area that is assumed to be stable, and the images are planarly translated according to the shifts obtained. Third, a sliding window identifies corresponding tiles on both the master and the slave images; the CC is then computed on the tile couples. Adjacent windows are overlapped by 50% to improve the robustness of the results. Fourth, outlier removal is conducted.