Recursive Compression

In order to achieve even higher compression ratios, a recursive compression algorithm was developed using Haar Wavelets. This function works by performing the wavelet transform on the original image and then recursively calling itself to compress the down-sampled (low-low) version of the image again. It will continue to do this a set number of times with different limit values for each function call. The image can then be recovered by first reconstructing the low-low version of the image, and then using this reconstructed version to reconstruct the next level of the image. This method allows for much more freedom with determining the correct limit and recursive call counts to achieve the highest compression ratios at the lowest levels of loss.

4Times_Marble_recur5Times_Marble_recur6Times_Marble_recur_better7Times_Marble_recur

Conclusion

The implementation of the Haar Wavelet transform allows for very high compression ratios with minimal information loss. This is done by performing the wavelet transform on an original image, and then storing any values below a set limit as single ‘0’ bits instead of full 8 bit integers. The images can then be reconstructed using the inverse wavelet transform and compared to the original. This can also be done recursively, resulting in much higher achievable compression ratios. Compression and image quality are of course inversely related, but these methods provide up to 7X compression with over 90% similarity for the images that were analyzed.

 

Recursive Compression Matlab Code

(Run Haar_RecurCompressScript with all the other files in the same folder)

Haar_RecurCompressScript

Haar_Deconstruct

Haar_Reconstruct

Haar_RecurCompress

Haar_RecurReconstruct

imgcompare