
Shapes and Boundaries 361
FIGURE 12.6: A simple L-shape
The normalized version of these differences is the shape number for this L shape and can
be found to be
0 1 0 1 1 3 1 1.
The chain code for the rotated L can be found to be
3 2 3 0 0 1 1 2.
Even when normalized the result is not the same as the chain code for this shape in its
original orientation. But if the differences are obtained:
3 2 3 0 0 1 1 2
− 2 3 2 3 0 0 1 1
1 3 1 1 0 1 0 1
then the normalized third row is
0 1 0 1 1 3 1 1.
which is exactly the same code obtained above.
This can be done easily in MATLAB or Octave: given a chain code
c, simply normalize
the difference with a cyclic shift:
MATLAB/Octav ...