A unified theory of translation-invariant systems with applications to morphological analysis and coding of images