Coding for run length encoding....
조회 수: 5 (최근 30일)
이전 댓글 표시
I am currently doing the image compression by using run length method. So far I had done the part of encoding. However, I am now facing the problem of doing the part of decoding. Is there any way that can be done to do for decoding the compressed image? Below is my encoding coding for run length compression.
function Output=rle2(y)
x=imread('nc_linggi.tif');
y=x(:,:,2);
L=length(y);
j=1;
k=1;
i=1;
while i<2*L
comp=1;
for j=j:L
if j==L
break
end;
if y(j)==y(j+1)
comp=comp+1;
else
break
end;
end;
Output(k+1)=comp;
Output(k)=y(j);
if j==L && y(j-1)==y(j)
break
end;
i=i+1;
k=k+2;
j=j+1;
if j==L
if mod(L,2)==0
Output(k+1)=1;
Output(k)=y(j);
else
Output(k+1)=1;
Output(k)=y(j);
end;
break
end;
end;
Thanks.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!