wcompress

1 次查看(过去 30 天)
warinthorn Kiadti
warinthorn Kiadti 2012-4-26
Hi everybody, can someone please help me with this error, below is my code....
The CR_testImage.tif is unit8 59x64x3
X = imread('CR_testImage.tif');
[CR,BPP] = wcompress('c',X,'w_test.wtc','spiht','maxloop',12);
Xc = wcompress('u','w_test.wtc');
subplot(1,2,1); image(X);
axis square;
title('Original Image')
subplot(1,2,2); image(Xc);
axis square;
title('Compressed Image - 12 steps - bior4.4')
delete('w_test.wtc')
*When I run this code the message show..
??? Subscript indices must either be real positive integers or logicals.
Error in ==> wtc_spiht>wtc_spiht_dec at 524
Signific_MAT(idx_CHILD+d_PIX_Plan) = ...
Error in ==> wtc_spiht at 23
case 2 , [varargout{1:nbout}] = wtc_spiht_dec(varargin{:});
Error in ==> wtcmngr at 98
[varargout{1:nbout}] = funHDL('dec',WTC_Struct,stepFLAG);
Error in ==> wcompress at 452
X_decoded = wtcmngr('read',inputFile,stepFLAG);
Error in ==> Test_wc6 at 11
Xc = wcompress('u','w_test.wtc');
Thank you in advance..
Warin

采纳的回答

Wayne King
Wayne King 2012-4-26
You need to extend the one dimension of your image to the next power of 2 - 64x64x3, you can pad with zeros, see wextend() for help, then the above will work.
For example:
X = randi([0 255],64,64,3,'uint8');
  1 个评论
warinthorn Kiadti
warinthorn Kiadti 2012-4-26
Thank you very much Wayne..
Do I have to extend the dimension of every input image to be power of 2? or Just this case...

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by