MATLAB: Using wcompress in Matlab

compressionwavelet compressionwaveletswcompress

I am trying to demonstrate image compression via the haar wavelet transform in Matlab with the following code:
Xc = wcompress('c', J, 'apples.wtc', 'haar')
And I am getting the message:
Undefined function or variable 'Encoded_wtbx_DEC'.
Error in wcompress (line 491)
fileSize = wtcmngr('save',typeSAVE,Sav_filename,method_COMP,Encoded_wtbx_DEC);
Does anyone know why this could be?

Best Answer

'haar' is not one of the valid compression methods for wcompress()
The valid compression methods are divided in three categories.
  • Progressive Coefficients Significance Methods (PCSM): MATLAB NameCompression Method Name
  • 'ezw'Embedded Zerotree Wavelet'
  • 'spiht'Set Partitioning In Hierarchical Trees
  • 'stw'Spatial-orientation Tree Wavelet
  • 'wdr'Wavelet Difference Reduction
  • 'aswdr'Adaptively Scanned Wavelet Difference Reduction
  • 'spiht_3d'Set Partitioning In Hierarchical Trees 3D for truecolor images
For more details on these methods, see the references and especially Walker and also Said and Pearlman.
  • Coefficients Thresholding Methods (CTM-1): MATLAB NameCompression Method Name
  • 'lvl_mmc'Subband thresholding of coefficients and Huffman encoding
For more details on this method, see the Strang and Nguyen reference.
  • Coefficients Thresholding Methods (CTM-2): MATLAB NameCompression Method Name
  • 'gbl_mmc_f'Global thresholding of coefficients and fixed encoding
  • 'gbl_mmc_h'Global thresholding of coefficients and Huffman encoding
Notice the lack of a 'haar' option.
Related Question