error in spiht algorithm

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

4 件のコメント

Geoff Hayes
Geoff Hayes 2014 年 11 月 19 日
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.
Tanvi
Tanvi 2014 年 11 月 20 日
編集済み: Geoff Hayes 2014 年 11 月 20 日
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');
NANDITA SHARMA
NANDITA SHARMA 2020 年 11 月 20 日
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.
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 11 月 20 日
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 日

コメント済み:

2020 年 11 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by