Discrete Wavelets with Applications

064a - Haar Quantization

Helmut  Knaust - Department of Mathematical Sciences, University of Texas at El Paso, hknaust@utep.edu
10/18/2010; last edits: 03/21/2024

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

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

ImagePlot[pic]
ShannonEntropy[pic]
CEnergy[pic]

We are applying the Haar transform three times :

p3=HaarWLT[pic,3];
TransformPlot[p3,3]
ShannonEntropy[p3]
CEnergy[p3]

?Quantize

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

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

?InvHaarWLT

picq=Round[InvHaarWLT[p3q,3]];
ImagePlot[picq,Scaled->True]

PSNR[pic,picq]

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