How to test compression algorithms on MATLAB Data?

I have a variable A which is 581*581 single and when I use the command imshow(mat2gray(A)) I see a biological cell that I am supposed to. Lets say I am conducting a research where I want to test out how the JPEG algorithm (or some other, for the matter of compression) performs on this data. How do I test this out? When I read research papers, they are able to test various compression algorithms out there on their data. I want to be able to know the achieved compression ratio, time complexity and other details for that matter to compare the performances of different compression algorithms.

4 Comments

This is a vague question. What do you want to measure? What exactly are "other details"? I cannot suggest code for "other details".
Start with defining "performance". Select, which details matter for your research: Run time for compression / decompression, code size, output size, differences between original and after decompression, do block articats matter more than RMS between images?
If the problem is defined, the forum is the right place to ask for problems with the implementation.
JJJ
JJJ on 28 Jul 2022
Edited: JJJ on 28 Jul 2022
Thanks for the comment. I have also noticed that I forgot to mention I am only interested in lossless compression for the time being.
I mainly want to compare the compression ratio (or bpp) and execution time. However, if there are any other popular measure for performance in the case of lossless compression, I would be happy to learn.
Please do let me know if I should provide any further details.
If you are interested in lossless compression, JPEG is not an option. Even with the lossless-flag, the results contain rounding errors. This is the reason, why e.g. for medical decision making JPEGs are not used.
Do not re-invent the wheel. You find a lot of studies in the net for comparing different lossless compressions. See: https://en.wikipedia.org/wiki/Lossless_compression
JJJ
JJJ on 28 Jul 2022
Edited: JJJ on 28 Jul 2022
Thanks. Now I can see that JPEG 2000 and JPEG-LS are truly lossless compression algorithms. (do correct me if I am wrong)
What I had on mind was not to compare the ones already existing on my data, but to compare them to an algorithm that I am, at the moment, trying to come up with.
I actually stated JPEG as an example. I am actually working with 3D data, so a standard compression algorithm would be JP3D (JPEG 2000 Part 10).
The heart of my question just lies in how I find these standard algorithms in their full form, and how I can compare them with my algorithm. But to avoid vaugeness, I will just ask the following: How do I compare my algorithm and JP3D in terms of compression ratio (or bpp) and execution time, and where can I access the full JP3D algorithm?
Edit: I am not only interested in truly lossless, but also "just" lossless algorithms

Sign in to comment.

Answers (0)

Products

Release

R2021b

Asked:

JJJ
on 27 Jul 2022

Edited:

JJJ
on 28 Jul 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!