This program takes any image, converts it to binray, and performs RLE on the binary image
%
%Progam to calculate RUN LENGTH ENCODING
%the prog takes any image, converts it to binray, and performs RLE on the binary image
function[rle]=rlemain(f)
I=imread(f);
imshow(I);title('original image');
level=graythresh(I);
bw=im2bw(I,level);
figure;imshow(bw);title('binary image');
a=bw'; a=a(:); a=a';
a=double(a);
rle(1)=a(1); m=2; rle(m)=1;
for i=1:length(a)-1
if a(i)==a(i+1)
rle(m)=rle(m)+1;
else
m=m+1; rle(m)=1; %dynamic allocation and initialization of next element of rle
end
end
display(rle);
%to run the prog type rlemain('imagefilename.ext') at the command window
%the program will return RUN LENGTH ENCODED (row)martix
image compression using run length ecoding
-
by farsun 11:18 PM
-
Tags:
About The Author
Ut dignissim aliquet nibh tristique hendrerit. Donec ullamcorper nulla quis metus vulputate id placerat augue eleifend. Aenean venenatis consectetur orci, sit amet ultricies magna sagittis vel. Nulla non diam nisi, ut ultrices massa. Pellentesque sed nisl metus. Praesent a mi vel ante molestie venenatis.
Related Posts
Connect With Us
Recommend us on Google!
hey,
ReplyDeletei want the source code for compression of text data using shannon-fano coding in matlab...
plz HELP ME....!!!
Do you have any idea how to do Segmentation of an image by region growing? Thanks!
ReplyDeletehi, can you help me? i'm looking for source code for image compression using huffman algorithm. thanks
ReplyDeleteI wanted a matlab code for image compression using huffman, rle,and lzw and comparing them on the basis of compression ratio.....CAn u please help me out. I will be very greatful to you......My project is completely dependent on it. Thank you
ReplyDeletei don know.....btn when is ur project..?/ll try to help u ....asap...
Deletewhat will be output of the above code????pls reply as soon as possible.....
ReplyDeletepls mail the o/p to dis id : arshfar@gmail.com
ReplyDeletecan i know is that possible for the RLE do in the color image?
ReplyDeleteExcellent tips. Really useful stuff .Never had an idea about this, will look for more of such informative posts from your side.. Good job...Keep it up
ReplyDeleteSoftware Photo Slideshow