# Quaternion Processing Techniques for Color Synthesized NDT Thermography
## 3 Proposed Approach
### Description of the Quaternion Processing  
The results obtained after applying the dimensionality reduction techniques are color image sequences, where each color image is made up of a triplet of single-channel images. These single-channel images collect a large amount of information from the original P polynomial approximations based on a reduction technique used in the process. It has been verified in previous studies that, in general, the color images generated from thermographic results lose contrast, and defects that can be seen in the individual channels may be hidden, due to the lower capacity of human vision to perceive variations of certain shades of color than gray scales [21]. On the contrary, human perception is more effective with specific color levels that with intensity gray levels. Applying image processing to these color images, substantially improves the visualization of the results. Color images can be processed using grayscale imaging techniques  
Figure 2: Dimension reduction scheme applied with the proposed colorization method. applied to each channel individually or specific color imaging techniques applied to the three channels jointly (Figure 3a), but these procedures are sometimes inefficient and unable to perform advanced mathematical operations. Quaternion analysis was used instead in this study to carry out the processing of the color images. A quaternion \(q\) is an element of the 4D normed algebra over \(\mathbb{R}\), denoted by \(\mathbb{H}\), with the base \(\{\mathbf{1},\mathbf{i},\mathbf{j},\mathbf{k}\}\). \[\mathbb{H}=\{q=q_{0}\mathbf{1}+q_{1}\mathbf{i}+q_{2}\mathbf{j}+q_{3}\mathbf{k }\quad\text{with}\quad q_{0},q_{1},q_{2},q_{3}\in\mathbb{R}\}\]  
where \(q_{0}\), \(q_{1}\), \(q_{2}\) and \(q_{3}\) are real coefficients, and \(\mathbf{i}\), \(\mathbf{j}\) and \(\mathbf{k}\) are imaginary operators that satisfy the following multiplication rules:  
\[\mathbf{i}^{2}=\mathbf{j}^{2}=\mathbf{k}^{2}\] \[\mathbf{ij}=-\mathbf{ji}=\mathbf{k}\] \[\mathbf{ki}=-\mathbf{ik}=\mathbf{j}\] \[\mathbf{jk}=-\mathbf{kj}=\mathbf{i}\]  
The components of a pixel in a color image expressed in RGB space can be represented in quaternion form using pure quaternions [30], where the three imaginary parts are used to represent the color components: Red, Green and Blue (Figure 3b). Each pixel at (\(x\),\(y\)) coordinates of an RGB image can be expressed as  
\[q(x,y)=r(x,y)\mathbf{i}+g(x,y)\mathbf{j}+b(x,y)\mathbf{k} \tag{8}\]  
where \(r(x,y)\), \(g(x,y)\) and \(b(x,y)\) are the red, green, and blue components, respectively. Subsequently, color image processing based on quaternion operations is applied, which improves the efficiency of the processing of individual channels and allows operations that cannot be applied to the channels individually or jointly by conventional techniques. The quaternion analysis techniques that have been applied in this study are Fourier quaternion analysis, quaternion principal component analysis, and quaternion image filtering for color edge detection. Color image filtering has also been applied for smoothing and enhancing, which produces the same results as applying the filtering individually to each channel but improves the efficiency of processing when applied to the three channels at the same time. Figure 3: Color image processing: (**a**) quaternionic relationships between RGB and HSV color spaces, (**b**) geometric representation of a color by quaternions. Discrete Quaternion Fourier Transform (DQFT)  
The definition of Fourier transform has been extended to quaternion analysis based on the operations of multiplication and exponentiation of quaternions [31; 32]. As a consequence of the non-commutativity of the quaternion product, there are three different definitions of the discrete quaternion Fourier transform. The expressions for each of the definitions are shown below.