In [CITE], Kronrod proves that the connected components of isolevel
sets of a continuous function can be endowed with a tree
structure. Obviously, the connected components of upper level sets are an
inclusion tree, and the same is true for connected components of lower level
sets. We prove that in the case of semicontinuous functions, those trees can
be merged into a single one, which, following its use in image processing, we
call “tree of shapes”. This permits us to solve a classical representation
problem in mathematical morphology: to represent an image in such a way that
maxima and minima can be computationally dealt with simultaneously. We prove
the finiteness of the tree when the image is the result of applying any
extrema killer (a classical denoising filter in image processing). The shape
tree also yields an easy mathematical definition of adaptive image
quantization.