MATLAB: Subscripted assignment dimension mismatch

subscripted assignment dimension mismatch

Hi everybody, can someone please help me with this error, below is my code
tic
X = imread('T1.jpg');
[CR,BPP]=wcompress('c',X,'image_c.wtc','aswdr', 'maxloop',11 ,'wname','bior6.8' );
CR
Xc = wcompress('u','image_c.wtc');
time=toc
set(gcf,'Color',[1 1 1])
subplot(1,2,1); image(X);
axis square;
title('Original Image')
subplot(1,2,2); image(Xc);
axis square;
title('Uncompressed Image')
xlabel({['Compression Ratio: ' num2str(CR,'%1.2f %%')], ...
['BPP: ' num2str(BPP,'%3.2f')]})
Image T1.jpg is truecolor image, class is uint8.
When I start the program, display an error
??? Subscripted assignment dimension mismatch.
Error in ==> wtc_aswdr>wtc_aswdr_enc at 118
scan_Plan_INI(:,bp) = scan_IDX+(bp-1)*nb_PIX;
Error in ==> wtc_aswdr at 32
case 1 , [varargout{1:nbout}] = wtc_aswdr_enc(varargin{:});
Error in ==> wtcmngr at 58
varargout{1} = feval(funNAME,'enc',varargin{2:end});
Error in ==> wcompress at 426
Encoded_wtbx_DEC = wtcmngr('enc',method_COMP,X, ...
Error in ==> simulacija at 4
[CR,BPP]=wcompress('c',X,'image_c.wtc','aswdr', 'maxloop',11 ,'wname','bior6.8' );
Thanks in advance!

Best Answer

  • With the error that you are reporting, I suspect your problem is that your input image does not have X and Y dimensions that are power of two in length.
    size(X,1) and size(X,2) must be a power of two.