The following is an 8-bit blind embedding technique using Trellis codes for image watermarking. The Viterbi algorithm is used to extract the 8 bits of the message.

## Embedding

This method is based on System 5 presented in [ 1 ]. It is a similar based method to E-Simple-8, in the sense that 8 different marks are embedded in order to hide 8 bits. However, in this case Trellis codes are used to encode the bits, which allows for a much more reliable decoding.

It is a **robust** method, i.e. able to withstand some image alterations.

The code for the embedding method is available at the following link: E_TRELLIS_8.

To embed a mark, just run a command like the following:

```
$ python3 E_TRELLIS_8.py image.png passw123 10101010 marked.png
```

## Detection

Mark detection and decoding is performed by calculating the
**linear correlation** between the marked image and each of the eight marks.

The formula used for the linear correlation is as follows:

$Z_{lc} = \frac{1}{N} \bar{c} ยท \bar{w_r} = \frac{1}{N}\sum_{xy}c(x,y) w_r(x,y)$

The Viterbi. Viterbi algorithm is used for message decoding.

The code of the detection method is available at the following link: D_TRELLIS_8.

To detect the mark and see if a 0 or a 1 has been embedded, just run a command like the following:

```
$ python3 D_TRELLIS_8.py marked.png passw123
msg: 10101010
```

## References

- I. J. Cox, M. L. Miller, J. A. Bloom, J. Fridrich y T. Kalker (2008). Digital Watermarking and Steganography. Morgan Kaufmann. Second Edition.