An Improved Image Compression Algorithm Using 2D DWT and PCA with Canonical Huffman Encoding
Abstract
:1. Introduction
2. Literature Review
3. Fundamental Concepts
3.1. Principal Component
- ❖
- PCA is a standard method for reducing the number of dimensions.
- ❖
- The variables are transformed into a fresh set of data, known as primary components. These principal components are combinations of initial variables in linear form and they are orthogonal.
- ❖
- The first principal component accounts for the majority of the potential variation in the original data.
- ❖
- The second principal component addresses the data variance.
3.1.1. Mathematical Concepts of PCA
- Step-01:
- Obtaining data.
- Step-02:
- Determining the mean vector (µ).
- Step-03:
- Subtracting the mean value from the data.
- Step-04:
- Performing a covariance matrix calculation.
- Step-05:
- Determining the eigenvalues and eigenvectors of the covariance matrix.
- Step-06:
- Assembling elements to create a feature vector.
- Step-07:
- Creating a novel data set.
3.1.2. Mathematical Example
3.2. Discrete Wavelet Transform
The Operational Principle of DWT
3.3. Thresholding
Hard Thresholding
3.4. Entropy Encoder
Canonical Huffman Coding
4. Proposed Method
4.1. Basic Procedure
4.2. Pca Based Compression
Algorithm 1: PCA_Algorithm [12] |
Encoding Input: The image , Here, the values x and y represent the coordinates of individual pixels in an image. Depending on the type, the value corresponds to the color or gray level. Step 1: Image normalization has to be performed. The normalization is carried out on the image data set . |
Here, is the column vector containing the mean value for to . Step 2: Computation of covariance matrix of is performed. |
Here, m is the number of element y. Step 3: Computation of Eigenvectors and Eigenvalues of is performed. Using the SVD equation , the eigenvectors and eigenvalues are calculated. Here, “U” represents the eigenvectors of “”, while the squared singular values in “D” are the eigenvalues of “”. The eigenvector matrix denotes the principal feature of image data, i.e., the principal component. Output: Image data with reduced dimension: |
Here, is the transpose of the eigenvectors matrix and is the adjusted original image datasets. It can also be expressed as: |
Here, “m” and “n” represent in the matrix, while “k” represents the number of principal components with . Decoding By reconstructing the image data, one obtains |
In PCA, the compression ratio (ρ) [12] is calculated as: |
4.3. Dwt-Chc Based Compression
Algorithm 2: DWT_CHC Algorithm [16] |
Input: An image in grayscale of size Output: A reconstruction of a grayscale image of size Encoding of Image
Decoding of Image
|
4.4. Pca-Dwt-Chc-Based Image Compression
5. Performance Assessment
6. Experiment Result
6.1. Visual Performance Evaluation of Proposed Pca-Dwt-Chc Method
6.2. Objective Performance Evaluation of Proposed Pca-Dwt-Chc Method
6.2.1. Tabular Results for Comparative Analysis of Proposed Method
6.2.2. Graphical Representation for Comparative Analysis of Proposed Method
6.3. Time Complexity Analysis of Proposed Pca-Dwt-Chc Method
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Latha, P.M.; Fathima, A.A. Collective Compression of Images using Averaging and Transform coding. Measurement 2019, 135, 795–805. [Google Scholar] [CrossRef]
- Farghaly, S.H.; Ismail, S.M. Floating-point discrete wavelet transform-based image compression on FPGA. AEU Int. J. Electron. Commun. 2020, 124, 153363–153373. [Google Scholar] [CrossRef]
- Messaoudi, A.; Srairi, K. Colour image compression algorithm based on the dct transform using difference lookup table. Electron. Lett. 2016, 52, 1685–1686. [Google Scholar] [CrossRef]
- Ge, B.; Bouguila, N.; Fan, W. Single-target visual tracking using color compression and spatially weighted generalized Gaussian mixture models. Pattern Anal. Appl. 2022, 25, 285–304. [Google Scholar] [CrossRef]
- Delp, E.; Mitchell, O. Image Compression Using Block Truncation Coding. IEEE Trans. Commun. 1979, 27, 1335–1342. [Google Scholar] [CrossRef]
- Lema, M.; Mitchell, O. Absolute Moment Block Truncation Coding and Its Application to Color Images. IEEE Trans. Commun. 1984, 32, 1148–1157. [Google Scholar] [CrossRef]
- Mathews, J.; Nair, M.S.; Jo, L. Modified BTC algorithm for gray scale images using max-min quantizer. In Proceedings of the 2013 International Mutli-Conference on Automation, Computing, Communication, Control and Compressed Sensing (iMac4s), Kottayam, India, 22–23 March 2013; pp. 377–382. [Google Scholar]
- Mathews, J.; Nair, M.S.; Jo, L. Improved BTC Algorithm for Gray Scale Images Using K-Means Quad Clustering. In Proceedings of the 19th International Conference on Neural Information Processing, ICONIP 2012, Part IV, LNCS 7666, Doha, Qatar, 12–15 November 2012; pp. 9–17. [Google Scholar]
- Mathews, J.; Nair, M.S. Adaptive block truncation coding technique using edge-based quantization approach. Comput. Electr. Eng. 2015, 43, 169–179. [Google Scholar] [CrossRef]
- Ammah, P.N.T.; Owusu, E. Robust medical image compression based on wavelet transform and vector quantization. Inform. Med. Unlocked 2019, 15, 100183. [Google Scholar] [CrossRef]
- Kumar, R.; Patbhaje, U.; Kumar, A. An efficient technique for image compression and quality retrieval using matrix completion. J. King Saud. Univ.-Comput. Inf. Sci. 2022, 34, 1231–1239. [Google Scholar] [CrossRef]
- Wei, Z.; Lijuan, S.; Jian, G.; Linfeng, L. Image compression scheme based on PCA for wireless multimedia sensor networks. J. China Univ. Posts Telecommun. 2016, 23, 22–30. [Google Scholar] [CrossRef]
- Almurib, H.A.F.; Kumar, T.N.; Lombardi, F. Approximate DCT Image Compression Using Inexact Computing. IEEE Trans. Comput. 2018, 67, 149–159. [Google Scholar] [CrossRef]
- Ranjan, R.; Kumar, P. An Efficient Compression of Gray Scale Images Using Wavelet Transform. Wirel. Pers. Commun. 2022, 126, 3195–3210. [Google Scholar] [CrossRef]
- Cheremkhin, P.A.; Kurbatova, E.A. Wavelet compression of off-axis digital holograms using real/imaginary and amplitude/phase parts. Nat. Res. Sci. Rep. 2019, 9, 7561. [Google Scholar] [CrossRef] [PubMed]
- Ranjan, R. Canonical Huffman Coding Based Image Compression using Wavelet. Wirel. Pers. Commun. 2021, 117, 2193–2206. [Google Scholar] [CrossRef]
- Renkjumnong, W. SVD and PCA in Image Processing. Master’s Thesis, Department of Arts & Science, Georgia State University, Alanta, GA, USA, 2007. [Google Scholar]
- Ranjan, R.; Kumar, P. Absolute Moment Block Truncation Coding and Singular Value Decomposition-Based Image Compression Scheme Using Wavelet. In Communication and Intelligent Systems; Lecture Notes in Networks and Systems; Sharma, H., Shrivastava, V., Kumari Bharti, K., Wang, L., Eds.; Springer: Singapore, 2022; Volume 461, pp. 919–931. [Google Scholar]
- Ranjan, R.; Kumar, P.; Naik, K.; Singh, V.K. The HAAR-the JPEG based image compression technique using singular values decomposition. In Proceedings of the 2022 2nd International Conference on Emerging Frontiers in Electrical and Electronic Technologies (ICEFEET), Patna, India, 24–25 June 2022; pp. 1–6. [Google Scholar]
- Boujelbene, R.; Boubchir, L.; Jemaa, Y.B. Enhanced embedded zerotree wavelet algorithm for lossy image coding. IET Image Process. 2019, 13, 1364–1374. [Google Scholar] [CrossRef]
- Ahmed, S.M.; Al-Zoubi, Q.; Abo-Zahhad, M. A hybrid ECG compression algorithm based on singular value decomposition and discrete wavelet transform. J. Med. Eng. Technol. 2007, 31, 54–61. [Google Scholar] [CrossRef] [PubMed]
- Boucetta, A.; Melkemi, K.E. DWT Based-Approach for Color Image Compression Using Genetic Algorithm. In Proceedings of the International Conference on Image and Signal Processing—ICISP 2012, Agadir, Morocco, 28–30 June 2012; Elmoataz, A., Mammass, D., Lezoray, O., Nouboud, F., Aboutajdine, D., Eds.; Springer: Berlin, Germany, 2012; pp. 476–484. [Google Scholar]
- Pandey, A.K.; Chaudhary, J.; Sharma, A.; Patel, H.C.; Sharma, P.D.; Baghel, V.; Kumar, R. Optimum Value of Scale and threshold for Compression of 99m To-MDP bone scan image using Haar Wavelet Transform. Indian J. Nucl. Med. 2022, 37, 154–161. [Google Scholar] [CrossRef]
- Eleiwy, J.A. Characterizing wavelet coefficients with decomposition for medical images. J. Intell. Syst. Internet Things 2021, 2, 26–32. [Google Scholar] [CrossRef]
- Alosta, M.; Souri, A. Design of Effective Lossless Data Compression Technique for Multiple Genomic DNA Sequences. Fusion Pract. Appl. 2021, 6, 17–25. [Google Scholar] [CrossRef]
- Skodras, A.; Christopoulos, C.; Ebrahimi, T. The JPEG2000 still image compression standard. IEEE Signal Process. Mag. 2001, 18, 36–58. [Google Scholar] [CrossRef]
- Said, A.; Pearlman, W.A. A new, fast, and efficient image codec based on set partitioning in hierarchical trees. IEEE Trans. Circuits Syst. Video Technol. 1996, 6, 243–250. [Google Scholar] [CrossRef]
- Singh, S.; Kumar, V. DWT–DCT hybrid scheme for medical image compression. J. Med. Eng. Technol. 2007, 31, 109–122. [Google Scholar] [CrossRef] [PubMed]
- Wallace, G.K. The JPEG still picture compression standard. IEEE Trans. Consum. Electron. 1992, 38, xviii–xxxiv. [Google Scholar] [CrossRef]
- Nian, Y.; Xu, K.; Wan, J.; Wang, L.; He, M. Block-based KLT compression for multispectral Images. Int. J. Wavelets Multiresol. Inf. Process. 2016, 14, 1650029. [Google Scholar] [CrossRef]
- Andrushia, A.D.; Thangarjan, R. Saliency-Based Image Compression Using Walsh–Hadamard Transform (WHT). In Biologically Rationalized Computing Techniques for Image Processing Applications; Lecture Notes in Computational Vision and, Biomechanics; Hemanth, J., Balas, V., Eds.; Springer: Cham, Switzerland, 2017; Volume 25, pp. 21–42. [Google Scholar]
- Shaik, A.; Thanikaiselvan, V. Comparative analysis of integer wavelet transforms in reversible data hiding using threshold based histogram modification. J. King Saud. Univ.-Comput. Inf. Sci. 2021, 33, 878–889. [Google Scholar] [CrossRef]
- Liu, T.; Wu, Y. Multimedia Image Compression Method Based on Biorthogonal Wavelet and Edge Intelligent Analysis. IEEE Access 2020, 8, 67354–67365. [Google Scholar] [CrossRef]
- Nashat, A.A.; Hassan, N.M.H. Image compression based upon Wavelet Transform and a statistical threshold. In Proceedings of the 2016 International Conference on Optoelectronics and Image Processing (ICOIP), Warsaw, Poland, 10–12 June 2016; pp. 20–24. [Google Scholar]
- Grabowski, S.; Köppl, D. Space-efficient Huffman codes revisited. Inf. Process. Lett. 2023, 179, 106274. [Google Scholar] [CrossRef]
- Khaitu, S.R.; Panday, S.P. Canonical Huffman Coding for Image Compression. In Proceedings of the 2018 IEEE 3rd International Conference on Computing, Communication and Security (ICCCS), Kathmandu, Nepal, 25–27 October 2018; pp. 184–190. [Google Scholar]
- Tang, H.; Zhu, H.; Tao, H.; Xie, C. An Improved Algorithm for Low-Light Image Enhancement Based on RetinexNet. Appl. Sci. 2022, 12, 7268. [Google Scholar] [CrossRef]
- Baviskar, A.; Ashtekar, S.; Chintawar, A. Performance evaluation of high quality image compression techniques. In Proceedings of the 2014 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Delhi, India, 24–27 September 2014; pp. 1986–1990. [Google Scholar]
- Jeny, A.A.; Islam, M.B.; Junayed, M.S.; Das, D. Improving Image Compression with Adjacent Attention and Refinement Block. IEEE Access 2023, 11, 17613–17625. [Google Scholar] [CrossRef]
- Rani, M.L.P.; Rao, G.S.; Rao, B.P. Performance Analysis of Compression Techniques Using LM Algorithm and SVD for Medical Images. In Proceedings of the 2019 6th International Conference on Signal Processing and Integrated Networks (SPIN), Noida, India, 7–8 March 2019; pp. 654–659. [Google Scholar]
Tested Image | Method | Block Size (4 × 4) Pixels | Block Size (8 × 8) Pixels | ||||||
---|---|---|---|---|---|---|---|---|---|
PSNR | SSIM | BPP | CR | PSNR | SSIM | BPP | CR | ||
Lena (512 × 512) | BTC | 21.4520 | 0.7088 | 2 | 4 | 21.4520 | 0.7088 | 1.2500 | 6.4000 |
AMBTC | 35.3706 | 0.9905 | 2 | 4 | 32.0885 | 0.9639 | 1.2500 | 6.4000 | |
MBTC | 35.8137 | 0.9904 | 2 | 4 | 32.6268 | 0.9662 | 1.2500 | 6.4000 | |
IBTC-KQ | 40.3478 | 0.9874 | 4 | 2 | 36.4511 | 0.9664 | 2.5000 | 3.2000 | |
ABTC-EQ | 36.9919 | 0.9632 | 2.5734 | 3.1087 | 33.8401 | 0.9305 | 1.8267 | 4.3794 | |
DWT | 29.9001 | 0.8943 | 3.2855 | 2.4349 | 29.9001 | 0.8943 | 3.2855 | 2.4349 | |
Proposed | 34.7809 | 0.9985 | 1.8158 | 4.4058 | 34.7809 | 0.9985 | 1.8158 | 4.4058 | |
Lena (256 × 256) | DWT | 27.0772 | 0.8326 | 3.2713 | 2.4455 | 27.0772 | 0.8326 | 3.2713 | 2.4455 |
Proposed | 36.9556 | 0.9447 | 1.7831 | 4.4865 | 36.9556 | 0.9447 | 1.7831 | 4.4865 | |
Barbara (512 × 512) | BTC | 19.4506 | 0.6894 | 2 | 4 | 19.4506 | 0.6894 | 1.2500 | 6.4000 |
AMBTC | 29.8672 | 0.9747 | 2 | 4 | 27.8428 | 0.9429 | 1.2500 | 6.4000 | |
MBTC | 30.0710 | 0.9757 | 2 | 4 | 28.1069 | 0.9451 | 1.2500 | 6.4000 | |
IBTC-KQ | 36.3729 | 0.9847 | 4 | 2 | 33.5212 | 0.9632 | 2.5000 | 3.2000 | |
ABTC-EQ | 32.1986 | 0.9551 | 2.6966 | 2.9667 | 30.5587 | 0.9244 | 1.9487 | 4.1053 | |
DWT | 27.7496 | 0.9242 | 3.7896 | 2.1111 | 27.7496 | 0.9242 | 3.7896 | 2.1111 | |
Proposed | 33.3092 | 0.9986 | 1.9806 | 4.0392 | 33.3092 | 0.9986 | 1.9806 | 4.0392 | |
Baboon (512 × 512) | BTC | 20.1671 | 0.7288 | 2 | 4 | 20.1671 | 0.7288 | 1.2500 | 6.4000 |
AMBTC | 26.9827 | 0.9639 | 2 | 4 | 25.1842 | 0.9181 | 1.2500 | 6.4000 | |
MBTC | 27.2264 | 0.9653 | 2 | 4 | 25.4677 | 0.9216 | 1.2500 | 6.4000 | |
IBTC-KQ | 33.8605 | 0.9777 | 4 | 2 | 31.2925 | 0.9550 | 2.5000 | 3.2 | |
ABTC-EQ | 30.6787 | 0.9400 | 3.0363 | 2.6348 | 28.7947 | 0.9089 | 2.1571 | 3.7086 | |
DWT | 25.9806 | 0.9479 | 4.2012 | 1.9042 | 25.9806 | 0.9479 | 4.2012 | 1.9042 | |
Proposed | 28.0266 | 0.9984 | 2.0917 | 3.8247 | 28.0266 | 0.9984 | 2.0917 | 3.8247 | |
Goldhill (512 × 512) | BTC | 18.0719 | 0.6252 | 2 | 4 | 18.0719 | 0.6252 | 1.2500 | 6.4000 |
AMBTC | 32.8608 | 0.9825 | 2 | 4 | 29.9257 | 0.9438 | 1.2500 | 6.4000 | |
MBTC | 32.2422 | 0.9828 | 2 | 4 | 30.3195 | 0.9472 | 1.2500 | 6.4000 | |
IBTC-KQ | 39.9867 | 0.9840 | 4 | 2 | 36.1776 | 0.9599 | 2.5000 | 3.2000 | |
ABTC-EQ | 36.3085 | 0.9536 | 2.7986 | 2.8586 | 33.6061 | 0.9210 | 2.0778 | 3.8502 | |
DWT | 28.8597 | 0.9255 | 3.6259 | 2.2064 | 28.8597 | 0.9255 | 3.6259 | 2.2064 | |
Proposed | 33.6289 | 0.9986 | 1.9020 | 4.2061 | 33.6289 | 0.9986 | 1.9020 | 4.2061 | |
Peppers (256 × 256) | BTC | 19.4540 | 0.6306 | 2 | 4 | 19.4540 | 0.6306 | 1.2500 | 6.4000 |
AMBTC | 30.5655 | 0.9409 | 2 | 4 | 26.7127 | 0.8547 | 1.2500 | 6.4000 | |
MBTC | 31.1372 | 0.9444 | 2 | 4 | 27.4445 | 0.8596 | 1.2500 | 6.4000 | |
IBTC-KQ | ----------- | --------- | -------- | --------- | ----------- | --------- | -------- | --------- | |
ABTC-EQ | 32.0306 | 0.9551 | 2.6966 | 2.9667 | 28.9805 | 0.8985 | 2.6966 | 4.0499 | |
DWT | 27.3524 | 0.8212 | 3.1735 | 2.5209 | 27.3524 | 0.8212 | 3.1735 | 2.5209 | |
Proposed | 37.1723 | 0.9431 | 1.7422 | 4.5918 | 37.1723 | 0.9431 | 1.7422 | 4.5918 | |
Cameraman (256 × 256) | BTC | 20.7083 | 0.7214 | 2 | 4 | 20.7083 | 0.7214 | 1.2500 | 6.4000 |
AMBTC | 28.2699 | 0.9322 | 2 | 4 | 25.8654 | 0.8831 | 1.2500 | 6.4000 | |
MBTC | 29.0746 | 0.9392 | 2 | 4 | 26.9365 | 0.8934 | 1.2500 | 6.4000 | |
IBTC-KQ | 36.7714 | 0.9890 | 4 | 2 | 33.6339 | 0.9754 | 2.5000 | 3.2 | |
ABTC-EQ | 33.9790 | 0.9725 | 2.6418 | 3.0282 | 31.2452 | 0.9531 | 1.8325 | 4.3656 | |
DWT | 26.4333 | 0.7483 | 2.7925 | 2.8648 | 26.4333 | 0.7483 | 2.7925 | 2.8648 | |
Proposed | 33.4238 | 0.8578 | 1.5536 | 5.1492 | 33.4238 | 0.8578 | 1.5536 | 5.1492 | |
Boat (256 × 256) | DWT | 29.6486 | 0.8758 | 3.4099 | 2.3461 | 29.6486 | 0.8758 | 3.4099 | 2.3461 |
Proposed | 37.9922 | 0.9575 | 1.7985 | 4.4482 | 37.9922 | 0.9575 | 1.7985 | 4.4482 |
Image | Proposed Method | DCT-DLUT | ||
---|---|---|---|---|
PSNR | BPP | PSNR | BPP | |
Airplane (512 × 512) | 47.57 | 0.27 | 31.16 | 0.48 |
Peppers (512 × 512) | 47.99 | 0.32 | 31.19 | 0.88 |
Lena (512 × 512) | 48.95 | 0.37 | 32.65 | 0.74 |
Couple (256 × 256) | 54.60 | 0.69 | 32.62 | 0.79 |
House (256 × 256) | 53.47 | 0.70 | 23.27 | 0.79 |
Zelda (256 × 256) | 53.74 | 0.71 | 32.01 | 0.82 |
Average | 59.71 | 0.51 | 35.81 | 0.75 |
Image | Proposed method | NE-EZW | ||
---|---|---|---|---|
PSNR | BPP | PSNR | BPP | |
Lena (512 × 512) | 48.95 | 0.37 | 36.30 | 0.50 |
Peppers (512 × 512) | 47.99 | 0.32 | 28.79 | 0.50 |
Mandrill (512 × 512) | 43.94 | 0.41 | 34.20 | 0.50 |
House (512 × 512) | 46.80 | 0.31 | 35.03 | 0.50 |
Average | 46.92 | 0.35 | 33.58 | 0.50 |
Image (256 × 256) | Running Time (s) | Running Time (s) |
---|---|---|
Proposed | DWT [16] | |
Boat | 92.3117 | 168.8943 |
Cameraman | 87.1738 | 109.7213 |
Goldhill | 110.1841 | 134.7754 |
Lena | 96.6797 | 147.5008 |
Average | 96.587325 | 140.22295 |
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. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ranjan, R.; Kumar, P. An Improved Image Compression Algorithm Using 2D DWT and PCA with Canonical Huffman Encoding. Entropy 2023, 25, 1382. https://doi.org/10.3390/e25101382
Ranjan R, Kumar P. An Improved Image Compression Algorithm Using 2D DWT and PCA with Canonical Huffman Encoding. Entropy. 2023; 25(10):1382. https://doi.org/10.3390/e25101382
Chicago/Turabian StyleRanjan, Rajiv, and Prabhat Kumar. 2023. "An Improved Image Compression Algorithm Using 2D DWT and PCA with Canonical Huffman Encoding" Entropy 25, no. 10: 1382. https://doi.org/10.3390/e25101382
APA StyleRanjan, R., & Kumar, P. (2023). An Improved Image Compression Algorithm Using 2D DWT and PCA with Canonical Huffman Encoding. Entropy, 25(10), 1382. https://doi.org/10.3390/e25101382