×
☰ Menu

Shape Representation

What is Shape? 

The shape of the object is a binary image representing the extent of the object. The shape can be thought of as an object's outline. There are many imaging applications where image analysis can be reduced to the analysis of shapes.

 

Run Length Encoding

Instead of coding each black and white pixel in a binary image individually, we can code groups of black and white pixels. The sequence of 111110000000111100000 thus, becomes 5 ones, 7 zeros, 4 ones, and 5 zeros. This is called run-length encoding or RLE.

Example 1:

Suppose the string is AAAAAAA then Run-length encoding is A7

A is a character and 7 is the number of times appears that string.

Example 2:

If the input string is “WWWWAAADEXXXXXX”, then the Run-length encoding is W4A3D1E1X6.

W is a character and 4 is the number of times appears that string, A is 3 times, D is one time E is one time and X is 6 times appearing in a string.

Example 3:

If the input string is “AAAABDDDDEAHHHHH” then the Run-length encoding is A4B1D4E1A1H5

An RLE image is thus encoded as a sequence of pairs. Typically, there is a fixed size for the count value, such as one byte. In this case, a rum of 500 ones would be (256, 1), (244, 1).