Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

rle

Dear forum members.
Who knows how to do compression and decompression by algorithm RLE "Run-length encoding"?
I have one hexacode string data, inside got compression by RLE and now i will do decompression, but i dont know how.
Could you help me to solve this problem?
 
Thanks in advance
With warm regards
Harutyun Melikyan!
 
0 Kudos
Message 1 of 2
(2,970 Views)
Hi, Melikyan,
 
Probably this will be helpful as starting point:
 
"...Run-length encoding (RLE) is a very simple form of data compression in which runs of data (that is, sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run. This is most useful on data that contains many such runs: for example, relatively simple graphic images such as icons, line drawings, and animations.

For example, consider a screen containing plain black text on a solid white background. There will be many long runs of white pixels in the blank space, and many short runs of black pixels within the text. Let us take a hypothetical single scan line, with B representing a black pixel and W representing white:

WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW

If we apply the run-length encoding (RLE) data compression algorithm to the above hypothetical scan line, we get the following:

12W1B12W3B24W1B14W

Interpret this as twelve W's, one B, twelve W's, three B's, etc..."

best regards,

Andrey.

 

0 Kudos
Message 2 of 2
(2,961 Views)