take everything before the first chain-coded
coordinate (here a "6") and transform it into a data.frame, later used
as a fac
convert all the chain-coded coordinates into (x; y) coordinates
using chc2pix
(and removes) the "-1" that mark the end of coordinates
returns an Out object with the corresponding fac
and with outlines named after the first fac column
(here with Name_1, Name_2, etc.)
This function needs to know how many information (space-separated there is
before) the first coordinate. On the example above, would be 4 id [...] was empty.
References
Kuhl, F. P., & Giardina, C. R. (1982).
Elliptic Fourier features of a closed contour.
Computer Graphics and Image Processing, 18(3), 236-258.