Image¶
The images used with geopyv are first converted to grayscale and then pre-filtered using a 5 by 5 Gaussian smoothing kernel with a standard deviation of 1.1, which is done in order to reduce bias errors as demonstrated by Pan [2]. Digital images, consisting of pixel intensity arrays, are discrete representations of a continuous field, hence, image intensity interpolation is a necessary operation in all iterative local DIC algorithms. In geopyv, bi-quintic B-spline interpolation is adopted, which although computationally expensive, minimises bias errors as demonstrated by Schreier et al. [5].
Todo
Show transformation of a subset from colour to grayscale to Guassian pre-filtered.
Computation of B-spline coefficients¶
The B-spline coefficents are pre-computed for all images using recursive 1D deconvolution. The grayscale reference image \(f\), is first padded with a replicated border (default of 20 pixels) to create the padded reference image \(f_{p}\) of size \((i,j)\) pixels. The quintic B-spline kernel \(\mathbf{b}\) is:
A null vector \(\mathbf{b}_{x} = 0_{1,j}\) is then created, into which the quintic B-spline kernel \(\mathbf{b}\) is inserted as follows:
The Fast Fourier Transform (FFT) of this padded kernel vector is used to divide the FFT of the \(i\)-th row of the padded grayscale image \(\mathbf{I}_{p}\), after which the inverse FFT is taken for each row:
where \(F\) and \(F^{-1}\) represent the FFT and inverse FFT, respectively.
A second null vector \(\mathbf{b}_{y} = 0_{1,i}\) is then created, into which the B-spline kernel is inserted as follows:
The FFT of this padded kernel vector is used to divide the FFT of the \(j\)-th column of the B-spline coefficient matrix \(\mathbf{C}\), after which the inverse FFT is taken for each column to yield the final matrix of B-spline coefficients:
This array of coefficients is computed by _get_C(). The same technique is used to calculate the B-spline coefficients for the target image \(g\).
Warning
The padded image must be at least as large as the quintic B-spline kernel in order for this method to function correctly (i.e. i > 5, j > 5).
Precomputation of interpolant array¶
The bi-quintic B-spline kernel \(\mathbf{Q}\) is:
and \(\mathbf{Q}^T\) is its transpose.
The \(\mathbf{C}_\left(i-2:i+3, j-2:j+3\right)\) matrix is a subset of the B-spline coefficient matrix \(\mathbf{C}\) computed by _get_C(), where \(i\) and \(j\) are the image coordinates:
The following matrix is pre-computed from these quantities for all pixels in the image by _get_QCQT():
Note
This pre-computation - although computationally efficient when used in repeated image intensity interpolation - requires a significant amount of memory, particularly for large images.
Image intensity interpolation¶
In general, the intensity of arbitrary image coordinates are estimated using bi-quintic B-spline image intensity interpolation. First, the sub-pixel component of the position of each point in the subset is computed as follows from the current coordinates:
where \(\lfloor x\rfloor\) and \(\lfloor y\rfloor\) are the floor of the coordinates \(x\) and \(y\). The interpolated pixel intensity at the current sub-pixel coordinate \((x, y)\) in the reference image \(f\), defined as \(f(x, y)\), is then calculated by performing the following operation:
where \(\mathbf{Q} \cdot \mathbf{C}_{f} \cdot \mathbf{Q}^T\) is precomputed for the entirety of image \(f\) by _get_QCQT(). The same method is used to interpolate pixel intensitites for both the reference image \(f\) and the target image \(g\).