Function File: fcc = fchcode (bound)

Determine the Freeman chain code for a boundary.

fchcode computes the Freeman chain code for the n-connected boundary bound. n must be either 8 or 4.

bound is a K-by-2 matrix containing the row/column coordinates of points on the boundary. Optionally, the first point can be repeated as the last point, resulting in a (K+1)-by-2 matrix.

fcc is a structure containing the following elements.

 x0y0   = Row/column coordinates where the code starts (1-by-2) 
 fcc    = Freeman chain code (1-by-K)
 diff   = First difference of fcc (1-by-K)

The code uses the following directions.

 3 2 1
 4 . 0
 5 6 7

See also: bwboundaries.

Package: image