error in spiht algorithm

hello sir!! i am getting an error at a line for uncompression in spiht algorithm.

4 个评论

Tanvi - please describe the algorithm that you are using. Is this something from the File Exchange (and if so, provide a link to it). Also, please copy and paste the entire error message that you are observing, including the line (or lines) of code that you are executing that generates the error.
clc;
clear all;
i1=imread('t1.jpg');
i2=rgb2gray(i1);
option='c';
[cr,bpp]=wcompress(option,i2,'i2.wtc','spiht','maxloop',12);
option='u';
Xc=wcompress(option,'i2.wtc');
delete('i2.wtc');
figure(1)
imshow(i2)
imageview(Xc)
error:- ??? 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 ==> cmp3 at 8
Xc=wcompress(option,'i2.wtc');
You can add i1=imresize( i1, [256 256]), then run the code. I hope it will successfully run now. 'spiht' runs on square matrix. may be for that reason you are getting the error.
In this case the number of rows and columns of image must be a power of two, though, the post is quite old.

请先登录,再进行评论。

回答(0 个)

类别

提问:

2014-11-19

Community Treasure Hunt

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

Start Hunting!

Translated by