In grayscale morphology, images are functions mapping a Euclidean space or grid E into \mathbb{R}\cup\{\infty,-\infty\}, where \mathbb{R} is the set of reals, \infty is an element greater than any real number, and -\infty is an element less than any real number.
Grayscale structuring elements are also functions of the same format, called "structuring functions".