error in arithenco and arithdeco

original=imread('Lena.bmp'); % Read an image Lena 512*512 to original variable
seq=mortonx(original); % convert the matrix original into a vector by morton scan order which is a fucntion i made up by myself
ta=tabulate(seq); % create a three column with the internal function ... first column is the symbol... second is the times it occured ... third is the propability
count=ta(:,2); %copy the count column into count variable from ta variable
code=arithenco(seq,count); %appply the arithmetic coding ...
new=arithdeco(code,count,262144); %apply the arithmetic decoding to restore the original image ...
isequal(seq,new); % to see if seq and new are equal ....
% ??? Error using ==> arithenco at 36
% The symbol sequence parameter must be a vector of positive finite integers.

댓글 수: 1

vishnu
vishnu 2012년 2월 29일
can you send the or post the function which converts the image into vector by morton scanning

댓글을 달려면 로그인하십시오.

답변 (2개)

Wayne King
Wayne King 2011년 10월 26일

0 개 추천

arithenco() expects an input like [1 2 3 4].
what is seq?

댓글 수: 1

Wayne King
Wayne King 2011년 10월 26일
I mean you told us seq comes from your function mortonx, but is it a vector of positive integers?

댓글을 달려면 로그인하십시오.

Diyar Aldusky
Diyar Aldusky 2011년 10월 27일

0 개 추천

mortonx function is a function that just convert the matrix to a vector according to morton scan order .... it dont change the values of the matrix .... it just convert from matrix to vector ... to be from 512*512 to 1*262144 diementions ... and the values mean the same ...you can just type seq=reshape(original,1*262144) ... but after that i get the same error as i get from the begining ...

댓글 수: 1

Wayne King
Wayne King 2011년 10월 27일
Diyar, it's not important just that it is a vector, what are the values in original, are they all positive integers as I asked you in my first answer.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Denoising and Compression에 대해 자세히 알아보기

질문:

2011년 10월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by