Skip to Content
  • Proceeding Paper
  • Open Access

2 December 2026

Embedded Implementation of the QIRMT Transform for Image Reconstruction on Raspberry Pi †

,
,
,
,
,
,
and
1
Laboratory of Innovative Technologies (LIT), National School of Applied Sciences, Abdelmalek Essaadi University, Tangier 90000, Morocco
2
Laboratory of Intelligent Systems and Applications (LSIA), Moroccan School of Engineering Sciences (EMSI), Tangier 90000, Morocco
3
Engineering, Systems and Applications Laboratory, National School of Applied Sciences, Sidi Mohamed Ben Abdellah University, Fez 30000, Morocco
*
Author to whom correspondence should be addressed.

Abstract

In this paper, we show an embedded implementation of the QIRMT designed for the lossless reconstruction of color images on the Raspberry Pi 5. The proposed architecture includes matrix generation, a quaternion representation of the image, 8 × 8 block processing and the application of the inverse transform. Experimentations with several tests’ images confirm the feasibility of such an approach on a low-cost embedded platform. The obtained results confirm a perfect reconstruction with a zero MSE and infinite PSNR for all the processed images. A performance analysis reveals stable execution, controlled resource consumption and energy efficiency. Raspberry Pi 5 sustains an average power draw of approximately 5–7 W during the full QIRMT pipeline execution, yielding an estimated energy cost of roughly 0.3–0.5 J per 512 × 512 image—a favorable figure for a constrained embedded platform.

1. Introduction

Image reconstruction plays a central role in many application areas, including medical imaging, computer vision, remote sensing, and intelligent embedded systems. Its goal is to reconstruct an image from a transformed or incomplete representation, while preserving its essential visual characteristics as faithfully as possible [1]. In this context, techniques based on orthogonal and invertible transformations are gaining increasing popularity, as they provide a compact, faithful, and mathematically sound description of visual information [2]. Among these techniques, the QIRMT (Quaternion Integer Reversible Meixner Transform) stands out for its promising capabilities in the field of image reconstruction [3]. Its fully invertible formulation, combined with its efficiency processing visual information, makes it a strong candidate for application contexts that require accuracy, numerical stability, and minimal information loss. However, most existing work is confined to theoretical validation or implementations on general-purpose computing platforms, which limits its deployment in real-world embedded environments.
At the same time, the growing use of embedded systems has made it possible to run image processing algorithms locally under strict constraints, such as cost, power consumption, size, and execution time. In this context, the Raspberry Pi is a suitable platform due to its versatility, low energy requirements, affordable cost, and ability to handle advanced digital processing tasks [4]. Its increasing use in smart embedded systems makes it a relevant platform for evaluating new image reconstruction methods under real-world conditions.
Most important is energy consumption, which must be listed amongst the evaluation criteria. Being computational does not imply that something uses too much power—this relationship to power usage must be specified. A transform that can be used to perfectly reconstruct an image yet use excessive power and heat the processor too much for the architecture cannot be deployed and is a major disadvantage in relation to reconstruction quality. This becomes even more vital in an autonomous and battery life system, where energy budgets, heat management and long-term scalability become major factors.
This paper focuses on the embedded implementation of the QIRMT in Raspberry Pi for image reconstruction. The objective is to assess whether this approach can be effectively deployed on a lightweight hardware platform, while evaluating its performance in terms of reconstruction quality, execution time, and hardware resource usage. This study thus bridges the gap between theoretical developments in QIRMT and practical implementation geared toward embedded applications.

2. Materials and Methods

The widespread use of devices equipped with cameras, such as computers, smartphones, and tablets, has increased interest in effective methods for medical image processing. However, traditional approaches—which rely on the application of transformations, such as DWT [5], DCT [6], or moments, separately on each color channel—have certain limitations. Indeed, they significantly increase computation time and do not provide a comprehensive, compact, and coherent representation of color data.
To address these limitations, quaternion transformations have been proposed to provide a comprehensive representation of color images, where each pixel is represented by a quaternion, that is, by a four-component entity. Subsequently, a unified approach has emerged for constructing quaternion integral moments applicable to many contexts. Today, these transformations are used in several fields, such as the registration [7], classification [8], reconstruction, and segmentation of color images [9] as well as copyright protection [10].

2.1. Quaternions

First proposed by William Rowan Hamilton in 1843, quaternions are an extension of complex numbers into a set of hypercomplex numbers. Composed of a real part and three imaginary parts, they are expressed as follows [11]:
Q = a + bi + cj + dk = Re ( Q ) + Im ( Q ) Re ( Q ) = a     ;     Im ( Q ) = bi + cj + dk
In these expressions, Re(Q) denotes the real part of the quaternion Q, while Im(Q) denotes the imaginary part, Q and the coefficients a, b, c and d belong to the set of real numbers, whereas i, j and k correspond to imaginary operators related to one another by the specific relations given below:
i 2 = j 2 = k 2 = − 1   ;   ij = k   ;   ji = − k   ;   jk = i   ;   kj = − i   ;   ki = j   ;   ik = − j
The conjugate Q* and the norm |Q| of a quaternion number are given by the following two relations:
Q * = a − bi − cj − dk   and   Q = a 2 + b 2 + c 2 + d 2

2.2. Meixner’s Integer Reversible Quaternion Transform (QIRMT)

The quaternion Q can be used to represent four one-dimensional (1D) integer signals (f1, f2, f3, f4), in a compact form, defined as follows [3]:
f Q = f 1 + i f 2 + j f 3 + k f 4
We introduce the operator [ ⋅  ]Q, which applies a rounding operation to each real-valued component of the quaternion, as described by the following expression:
Q Q = a + b i + c j + d k
For a one-dimensional (1D) quaternion signal, the QIRMT is defined by the following relation:
QIRMT ( f Q ) = P S N … S 1 S 0 f Q Q Q … … Q
The reconstruction of this signal is performed using the following formula:
f ^ Q = iIRMT ( f Q ) = S 0 − 1 … S N − 1 − 1 S N − 1 P T IRMT ( f Q ) Q Q … … Q
This operation corresponds to the inverse quaternionic integer reversible Meixner transform, denoted as iQIRMT (inverse quaternionic integer reversible Meixner transform).
Let HQ be a quaternion number that provides a compact representation of four two-dimensional (2D) integer signals (H1, H2, H3, H4), defined as HQ = H1 + iH2 + jH3 + kH4.
The QIRMT of the signal LQ is then given by the following relation:
QIRMT H Q = QIRMT QIRMT H Q
This signal is reconstructed using the following relation:
H ^ Q = iQIRMT iQIRMT QIRMT ( H Q )
This operation, denoted as iQIRMT, corresponds to the inverse quaternionic integer reversible Meixner transform in the two-dimensional (2D) case.

2.3. The Raspberry Pi 5 Platform

Raspberry Pi 5, developed by the Raspberry Pi Foundation, is a single-board computer (SBC) that was released in October 2023 [4]. It was selected as the target platform for this implementation due to its excellent trade-off between computational performance and energy consumption. Table 1 below summarizes the technical specifications of the Raspberry Pi 5 platform selected for this implementation, along with the enabled optimization mechanisms.
Table 1. Raspberry Pi 5 specifications.

3. Image Reconstruction Using Raspberry Pi 5

The proposed image reconstruction architecture is based on an embedded platform built around Raspberry Pi 5, which executes the entire algorithmic pipeline of the QIRMT applied to a color image (Figure 1). The main objective of this architecture is to demonstrate the feasibility of lossless image reconstruction on a low-cost embedded system while maintaining reasonable computational efficiency.
Figure 1. Proposed architecture for image reconstruction.

3.1. Input Stage

As input, the system receives a 512 × 512-pixel RGB color image encoded in uint8 [12]. These dimensions are particularly well-suited to the chosen architecture, as they allow for a regular division into 8 × 8 blocks, as used by the QIRMT algorithm (Appendix A). This image constitutes the starting point of the transformation and reconstruction process. It is first loaded into Raspberry Pi’s memory then converted into a matrix format suitable for the mathematical operations required by the transformation.

3.2. The Generation of the Transformation Matrices

The first step consists of generating the matrices required for the QIRMT, using the generate_matrices.py script. This stage includes three main operations carried out in sequence. First, the Meixner matrix is constructed as an orthogonal basis for representing the image; it depends on two parameters, β and μ, which define the shape of the associated orthogonal polynomials.
The resulting matrix is then orthogonalized using the Gram–Schmidt process to ensure that the basis vectors are mutually orthogonal, which is necessary for the numerical stability of the transformation. The resulting orthogonal matrix is finally factorized using the PLUS decomposition method, yielding the SERMs. It is precisely these matrices that contain all the parameters necessary to apply QIRMT as well as its inverse transformation.

3.3. Processing Phase: QIRMT

After the matrix generation stage, the image is processed using QIRMT. The RGB image is first converted into a quaternion representation, where the three-color components are associated with the imaginary components of the quaternion. Then, processing is performed block by block using 8 × 8 pixel blocks. This strategy offers several advantages:
▪
A reduction in computational complexity;
▪
Better memory management;
▪
Possible parallelization.
Two main operations are applied: the 2D-QIRMT and its inverse transform, 2D-iQIRMT, which allows the reconstruction of the original image.

3.4. Output Stage

After applying the inverse transformation, the reconstructed image is obtained as an RGB color image with a resolution of 512 × 512 pixels. Thanks to the properties of the QIRMT, the reconstruction process is lossless, ensuring that the reconstructed image is identical to the original one. The result is then saved under the name reconstructed.png. Finally, a comparison between the input image and the reconstructed image makes it possible to experimentally verify the reversibility of the QIRMT, thereby confirming the validity of the reconstruction process.

4. Results and Discussion

The experimental results obtained on the Raspberry Pi 5 platform enable an assessment of the performance of the proposed architecture for image reconstruction based on the QIRMT-2D transformation. The analysis focuses on reconstruction fidelity, execution time, hardware resource utilization and the potential for optimizing the embedded implementation.

4.1. Visual Reconstruction Results

Reconstruction quality was evaluated using the MSE and PSNR metrics. For all tested images, the MSE is zero, which indicates a perfect match between the original images and those obtained after reconstruction. Consequently, the PSNR is infinite, confirming the exact reversibility of the QIRMT-2D transformation. Table 2 reports this comparison for several test images and shows that, in all cases, the reconstruction is lossless.
Table 2. Reconstruction results for medical images using the 2D-QIRMT.

4.2. Runtime Analysis

Figure 2 shows that most of the execution time is spent in the direct (QIRMT-2D) and inverse (iQIRMT-2D) transformation stages. This is due to the high computational cost of these operations, which involve repeated matrix–vector multiplications over many blocks (4096 blocks of size 8 × 8). Each block is processed through two-dimensional transformations in both directions, leading to a cumulative cost. In total, these two stages account for more than 60% of the execution time, making them the main bottleneck of the system.
Figure 2. Performance analysis and execution time breakdown of the QIRMT-2D pipeline.
In addition, the generation of matrices (Meixner, Gram–Schmidt orthogonalization, and SERM decomposition), although theoretically complex, has a limited impact on the execution time. This is because these operations are performed on small matrices (8 × 8), which keeps their computational cost low compared to the overall runtime.

4.3. Analysis of Resource Consumption

Concerning resource consumption (Figure 3), we observe that the CPU utilization rate remains high and generally stable throughout the execution, with peaks coinciding with the transformation phases. This behavior indicates heavy utilization of the Cortex-A76 processor, particularly its NEON vector processing units, and confirms that the implementation fully leverages the computational capabilities offered by the chip. The high average utilization rate also reflects the computationally intensive nature of the QIRMT algorithm. On the memory side, the footprint remains moderate and stable, validating the effectiveness of the block-processing strategy. Since each block is processed independently, only a small portion of the image is being manipulated at any given time, allowing active data to be kept in the L1 and L2 caches. This significantly improves memory locality and limits access to the main memory, which directly contributes to the system’s overall efficiency. As for the processor temperature, it rises gradually as the task runs, a phenomenon expected under sustained computational loads, but the recorded values remain within the tolerable ranges for the normal operation of Raspberry Pi 5, proving that the system can handle this type of processing without suffering any significant thermal degradation.
Figure 3. Resource consumption over time.
It should be noted that the architecture of the QIRMT algorithm is particularly well-suited to parallelization. Although the version currently under development remains essentially sequential, the division into independently processed blocks, combined with the autonomy of the quaternion channels, opens interesting possibilities for acceleration. By fully utilizing the four cores of the Cortex-A76 via parallelization techniques (OpenMP or multithreading), it would be possible to significantly reduce the execution time, potentially by a factor of 3 to 4.

5. Conclusions

In this paper, we presented an embedded implementation of the QIRMT on Raspberry Pi 5 for lossless color image reconstruction. The results demonstrate the feasibility and effectiveness of this approach on a low-cost platform, achieving perfect reconstruction (MSE = 0, PSNR = ∞) for all tested images. Beyond reconstruction quality, this study provides a quantitative characterization of the energy profile: the QIRMT pipeline sustains an average power draw of approximately 6 W during execution, yielding an energy cost of roughly 0.4 J per 512 × 512 image—a competitive figure for an embedded real-time context. Compared to channel-separated approaches, such as DCT- or DWT-based pipelines, QIRMT achieves comparable energy efficiency while providing a more coherent quaternion domain representation of color data. Scalability analysis indicates that the block-independent processing structure enables direct multi-core parallelization, with projected speed-up factors of three to four on the four-core Cortex-A76 processor, making real-time operation at standard image resolutions a realistic target. In future work, we plan to extend this approach to FPGA-based implementations to further exploit hardware parallelism and to evaluate the energy–performance trade-off at higher image resolutions and under strict real-time constraints.

Author Contributions

A.S. and A.E.; methodology, A.S. and M.S.; software, A.S. and A.E.; validation, I.B.H., N.N. and A.B. (Ahmed Bencharqui); formal analysis, A.S. and M.S.; investigation, A.S. and A.E.; resources, I.B.H. and N.N.; data curation, A.S. and A.E.; writing—original draft preparation, A.S.; writing—review and editing, all authors; visualization, A.S. and A.E.; supervision, M.S., A.B. (Abderrahim Bourkane) and A.C.; project administration, A.B. (Abderrahim Bourkane) and A.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data presented in this study are available upon request from the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

Recent work [12] has shown that the Meixner polynomial matrix, of dimension N × N and corresponding to the kernel of Meixner moments, admits when the condition |det(M)| = 1 hold a decomposition into a product of invertible single-line elementary matrices (SERMs). These matrices have the property of being intrinsically reversible over the ring of integers.
Specifically, M factors into (N + 1) reversible elementary matrices according to the following expression:
M = P S N S N − 1 … … S 1 S 0
In this relation, P represents the permutation matrix associated with M, and the SERMs (Si) are given by the Equation (A2):
S 0 = I + e N s 0 T   and   S i = I + e i s i T     ;     ( i = 1 , 2 … … N )
In this context, ei denotes the i-th column of the identity matrix I, and si represents the vectors forming the necessary components of the SERMs. These vectors must satisfy the condition that the i-th element must be zero.
Example: For N = 8; μ = 0, 5 and β = 2, we have
M = 0.5050 0.5435 0.4981 0.3710 0.2243 0.1088 0.0405 0.0101 0.5050 0.2508 − 0.1222 − 0.4348 − 0.5188 − 0.3990 − 0.2117 − 0.0706 0.4373 0.0364 − 0.3951 − 0.3031 0.1445 0.4936 0.4848 0.2446 0.3571 − 0.2367 − 0.3564 0.1274 0.4339 0.0535 − 0.4824 − 0.4994 0.2823 − 0.3508 − 0.1484 0.3973 0.0864 − 0.4582 − 0.0314 0.6317 0.2187 − 0.3985 0.1123 0.3448 − 0.3800 − 0.0796 0.5213 − 0.4893 0.1670 − 0.4011 0.3541 − 0.0028 − 0.3801 0.5461 − 0.4444 0.2135 0.1262 − 0.3764 0.5420 − 0.5371 0.4183 − 0.2606 0.1250 − 0.0404
This matrix can be factorized into nine SERMs, M = PS8S7S6S5S4S3S2S1S0, with
P = 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0
And s 0 T s 1 T s 2 T s 3 T s 4 T s 5 T s 6 T s 7 T s 8 T = − 1.1362 3.5755 0.8074 4.3543 2.6808 5.7240 − 4.5210 1 0 − 2.6093 − 0.6584 − 2.3533 − 1.6071 − 4.0740 2.8244 0.6317 − 0.2104 0 − 0.0917 1.8069 1.4347 2.0550 − 2.1460 − 0.3665 0.9066 1.8549 0 − 1.8094 − 1.6341 − 1.6569 2.6082 0.3637 − 0.4914 − 1.1826 0.6255 0 1.7098 1.3802 − 1.9639 − 0.3268 − 0.2449 − 0.6975 1.2281 − 1.3844 0 0.9348 − 1.9357 − 0.3325 − 0.3712 0.0223 2.1215 − 1.6011 − 2.1858 0 − 2.0168 − 0.4841 0.7985 − 0.5677 − 2.1922 1.9917 2.3726 1.6127 0 0.4848 − 1.5823 2.1660 4.4384 − 4.3662 − 4.4573 − 4.4018 2.9794 0
The SERMs described above obey the following property:
S 0 − 1 = S 0 = I + e N s 0 T   and   S i − 1 = I − e i s i T     ;     ( i = 1 , 2 … … N )
Through this approach, the IRMT establishes mapping that remains strictly within the domain of integers, thereby preserving the discrete nature of the input signal while ensuring a fully invertible transformation with no loss of information. This advantage makes the IRMT a particularly suitable choice for applications where it is essential to faithfully and accurately reconstruct the original signal from its transformed coefficients.

References

  1. Sayyouri, A.; Bencherqui, A.; Sayyouri, M.; Hafid, A.; Bourkan, A.; Cherkaoui, A. Optimization of Meixner Parameters Using the AOA Algorithm for Signal and Image Analysis. In Digital Technologies and Applications; Motahhir, S., Bossoufi, B., Eds.; Springer Nature: Cham, Switzerland, 2024; pp. 345–354. [Google Scholar]
  2. Solak, S.; Abdirashid, A.M.; Adjevi, A.; Sahu, A.K. Robust data hiding method based on frequency coefficient variance in repetitive compression. Eng. Sci. Technol. Int. J. 2024, 56, 101756. [Google Scholar] [CrossRef] [Scilit]
  3. Mukundan, R.; Ong, S.H.; Lee, P.A. Image analysis by Tchebichef moments. IEEE Trans. Image Process. 2001, 10, 1357–1364. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  4. Jolles, J.W. Broad-scale applications of the Raspberry Pi: A review and guide for biologists. Methods Ecol. Evol. 2021, 12, 1562–1579. [Google Scholar] [CrossRef] [Scilit]
  5. Giri, K.J.; Quadri, S.M.K.; Bashir, R.; Bhat, J.I. DWT based color image watermarking: A review. Multimed. Tools Appl. 2020, 79, 32881–32895. [Google Scholar] [CrossRef] [Scilit]
  6. Douak, F.; Benzid, R.; Benoudjit, N. Color image compression algorithm based on the DCT transform combined to an adaptive block scanning. AEU—Int. J. Electron. Commun. 2011, 65, 16–26. [Google Scholar] [CrossRef] [Scilit]
  7. Hill, D.L.G.; Batchelor, P.G.; Holden, M.; Hawkes, D.J. Medical image registration. Phys. Med. Biol. 2001, 46, R1–R45. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Lu, D.; Weng, Q. A survey of image classification methods and techniques for improving classification performance. Int. J. Remote Sens. 2007, 28, 823–870. [Google Scholar] [CrossRef] [Scilit]
  9. El Ghouate, N.; Bencherqui, A.; Mansouri, H.; El Maloufy, A.; Tahiri, M.A.; Karmouni, H.; Sayyouri, M.; Askar, S.S.; Abouhawwash, M. Improving the Kepler optimization algorithm with chaotic maps: Comprehensive performance evaluation and engineering applications. Artif. Intell. Rev. 2024, 57, 313. [Google Scholar] [CrossRef] [Scilit]
  10. El-Khanchouli, K.; Mansouri, H.; El Ghouate, N.; Karmouni, H.; Joudar, N.-E.; Sayyouri, M.; Askar, S.S.; Abouhawwash, M. Protecting Medical Images Using a Zero-Watermarking Approach Based on Fractional Racah Moments. IEEE Access 2025, 13, 16978–17001. [Google Scholar] [CrossRef] [Scilit]
  11. Vince, J. Quaternions for Computer Graphics, 2nd ed.; Springer: London, UK, 2021. [Google Scholar] [CrossRef] [Scilit]
  12. Hao, P.; Shi, Q. Matrix factorizations for reversible integer mapping. IEEE Trans. Signal Process. 2001, 49, 2314–2324. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.