Using wcompress in Matlab
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Dinesh Yadav
2020년 1월 24일
0 개 추천
Hi Rhania,
There could be one of multiple reasons for the above error.
- The variable or function definition of "Encoded_wtbx_DEC" is not defined prior to the command where it is used.
- If it is defined in some other file or folder, they must be added to path or appropriately import variables into your current file where you are using it.
- Check for spelling error as names of varaibles/functions are case sensitive.
Hope it helps.
댓글 수: 2
Walter Roberson
2020년 1월 24일
Encoded_wtbx_DEC is an internal variable to wcompress. It is assigned a value by each of the various cases of the switch method_COMP near line 425 of wcompress. However, in the situation where the user-provided compression method is not any of 'gbl_mmc_h','gbl_mmc_f', 'lvl_mmc', 'ezw','spiht','spiht_3d','wdr','aswdr','stw' then no value is assigned to the variable and the error message is generated when the code tries to use the variable.
The code could be better designed to catch invalid compression methods, but the primary trigger is that the user passed in an invalid compression method.
Rhania MacBain
2020년 1월 24일
카테고리
도움말 센터 및 File Exchange에서 Denoising and Compression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!