Haskell library decoding chain codes from images