Use binary sequences to code the pixels:
000000 = white
000111 = gray
111111 = black
Thus:
Image can be represented by a sequence of 0's and 1's.
What happens if noise corrupts the binary sequence?
sent: 1100/0000/1000/etc
received: 1100/1000/0000
Possibilities:
corrupted string is not a code word! (unclear how to reconstruct image)
corrupted string is a code word! (reconstructed image is not correct)
If code words are "far apart" and there are not too many errors then the errors can be corrected!
Hamming realized that binary sequences were far apart when they differed in many places!
Examples:
111100 Hamming
010010 Distance = 4
000100 Hamming
110110 Distance = 3
(useful idea in genome work!)
If circles of radius r do not overlap then one can correct up to r errors!
If the minimum Hamming distance between any two code words is 2r+1 then the code will correct up to r errors (per code word).
Code words are sequences of binary digits:
Block code:
All code words have the same length:
Variable length code:
1 0 11 110 1 01
Block code:
All code words have the same length:
Variable length code:
1 0 11 110 1 01