Discrete Wavelets with Applications

073d - Quantization Using the Daubechies-6 Filter

Helmut  Knaust - Department of Mathematical Sciences, University of Texas at El Paso, hknaust@utep.edu
10/25/2010. Last edit: 4/5/2022

SetDirectory[NotebookDirectory[]];<<DW.m;<<DW1.m
SetDirectory["Images\\Grayscale"];

pic=Import["surfer.png","Data"];

ImagePlot[pic]
ShannonEntropy[pic]

We are applying the D6 transform five times :

p3=D6WLT[pic,5];
TransformPlot[p3,5]
ShannonEntropy[p3]

p3q=Quantize[p3,0.995];
ShannonEntropy[p3q]

We now apply the inverse transform five times to see the resulting image. 
	Note: The next command is NOT contained in the package 'DW.m'.

?InvD6WLT

picq=Round[InvD6WLT[p3q,5]];
ImagePlot[picq,Scaled->True]

PSNR[pic,picq]

Here is a plot of the difference between the original image and its quantized version (negative) :

ImagePlot[255-Abs[pic-picq],Scaled->False]