I need to plot the relative error vs compression ratio diagram of a discrete wavelet transform on an image, but no luck so far .. Here's the problem in short:
- random_image.jpg
- compress the image
- plot the relative error vs compression ratio diagram
Here's the code and below is the link I am using as a reference:
cumulativeEnergy[data_] :=
Module[{c = Sort[Flatten[data]^2, Greater]}, Accumulate[c]/Total[c]]
data = (* insert random image*)
wtdata = DiscreteWaveletTransform[data]
wtE = cumulativeEnergy[Last /@ wtdata[Automatic]];
ListLinePlot[Sqrt[1 - wtE]]
The problem is I don't get a curve like in the example..
Thank you !