%gmChap03.tex

\graphicspath{{./figures/chapter03/}}

\chapter[Contrast-Invariant Functions and Their Level Sets]{Contrast-Invariant Functions and Their Level Sets}

We have already argued that for image analysis to be robust, the operators must be contrast invariant. The formal development of these operators begins in this chapter and continues through Chapter 9. The overall theme is to develop a duality between contrast-invariant function operators and monotone set operators. This duality is based on one of the fundamentals of mathematical morphology: A real-valued function is completely described by its level sets. This theory will allow one to process an image in either of two equivalent ways: If the image is represented as a suitable real-valued function $u$, then one can form $Tu$, where $T$ is a contrast-invariant function operator; if the image is represented by a collection of level set, then one can operate on these level sets with the set operator $\mathcal T$ that is paired with $T$. Sometimes $T$ appears as the fundamental operator and in other cases $\mathcal T$ is the fundamental operator. The theory allows us to move from one setting to the other.

\section{From an image to its level sets and back}

We will be working with real-valued functions, and for reasons that will become clear, we wish to extend the range of the functions to include $-\infty$ and $+\infty$. Thus we add these ideal points to $\RR$ and denote this set by $\barR=\RR\cup\{-\infty,+\infty\}$. $\barR$ has the usual topology, so it is homeomorphic to, say, $[-1,1]$.


\begin{definition}
Let $u$ be a function defined on $\RR^N$ with values in $\barR$. The level set of $u$ at level $\lambda$ is denoted by $\levelset_{\lambda}u$ and defined by
\[
\levelset_{\lambda}u=\{\fxx\mid u(\fxx)\geq\lambda\}.
\]
\end{definition}

Technically, what we have defined is an upper level set, which is sometimes denoted by $\levelset_{\lambda}^+u$. For most of our development, level sets are upper level sets, although lower level sets do appear in later chapters.

Several level sets of a digital image are illustrated in Figure \ref{fig31} and all of the level sets of a synthetic image are illustrated in Figure \ref{fig32}. The reconstruction of an image from its level sets is illustrated in Figure \ref{fig33}. Two important properties of the level sets of a function follow directly from the definition. The first is that the level sets provide a complete description of the function. Indeed, we can reconstruct $u$ from its level sets $\levelset_{\lambda}u$ by the formula
\[
u(\fxx)=\sup\{\lambda\mid\fxx\in\levelset_{\lambda}u,\lambda\in\barR\}.
\]

\begin{exercise}
Prove this last formula. \finex
\end{exercise}

The second important property is that level sets of a function are globally invariant under certain contrast changes (see Definition 3.9). We say that two functions $u$ and $v$ have the same level sets globally if for every $\lambda\in\barR$ there is a $\mu\in\barR$ such that $\levelset_{\mu}v=\levelset_{\lambda}u$, and conversely. Now suppose that the contrast change  $g:\barR\to\barR$ is continuous and increasing. Then it is not difficult to show that $v=g(u)$ and $u$ have the same level sets globally, that is, every level set of $u$ is a level set of $v$, and conversely.

\begin{exercise}
Check this last statement for any function $u:\RR^N\to\barR$ and any continuous increasing contrast change $g:\barR\to\barR$. \finex
\end{exercise}

Later we will be interested in more general contrast changes, which will be  neither continuous nor strictly increasing. This general setting is  justified by current technology where contrast changes appear implicitly in many aspects of image science. In this general setting, we will see that the level sets of $g(u)$ are either level sets of $u$ or \textit{strict level sets} of $u$, which are sets of the form $\{\fxx\mid u(\fxx)>\lambda\}$. We will also prove a converse result: If the level sets of a function $v$ are either level sets of $u$ or strict level sets of $u$, then there is a contrast change $g$ such the $v=g(u)$. 

\begin{figure}[!t]
\setkeys{Gin}{width=3.5cm}
\centerline{
\includegraphics{fig03.01.1.eps}
\includegraphics{fig03.01.2.eps}
\includegraphics{fig03.01.3.eps}
}
\centerline{
\includegraphics{fig03.01.4.eps}
\includegraphics{fig03.01.5.eps}
\includegraphics{fig03.01.6.eps}
}
\centerline{
\includegraphics{fig03.01.7.eps}
\includegraphics{fig03.01.8.eps}
\includegraphics{fig03.01.9.eps}
}
\caption[Level sets of a digital image]{\label{fig31} Level sets of a digital image. Left to right, top to bottom: We first show an image with range of gray levels from 0 to 255. Then we show eight level sets in decreasing order from $\lambda=225$ to $\lambda=50$, where the grayscale step is 25. Notice how essential features of the shapes are contained in the boundaries of level sets, the level lines. Each level set (which appears as white) is contained in the next one, as guaranteed by Proposition 3.2.}
\end{figure}

The following proposition describes structural properties of the family of level sets $\levelset_{\lambda}u$ of a function $u$. Conversely, given a family of sets $(X_{\lambda})_{\lambda\in\barR}$ that satisfies the same structural properties, it is possible to construct a function $u$ such that $\levelset_{\lambda}u= X_{\lambda}$, $\lambda\in\barR$. This illustrates one of the main techniques of mathematical morphology \cite{Matheron:1975:RSI}. 

\begin{proposition}\label{prop32}
Let $X_{\lambda}$, $\lambda\in\barR$, denote the level sets $\levelset_{\lambda}u$ of the function $u:\RR^N\to\barR$. 
Then the sets $X_{\lambda}$ satisfy the following two structural properties:
\begin{enumerate}[$(i)$]\setlength\itemsep{2pt}
\item If $\lambda>\mu$, then $X_{\lambda}\subset X_{\mu}$, and $X_{-\infty}=\RR^N$.
\item $X_{\lambda}=\bigcap_{\mu<\lambda}X_{\mu}$ for every $\lambda>-\infty$.
\end{enumerate}
Conversely, if $(X_{\lambda})_{\lambda\in\barR}$ is a family of subsets of $\RR^N$ that satisfies $(i)$, then the level sets of the function $u$ defined by 
\begin{equation}\label{eq31}
u(\fxx)=\sup\{\lambda\mid \fxx\in X_{\mu},\lambda\in\barR\}
\end{equation} 
satisfy 
\begin{equation}\label{eq32}
X_{\lambda}\subset\levelset_{\lambda}u=\bigcap_{\mu<\lambda}X_{\mu}
\end{equation}
 for all $\lambda>-\infty$. If $(X_{\lambda})_{\lambda\in\barR}$ also satisfies $(ii)$, then $\levelset_{\lambda}u=X_{\lambda}$ for all $\lambda\in\barR$.
\end{proposition}

\begin{proof}
Relation $(i)$ follows directly from the definition, and $(ii)$ follows from the fact that $u(\fxx)\geq\lambda$ if and only if $u(\fxx)\geq\mu$ for every $\mu<\lambda$. 

Now assume that the family of subsets  $(X_{\lambda})_{\lambda\in\barR}$ satisfies $(i)$. We wish to prove that $X_{\lambda}\subset\levelset_{\lambda}u=\bigcap_{\mu<\lambda}X_{\mu}$ for every $\lambda\in\barR$, where $u$ is defined by \eqref{eq31}. (Note that the assumption $X_{-\infty}=\barR$ in $(i)$ ensures that $u$ is well defined on all of $\RR^N$.)

Suppose that $\fxx\in X_{\lambda}$. Then it follows from the definition of $u$ that $u(\fxx)\geq\lambda$, and hence $\fxx\in\levelset_{\lambda}u$. Thus, $X_{\lambda}\subset\levelset_{\lambda}u$. Now, assume that $\fxx\in\levelset_{\lambda}u$, with $\lambda>-\infty$. Then $u(\fxx)=\sup\{\nu\mid \fxx\in X_{\nu}\}\geq\lambda$. Consider any $\mu<\lambda$. Then there exists a $\mu'$ such that $\mu<\mu'\leq \sup\{\nu\mid \fxx\in X_{\nu}\}$ and $\fxx\in X_{\mu'}$. It follows from $(i)$ that $\fxx\in X_{\mu}$. Since $\mu$ was any number less that $\lambda$, we conclude that $\fxx\in\bigcap_{\mu<\lambda}X_{\mu}$. Conversely, assume that $\fxx\in\bigcap_{\mu<\lambda}X_{\mu}$. Then $\fxx\in X_{\mu}$ for all $\mu<\lambda$, and this implies by the definition of $u$ that $u(\fxx)\geq\lambda$. Hence $\fxx\in\levelset_{\lambda}u$, and we conclude that $\levelset_{\lambda}u=\bigcap_{\mu<\lambda}X_{\mu}$. This proves that $X_{\lambda}\subset\levelset_{\lambda}u =\bigcap_{\mu<\lambda}X_{\mu}$ in case $\lambda>-\infty$. If $(X_{\lambda})_{\lambda\in\barR}$ satisfies $(ii)$, then clearly $\levelset_{\lambda}u=X_{\lambda}$ for $\lambda>-\infty$. In case $\lambda=-\infty$, we have $\levelset_{-\infty}u\subset X_{-\infty}$ from the assumption that $X_{-\infty}=\RR^N$. 
\end{proof}
      
\begin{figure}[!t]
\setkeys{Gin}{width=2.5cm}
\centerline{
\framebox{\includegraphics{fig03.02.1.eps}}
\framebox{\includegraphics{fig03.02.2.eps}}
\framebox{\includegraphics{fig03.02.3.eps}}
\framebox{\includegraphics{fig03.02.4.eps}}
}
\vspace{1.5pt}
\centerline{\hspace{2.84cm}
\framebox{\includegraphics{fig03.02.5.eps}}
\framebox{\includegraphics{fig03.02.6.eps}}
\framebox{\includegraphics{fig03.02.7.eps}}
}
\caption[Level sets of a simple synthetic image]{\label{fig32}
A simple synthetic image and all of its level sets (in white) with  decreasing levels, from left to right and from top to bottom.}
\end{figure}

Families of sets that satisfy conditions $(i)$ and $(ii)$ in Proposition \ref{prop32} appear so often that it is convenient to introduce some nomenclature. 

\begin{definition}\label{chains}
A family of subsets $(X_\lambda)_{\lambda\in\barR}$ of $\RR^N$ that satisfies condition $(i)$ in Proposition \ref{prop32} is called a descending chain; it is called a closed descending chain if it also satisfies condition $(ii)$. If the sets $X_\lambda$ all belong to some family $\mathcal L$ of subsets of $\RR^N$, then we say that $(X_\lambda)_{\lambda\in\barR}$ is a descending chain (or closed descending chain) in $\mathcal L$. We use the same terms when the index set is $\RR$, but we will call $(X_n)_{n\in\NN}$ a sequence. 
\end{definition}

The content of Proposition \ref{prop32} is that there is a correspondence between extended real-valued function on $\RR^N$ and closed descending chains of subsets of $\RR^N$. This correspondence is the fundamental link between function operators and set operators. We will be considering chains of sets that belong to special classes of subsets of $\RR^N$, which we generally denote by $\mathcal L$. For example, $\mathcal L$ might consist of all measurable subsets of $\RR^N$ or of all compact subsets of $\RR^N$. Given any descending chain $(X_\lambda)_{\lambda\in\barR}$ in $\mathcal L$,  closed or not, it is possible to define a function $u$ by equation \eqref{eq31}. Going from $u$ to its level sets, we see from Proposition \ref{prop32} that the descending chain $(\levelset_{\lambda}u)_{\lambda\in\barR}$ is closed. This means that the correspondence between chains and functions is not necessarily one-to-one. The next result and remarks fix this. 

\begin{corollary} Suppose that $(X_{\lambda})_{\lambda\in\barR}$ is a descending chain. Define the new closed chain $(Y_\lambda)_{\lambda\in\barR}$ by $Y_\lambda=\bigcap_{\mu<\lambda}X_{\mu}$ for $\lambda>-\infty$ and $Y_{-\infty}=\RR^N$. Let $u(\fxx)=\sup\{\lambda\mid\fxx\in X_\lambda\}$ and let $v(\fxx)=\sup\{\lambda\mid\fxx\in Y_\lambda\}$. Then $u=v$.
\end{corollary}

\begin{proof}
From Proposition 3.2, $\levelset_\lambda u=Y_\lambda$ for all $\lambda\in\barR$. Being level sets of the function $u$, the $Y_\lambda$ satisfy conditions $(i)$ and $(ii)$. Thus, by Proposition 3.2, $\levelset_\lambda v=Y_\lambda$. Since $u$ and $v$ have the same level sets, $u(\fxx)=v(\fxx)$ for all $\fxx\in\RR^N$. 
\end{proof}

This result shows that although a descending chain $(X_{\lambda})_{\lambda\in\barR}$ may contain ``gaps'' where $X_{\lambda}\ne\bigcap_{\mu<\lambda}X_{\mu}$, the closed descending chain $(Y_{\lambda})_{\lambda\in\barR}$ that is generated by ``closing the gaps'' produces the same function as does $(X_{\lambda})_{\lambda\in\barR}$. Here is another way to look at this result: If we say that two descending chains $(X_{\lambda})_{\lambda\in\barR}$ and $(Y_{\lambda})_{\lambda\in\barR}$, $X_{-\infty}=Y_{-\infty}=\RR^N$ are equivalent if and only if $\bigcap_{\mu<\lambda}X_{\mu}=\bigcap_{\mu<\lambda}Y_{\mu}$ for all $\lambda\in\barR$, then the set of all descending  chains is partitioned into equivalence classes, and these equivalence classes are in one-to-one correspondence with the functions $u:\RR^N\to\barR$. Again, the requirement that $X_{-\infty}=\RR^N$ is necessary to ensure that the corresponding function is defined on all of $\RR^N$.

Notice that if $u(\fxx)<+\infty$ for all $\fxx\in\RR^N$, then $\levelset_{+\infty}u=\emptyset$. Conversely, if $X_{+\infty}=\emptyset$ and $u$ is defined by \eqref{eq31}, then $u(\fxx)<+\infty$ for all $\fxx\in\RR^N$. In the same way, $u(\fxx)>-\infty$ for all $\fxx$ if and only if
\[
\bigcup_{\lambda>-\infty}X_{\lambda}=\RR^N.
\]



\begin{exercise} Prove the following statements:
\begin{enumerate}[(i)]\setlength\itemsep{2pt}
\item $X_{\lambda}=\RR^N$ for $\lambda<\lambda_0$ implies that $u(\fxx)\geq\lambda_0$, $\fxx\in\RR^N$. 
\item $X_{\lambda}=\emptyset$ for $\lambda>\lambda_0$ implies that $u(\fxx)\leq\lambda_0$, $\fxx\in\RR^N$. \finex
\end{enumerate}
\end{exercise}

\begin{proposition}
Let $u$ be a real-valued function with level sets $\levelset_{\lambda}u=\{\fxx\mid u(\fxx)\geq\lambda\}$ for $\lambda\in\RR\cup\{+\infty\}$. If $(\mu_n)_{n\in\NN}$ is an increasing sequence that tends to $\lambda$, then 
\begin{equation}\label{eq33}
\levelset_{\lambda}u=\bigcap_{n\in\NN} \levelset_{\mu_n}u.
\end{equation}
Also,
\begin{equation}\label{eq34}
\{\fxx\mid u(\fxx)>\lambda\}=\bigcup_{\mu>\lambda}\levelset_{\mu}u.
\end{equation}
\end{proposition}
\begin{proof}
If $\fxx\in\levelset_{\mu_n}u$ for all $n\in\NN$, then $u(\fxx)\geq \mu_n$ for all $n\in\NN$. Since $\mu_n\uparrow\lambda$, this implies that $u(\fxx)\geq\lambda$, which means that $\fxx\in\levelset_{\lambda}u$. This proves \eqref{eq33}. Relation \eqref{eq34} follows from the simple observation that $u(\fxx)>\lambda$ if and only if there is a $\mu>\lambda$ such that $u(\fxx)\geq\mu$.
\end{proof}

\begin{figure}[!t]
\setkeys{Gin}{width=10cm}
\centerline{
\includegraphics{fig03.03.1.eps}
}
\caption[Reconstruction of an image from its level sets]{\label{fig33}  Reconstruction of an image from its level sets: an illustration of  Proposition 3.2.  We use four different subsets of the image's level sets to give four reconstructions. Top, left: all level sets;  top, right: all level sets whose gray level is a multiple of 8; bottom, left: multiples of 16;   bottom, right: multiples of 32. Notice the relative stability of the image shape content under these drastic quantizations of the gray levels.
}
\end{figure}

The results proved so far remain true if $\RR^N$, the domain of the functions, is replaced by an arbitrary set $D$.  Although we think of the functions as being images, the results are true for any function with values in $\barR$. On the other hand, properties of the extended reals $\barR$, which serves as the range of the functions considered and as the index set  for the chains $(X_{\lambda})_{\lambda\in\barR}$ from which functions are constructed, are critical for what has been done. We will make additional assumptions about the functions in section 3.1.1, and properties of their domain of definition $\RR^N$ will also come into play. 


\subsection{Functions and level sets defined almost everywhere}

We are going to recast Proposition 3.2 in a measure-theoretic setting and thereby obtain a simpler result. The functions and sets considered will be measurable and defined almost everywhere, and the various statements will hold almost everywhere, that is, modulo sets of measure zero. We say that a set $X$ is contained in a set $Y$ almost everywhere (and write $X\subset Y$ a.e.) if $\text{meas}\,(X\setminus Y)=0$, where ``$\text{meas}\,(X)$'' denotes the usual Lebesgue measure of the set $X\subset\RR^N$. We say that $X=Y$ a.e. if $X\subset Y$ a.e. and $Y\subset X$ a.e. We say that two functions $u$ and $v$ are equal almost everywhere if $\text{meas}\,(\{\fxx\mid u(\fxx)\not=v(\fxx)\})=0$. More generally, we say that a property $P(\fxx)$, $\fxx\in\RR^N$, holds almost everywhere, or for almost every $\fxx$, if it is true for every $\fxx$ except for a set in $\RR^N$ with Lebesgue measure zero.

\begin{lemma}\label{lem35}
Assume that $(X_{\lambda})_{\lambda\in\RR}$ is a descending chain of measurable sets. Then,
\begin{equation}\label{eq35}
X_{\lambda}=\bigcap_{\mu<\lambda}X_{\mu}
\end{equation}
almost everywhere, with the possible exception of at most a countable number of $\lambda's$,
\end{lemma}

\begin{proof}
Let $h$ be any strictly positive continuous function in $L^1(\RR^N)$. (For example, one could take the Gaussian $G_1$.) Write $m(X)=\int_X h(\fxx)\,\rmd\fxx$, and note that $m(X)=0$ if and only if $\text{meas}\,(X)=0$ (Exercise 3.4). The function $\lambda\mapsto m(X_{\lambda})$ is nonincreasing. Thus, it is continuous except possibly for a countable number of points where it ``jumps.'' Call this exceptional set $\Lambda$. Then  $\lim_{\mu\to\lambda}m(X_{\mu})=m(X_{\lambda})$ for $\lambda\in\RR\setminus\Lambda$. For any $\lambda$ and for any increasing sequence $(\mu_n)_{n\in\NN}$ that tends to $\lambda$, we know that $m(X_{\mu_n})\downarrow m(\bigcap_{n\in\NN}X_{\mu_n})$ as $n\to+\infty$ (for example, by the countable additivity of Lebesgue measure). This is equivalent to saying that $m(X_{\mu})\downarrow m(\bigcap_{\mu<\lambda}X_{\mu})$ as $\mu\uparrow\lambda$. Thus, for every $\lambda\in\RR\setminus\Lambda$, $m(\bigcap_{\mu<\lambda}X_{\mu})=m(X_{\lambda})$. Since $X_{\lambda}\subset\bigcap_{\mu<\lambda}X_{\mu}$, this means that $m(\bigcap_{\mu<\lambda}X_{\mu}\setminus X_{\lambda})=0$, which implies \eqref{eq35}. 
\end{proof}

\begin{exercise}
Fill in a couple of the details in the proof of Lemma \ref{lem35}: Prove that $m(X)=0$ if and only if $\text{meas}\,(X)=0$ and that $m(X_{\mu_n})\downarrow m(\bigcap_{n\in\NN}X_{\mu_n})$ as $n\to+\infty$. \finex
\end{exercise}

The (possible) exceptional set $\Lambda$ is going to appear often in the following pages, and thus it is useful to note that it always arrises in the same way: It appears as the points of discontinuity, which we call \textit{jumps}, in a function $\lambda\mapsto m(X_\lambda)$, where $(X_\lambda)_{\lambda\in\barR}$ is some descending chain of subset of $\RR^N$. To avoid confusion, one should note that the jumps in the values of $m(X_\lambda)$ have nothing to do with the \textit{gaps} (points where $X_{\lambda}\ne\bigcap_{\mu<\lambda}X_{\mu}$) in the chain $(X_\lambda)_{\lambda\in\barR}$. There can be only a countable number of jumps, but there can be an uncountable number of gaps. The content of Lemma 3.6 is that the gaps have measure zero except when they coincide with a jump. If the $X_\lambda$ are the level sets of a measurable function $u:\RR^N\to\barR$, then we know from Proposition 3.2 that $(X_\lambda)_{\lambda\in\barR}$ contains no gaps. However, it is possible that the function $\lambda\mapsto m(X_\lambda)$ has up to a countable number of jumps. The next exercise sheds more light on these possible jumps. 

\begin{exercise}
Assume that $(X_\lambda)_{\lambda\in\barR}$ is the family of level sets of a measurable function $u:\RR^N\to\barR$. 
\begin{enumerate}[(i)]\setlength\itemsep{2pt}
\item Show that $\lim_{\mu\to\lambda, \mu<\lambda}m(X_\mu)=m(X_\lambda)$ for all $\lambda\in\RR\cup\{+\infty\}$.
\item Suppose that $\lambda\in\RR\cup\{-\infty\}$. Show that $m(\{\fxx\mid u(\fxx)=\lambda \})=m(X_{\lambda})-\lim_{\mu\to\lambda, \mu>\lambda}m(X_\mu)$.
\item Prove that the Lebesgue measure of $\{\fxx\mid u(\fxx)=\lambda\}$ is greater than zero for at most a countable number of $\lambda\in\barR$. \finex
\end{enumerate} 
\end{exercise}

This exercise shows that there is a one-to-one correspondence between the points $\lambda\in\barR$ where the function $\lambda\mapsto m(X_\lambda)$ is discontinuous and the sets $\{\fxx\mid u(\fxx)=\lambda\}$ that have positive measure. 

The next result is the ``almost everywhere'' version of Proposition \ref{prop32}. We note in advance that all of the sets and functions considered are assumed to be measurable.

\begin{corollary}
Let $(X_\lambda)_{\lambda\in \barR}$ be a descending chain in $\RR^N$ and define $u:\RR^N\to\barR$ by
\[
u(\fxx) =  \sup\{\lambda\mid\fxx \in X_\lambda \}.
\]
Then  $X_{\lambda} = \levelset_{\lambda} u$ almost everywhere, except possibly for at most a countable number of $\lambda's$.
\end{corollary}

\begin{proof}
By Proposition \ref{prop32}, $X_\lambda \subset \levelset_\lambda u=\bigcap_{\mu < \lambda} X_\mu$ for all $\lambda>-\infty$. By Lemma 3.6, $X_\lambda = \bigcap_{\mu<\lambda} X_\mu$ almost everywhere, except possibly for at most a countable number of $\lambda$'s. This proves the result.
\end{proof}

We end this section with a useful lemma that ensures the reconstruction of a function up to a set of measure zero given that we know its level sets almost everywhere at almost every level.

\begin{lemma}
Let $u$ be a function $u:\RR^N\to\RR$ and  $(Y_{\lambda})_{\lambda\in\RR}$ a family of sets such that for a.e. $\lambda\in\RR$, $\levelset_{\lambda}u=Y_{\lambda}$ almost everywhere. Then $u(\fxx)=\sup\{\lambda\mid \fxx\in Y_{\lambda}\}$ for a.e. $\fxx\in\RR^N$.
\end{lemma}
\begin{proof}
Let $N\subset\RR$ be the set of measure zero for which $\levelset_{\lambda}u\ne Y_{\lambda}$ almost everywhere. Then for all $\lambda\in\RR\setminus N$, $\levelset_{\lambda}u=Y_{\lambda}$ almost everywhere. Let $\Lambda\subset\RR\setminus N$ be a countable dense subset of $\RR$. Then
$
u(\fxx)=\sup\{\lambda\mid \lambda\in\RR, \fxx\in\levelset_{\lambda}u\}=\sup\{\lambda\mid \lambda\in\Lambda, \fxx\in\levelset_{\lambda}u\}.
$ For $\lambda\in\Lambda$, let $N_{\lambda}=(\levelset_{\lambda}u\setminus Y_{\lambda})\cup (Y_{\lambda}\setminus\levelset_{\lambda}u)$, and write $M=\bigcup_{\lambda\in\Lambda}N_{\lambda}$. Then $\text{meas}\,(M)=0$, and $u(\fxx)=\sup\{\lambda\mid \lambda\in\Lambda, \fxx\in\levelset_{\lambda}u\}=\sup\{\lambda\mid \fxx\in Y_{\lambda}\}$ for $\fxx\in\RR^N\setminus M$.
\end{proof}

Since this argument will be used again, it is worth emphasizing two points: Given any descending chain $(X_\lambda)_{\lambda\in\RR}$, the function $u(\fxx)=\sup\{\lambda\mid\fxx\in X_\lambda\}$ is completely determined by the chain $(X_\lambda)_{\lambda\in\Lambda}$, where $\Lambda$ is any dense subset of $\RR$, in particular, any countable dense subset of $\RR$. By choosing a countable dense set $\Lambda$ that avoided the exceptional set $N$, it was possible to find a single set $M$ of measure zero such that $u(\fxx)=\sup\{\lambda\mid\fxx\in Y_\lambda\}$ for $\fxx\in\RR^N\setminus M$. Here is another point of view: Since $\levelset_\lambda u\setminus M=Y_\lambda\setminus M$ for $\lambda\in\Lambda$, the two chains $(\levelset_\lambda u\setminus M)_{\lambda\in\Lambda}$ and $(Y_\lambda\setminus M)_{\lambda\in\Lambda}$ generate the same function on the domain $\RR^N\setminus M$, and that function is $u$ restricted to $\RR^N\setminus M$.

\begin{exercise}
Construct a simple family of sets $X_{\lambda}\subset\RR^2$, $\lambda\in\barR$, that have the structural properties given in Proposition 3.2 and such that the function $u$ defined by \eqref{eq31} is $+\infty$ and $-\infty$ on subsets of $\RR^2$ with positive measure. \finex
\end{exercise}


\section{Contrast changes and level sets}

We have already seen that the level sets of a function are globally preserved under a continuous increasing contrast change. Although we have not mentioned it, it is clear that the structural properties of the level sets are also preserved under such a transformation. We are now going to consider the more realistic situation where we relax the assumptions about the contrast change. Practical aspects of contrast changes are illustrated in Figures 3.4, 3.5, 3.6, and 3.7.

\begin{definition}
Any nondecreasing function $g:\RR\to\RR$ will be called a contrast change. We also consider its natural extension to $\barR$ by defining 
\[
g(-\infty)=\inf_{x\in\RR} g(x)\quad\text{and}\quad g(+\infty)=\sup_{x\in\RR} g(x).
\]
\end{definition}

In case $g$ is continuous and increasing, $g$ has a well-defined inverse $g^{-1}$, but this is not true for a general contrast change. On the other hand, we need to have a pseudoinverse for $g$ that is compatible with the structural properties of level sets. 

\begin{definition}
The pseudoinverse of any contrast change $g:\barR\to\barR$ is defined by
\[
g^{(-1)}(\lambda)=\inf \{r\mid g(r)\geq\lambda\}.
\]
\end{definition} 

For consistency, throughout the book we use the following conventions regarding the infimum and supremum of the null set $\emptyset\subset\barR$:
\[
\inf \emptyset =+\infty\quad\text{and}\quad\sup \emptyset =-\infty.
\]

\begin{exercise}
Compute $g^{(-1)}$ for the following functions.
\begin{enumerate}[(i)]\setlength\itemsep{2pt}
\item $g(s)=\max(0,s)$.
\item $g(s)=1$ if $s\geq0$, and $g(s)=0$ if $s<0$. \finex
\end{enumerate}
\end{exercise}

\begin{lemma}
Suppose that $g:\barR\to\barR$ is a contrast change. Then for $\lambda\in\barR$, we have the following two properties:
\begin{equation}\label{eq36}
\text{If } \lambda\leq g(g^{(-1)}(\lambda)), \text{ then } g(s)\geq\lambda\text{ if and only if } s\geq g^{(-1)}(\lambda).
\end{equation}
\begin{equation}\label{eq37}
\text{If } \lambda>g(g^{(-1)}(\lambda)), \text{ then } g(s)\geq\lambda\text{ if and only if } s> g^{(-1)}(\lambda).
\end{equation}
\end{lemma}

\begin{figure}[!t]
\setkeys{Gin}{width=10cm}
\centerline{
\includegraphics{fig03.04.1.eps}
}
\caption[Histogram of an image]{\label{fig34}The histogram of the image Bird. For each $i \in \{0, 1,\ldots, 255\}$, we display (above, right) the function $h(i) = \text{Card}\,\{\fxx\mid u(\fxx)=i\}$. The function below is the is given by $g(i) = \text{Card}\,\{\fxx\mid u(\fxx) \leq i \}$, an integral of $h$. It provides an indication about the overall contrast of the image and about the contrast change imposed by the sensors. The inverse function $g^{-1}$ can be used as a contrast change to create an image $g^{-1}(u)$ with a flat histogram.}
\end{figure}

\begin{proof}

First assume that $ \lambda\leq g(g^{(-1)}(\lambda))$. If $g(s)\geq
\lambda$, then $s\geq g^{(-1)}(\lambda)$ by the definition of $g^{(-1)}(\lambda)$. Conversely, if $s\geq g^{(-1)}(\lambda)$, $g(s)\geq g(g^{(-1)}(\lambda))\geq \lambda$  and thus $g(s)\geq \lambda$. This yields \eqref{eq36}. Now assume that $\lambda> g(g^{(-1)}(\lambda))$.  Then $g(s)\geq \lambda$ implies $g(s)>g(g^{(-1)}(\lambda))$. Thus, $g$ being nondecreasing,
$s>g^{(-1)}(\lambda)$. Conversely, if  $s>g^{(-1)}(\lambda)$, then  there exists by the definition of $g^{(-1)}$ some $r<s$ such that $g(r)\geq \lambda $. Thus, $g(s)\geq g(r)\geq \lambda.$
\end{proof}

The next result explains how the level sets of a function $g(u)$ are related to the level sets of $u$, where $g$ is a contrast change.

\begin{theorem}
Let $u$ be a real-valued function defined on $\RR^N$ and let $g$ be a contrast change. Then for $\lambda\in\barR$, the level set $\levelset_{\lambda}g(u)$ satisfies one of the following relations:\newline
\noindent Either
\vspace{-8pt}
\begin{align}
\levelset_{\lambda}g(u)&= \{\fxx\mid u(\fxx)\geq g^{(-1)}(\lambda)\}
= \levelset_{g^{(-1)}(\lambda)}u,\\[-3ex]
\intertext{or}\notag\\[-6ex]
\levelset_{\lambda}g(u)&= \{\fxx\mid u(\fxx)> g^{(-1)}(\lambda)\}
= \bigcup_{\mu>g^{(-1)}(\lambda)}\levelset_{\mu}u.
\end{align}
\end{theorem}
\begin{proof}
The proof is read directly from Lemma 3.11, which says that for any $\lambda\in\barR$, either
\vspace{-1pt}
\begin{align*}
g(s)\geq\lambda\quad\text{ if and only if }\quad s\geq g^{(-1)}(\lambda),\\[-3ex]
\intertext{or}\\[-6ex]
g(s)\geq\lambda\quad\text{ if and only if }\quad s> g^{(-1)}(\lambda).
\end{align*}
By letting $s=u(\fxx)$, this alternative implies the following one:
Either
\vspace{-1pt}
\begin{align}
\levelset_{\lambda}g(u)&=\{\fxx\mid g(u(\fxx))\geq\lambda\}=\{\fxx\mid u(\fxx)\geq g^{(-1)}(\lambda)\}
=\levelset_{g^{(-1)}(\lambda)}u,\\[-3ex]
\intertext{or}\notag\\[-6ex]
\levelset_{\lambda}g(u)&=\{\fxx\mid g(u(\fxx))\geq \lambda\}=\{\fxx\mid u(\fxx)> g^{(-1)}(\lambda)\}=\bigcup_{\mu>g^{(-1)}(\lambda)}\levelset_{\mu}u.
\end{align}
Note that the last equality in (3.11) comes from Proposition 3.5.
\end{proof}



\begin{figure}[!t]
\setkeys{Gin}{width=8.5cm}
\centerline{
\includegraphics{fig03.05.1.eps}
}
\caption[Contrast changes and an equivalence class of images]{\label{fig35}Contrast changes and an equivalence class of images. The three images have exactly the same level sets and level lines, but their level sets are mapped onto three different gray-level scales. The graphs on the right are the graphs of the contrast changes $u\mapsto g(u)$ that have been applied to the initial gray levels. The first one is concave; it enhances the darker parts of the image. The second one is the identity; it leaves the image unaltered. The third one is convex; it enhances the brighter parts of the image. Software allows one to manipulate the contrast of an image to obtain the best visualization. From the image analysis viewpoint, image data should be considered as an equivalence class under all possible contrast changes.}
\end{figure}

\begin{exercise}
Let $u:\RR^N\to\RR$ be measurable and let $g$ be a contrast change. Show that for $\lambda\in\RR$ and $\varepsilon>0$, there exists a $\mu\in\RR$ such that $\levelset_{\mu}u\subset\levelset_{\lambda}g(u)$ and $\text{meas}\,(\levelset_{\lambda}g(u)\setminus\levelset_{\mu}u)<\varepsilon$. \finex
\end{exercise}

Both alternatives, (3.8) and (3.9), can occur in the same image. Here is a simple example: Let $u(x)=x$ for $x\in\RR$ and let $g(x)=x$ if $x\leq0$ and $g(x)=x+1$ if $x>0$. Then the level set $\levelset_1 g(u)$ is not a level set of $u$, but $\levelset_1 g(u)=(0,+\infty)=\{x\mid u(x)>0\}$. 

\begin{exercise}
Compute all of the level sets of $u$ and $g(u)$ in the example and compare them. \finex
\end{exercise}

\begin{exercise}
Give a simple example of a function $u$ such that the functions $g(u)$ have the same level sets as $u$ for many contrast changes $g$. \finex
\end{exercise}

The next result is the converse of Theorem 3.12. Roughly, it states that if the level sets of $v$ are level sets of $u$, then $v=g(u)$ for some contrast change $g$. In addition, Theorem 3.13 gives an algorithm for computing a contrast change that maps $u$ onto $v$. We know from Exercise 3.10 that this contrast change is not necessarily unique.

\begin{figure}[!t]
\setkeys{Gin}{width=10cm}
\centerline{
\includegraphics{fig03.06.1.eps}
}
\caption[Histogram and contrast change II]{\label{fig36} The two images (left) have the same set of level sets. The contrast change that maps the upper image onto the lower image is displayed on the right. It corresponds to one of the possible $g$ functions whose existence is stated in Corollary 3.14. The function $g$ may be locally constant on intervals where the histogram of the upper image is zero (see top, middle graph). Indeed, on such intervals, the level sets are invariant.
}
\end{figure}

\begin{theorem}
Suppose that $u$ and $v$ are two real-valued functions defined on $\RR^N$ such that for every $\lambda\in\barR$ the following alternative holds:\newline
\noindent Either there exists a $\mu\in\barR$ such that
%\vspace{-8pt}
\begin{align}
\levelset_{\lambda}v&=\{\fxx\mid u(\fxx)\geq \mu\}=\levelset_{\mu}u,\\
\intertext{or there exists a $\mu\in\barR$ such that}
\levelset_{\lambda}v&=\{\fxx\mid u(\fxx)> \mu\}=\bigcup_{\nu>\mu}\levelset_{\nu}u.
\end{align}
Then the contrast change $g:\barR\to\barR$ defined by
\begin{equation}\label{ex}
g(\mu)=\sup\{\lambda\mid\levelset_{\mu}u\subset\levelset_{\lambda}v\}
\end{equation}
maps $u$ onto $v$, that is, $v=g(u)$.
\end{theorem}

\begin{proof}The first thing to note is that $g$ is defined for every $\mu\in\barR$ and that $\nu>\mu$ implies that $g(\nu)\geq g(\mu)$. This follows from Proposition 3.2$(i)$. The proof that $v=g(u)$ will be presented in two steps.
\medskip

\noindent{\bf Step 1: proof that} $\bm{v(\fxx)\geq g(u(\fxx))}$. Consider $\Lambda=\{\lambda\mid\levelset_{\mu}u \subset\levelset_{\lambda}v\}$. We wish to show that $g(\mu)=\sup\Lambda\in\Lambda$. If $\sup\Lambda=-\infty$, then $\Lambda=\{-\infty\}$, so we may assume that $\sup\Lambda>-\infty$. If $\lambda_0\in\Lambda$, then $\lambda\in\Lambda$ for all $\lambda<\lambda_0$ by Proposition 3.2$(i)$. This means that $\lambda\in\Lambda$ for all $\lambda<\sup\Lambda$. But by Proposition 3.2$(ii)$, $\levelset_{\sup\Lambda}v=\bigcap_{\lambda<\sup\Lambda}\levelset_{\lambda}v$, and  this implies by the definition of $\Lambda$ that $g(\mu)=\sup\Lambda\in\Lambda$. Thus,
\begin{equation}\label{eq313}
\levelset_{\mu}u\subset\levelset_{g(\mu)}v.
\end{equation}
Given $\fxx\in\RR^N$, let $\mu=u(\fxx)$ in \eqref{eq313}. Then,
\[
\levelset_{u(\fxx)}u\subset\levelset_{g(u(\fxx))}v. 
\]
Since $\fxx\in\levelset_{u(\fxx)}u$, we conclude that $\fxx\in\levelset_{g(u(\fxx))}v=\{\fxy\mid v(\fxy)\geq g(u(\fxx))\}$. 
\medskip

\noindent{\bf Step 2: proof that} $\bm{v(\fxx)\leq g(u(\fxx))}$. Given $\fxx\in\RR^N$, we write the assumed alternative with $\lambda=v(\fxx)$ as follows:
Either there exists a $\mu(\fxx)\in\barR$ such that
%\vspace{-8pt}
\begin{align}\label{eq314}
\levelset_{v(\fxx)}v&=\{\fxy\mid u(\fxy)\geq \mu(\fxx)\}=\levelset_{\mu(\fxx)}u,\\
\intertext{or there exists a $\mu(\fxx)\in\barR$ such that}\label{eq315}
\levelset_{v(\fxx)}v&=\{\fxy\mid u(\fxy)> \mu(\fxx)\}=\bigcup_{\nu>\mu(\fxx)}\levelset_{\nu}u.
\end{align}

First assume that \eqref{eq314} holds. Since $\fxx\in\levelset_{v(\fxx)}v$, we know that $\fxx\in\levelset_{\mu(\fxx)}u$. Thus, $u(\fxx)\geq\mu(\fxx)$, and
$
\levelset_{u(\fxx)}u\subset\levelset_{\mu(\fxx)}u=\levelset_{v(\fxx)}v. 
$
This last relation implies by the definition of $g$ that $v(\fxx)\leq g(u(\fxx))$.

Now assume that \eqref{eq315} holds. Since $\fxx\in\levelset_{v(\fxx)}v$, we deduce from \eqref{eq315} the existence of some $\nu>\mu(\fxx)$ such that $\fxx\in\levelset_{\nu}u$. Thus, $u(\fxx)\geq\nu$, and we have the inclusions
\[
\levelset_{u(\fxx)}u\subset\levelset_{\nu}u\subset\levelset_{v(\fxx)}v.
\]
Again, by the definition of $g$, $v(\fxx)\geq g(u(\fxx))$.
\end{proof}

The contrast change $g$ defined by (3.14) is, in general, not the only nondecreasing function that maps $u$ into $v$ (see Exercise 3.10). However, $g$ does have a unique property: If one considers the family of functions $H=\{h \mid h \text{ is a contrast change, } v(\fxx)=h(u(\fxx))\}$, then $g(\fxx)=\sup_{h\in H}h(\fxx)$.

\begin{exercise}
With the assumptions of Theorem 3.13, prove that $f(\fxx)=\sup_{h\in H}h(\fxx)$ is a contrast change and that $f=g$, where $g$ is defined by \eqref{ex}. \finex
\end{exercise}




We end this section with a statement that is easy to remember: If all level sets of $v$ are level sets of $u$, then there exists a contrast change $g$ such that $v=g(u)$. Here is the precise statement:

\begin{corollary}
If $u$ and $v$ are two real-valued functions such that all the level sets of $v$ are level sets of $u$, then the contrast change $g:\barR\to\barR$ defined by
\begin{equation}
g(\mu)=\sup\{\lambda\mid\levelset_{\mu}u\subset\levelset_{\lambda}v\}
\end{equation}
maps $u$ onto $v$.
\end{corollary}

\section{Semicontinuous contrast changes}

We are going to consider contrast changes that are upper semicontinuous (u.s.c.). (There are parallel results for lower semicontinuous (l.s.c.) contrast changes.) This subject is relevant for image processing because threshold functions and quantization functions are typically either u.s.c. or l.s.c. 

\begin{definition}
A nondecreasing function (a contrast change) $g:\barR\to\barR$ is upper semicontinuous if, for all $r<+\infty$, 
\[
g(r)=\lim_{\stackrel{\scriptstyle{\rho\to r}}  {\rho>r}}g(\rho)=\lim_{\rho\to r^+}g(\rho).
\]
\end{definition}
\begin{corollary}
Assume that $g$ is an upper semicontinuous contrast change. Then for every $\lambda\in\barR$ for which $g^{(-1)}(\lambda)<+\infty$,
\begin{equation}\label{eq319}
g(s)\geq\lambda\quad\text{ if and only if }\quad s\geq g^{(-1)}(\lambda).
\end{equation}
\end{corollary}
\begin{proof}
Since $g^{(-1)}(\lambda)<+\infty$,  there is,  by the definition of $g^{(-1)}(\lambda)$, a sequence $(r_n)_{n\in\NN}$ such that $r_n\downarrow g^{(-1)}(\lambda)$ and $g(r_n)\geq\lambda$. Since $g$ is u.s.c., $g(r_n)\downarrow g(g^{(-1)}(\lambda))$ as $n\to+\infty$. Hence, $g(g^{(-1)}(\lambda))\geq\lambda$, and \eqref{eq319} follows from Lemma 3.11. 
\end{proof}

\begin{exercise}
Show that the result may be false if $g^{(-1)}(\lambda)=+\infty$. Take $g(s)=0$ for all $s$. Then $g^{(-1)}(1)=+\infty$, and $g(s)\geq1$ is impossible. \finex
\end{exercise}

\begin{corollary}
Let $g$ be an u.s.c. contrast change and let $u$ be a  function from $\RR^N$ to $\RR$. Then every level set $\levelset_{\lambda}g(u)$ of $g(u)$ is a level set of $u$, and, in fact,
\begin{equation}\label{eq320}
\levelset_{\lambda}g(u)=\levelset_{\mu}u,
\end{equation}
where $\mu=g^{(-1)}(\lambda)$.
\end{corollary}
\begin{proof}
Assume that $g^{(-1)}(\lambda)<+\infty$. By Corollary 3.16, $g(u(\fxx))\geq\lambda$ if and only if $u(\fxx)\geq g^{(-1)}(\lambda)$, which proves \eqref{eq320}. If $g^{(-1)}(\lambda)=+\infty$, \eqref{eq320} is also true, but both sets are empty. Indeed, if $g^{(-1)}(\lambda)=+\infty$, this implies that either $\{r\mid g(r)\geq\lambda\}$ contains the single point $+\infty$ or $g(r)<\lambda$ for all $r\in\barR$. In either case, $g(r)<\lambda$ for all $r\in\RR$, so $g(u(\fxx))<\lambda$ for all $\fxx\in\RR^N$. Hence, both $\levelset_{\lambda}g(u)$ and $\levelset_{+\infty}u$ are empty.
\end{proof}

\begin{figure}[!t]
\setkeys{Gin}{width=12cm}
\centerline{
\includegraphics{fig03.07.1.eps}
}
\caption[Histogram  contrast change I]{\label{fig37}The original image (top, left) has a strictly positive histogram (all gray levels between 0 and 255 are represented). Therefore, if any contrast change $g$ that is not strictly increasing is applied, then some data will be lost. Every level set of the transformed image $g(u)$ is a level set of the original image; however, the original image has more level sets than the transformed image. 
}
\end{figure}

Properties of $g^{(-1)}$ in case $g$ is continuous will be used in Chapter 6, so with this in mind, we are going to investigate these properties here. Assume that $g$ is a continuous contrast change and write $g(-\infty)=\lambda^-$ and $g(+\infty)=\lambda^+$. The case where $g$ is a constant is left as an exercise, so assume that $\lambda^+>\lambda^-$. We wish to show that $g(g^{(-1)}(\lambda))=\lambda$ if $\lambda\in(\lambda^-,\lambda^+)$, which is not necessarily true if $g$ is only u.s.c. Our approach is to show that 
\begin{equation}\label{eq321}
g^{(-1)}(\lambda)=\inf\{r\mid g(r)=\lambda\}.
\end{equation}
The first thing to notice is that $\{r\mid g(r)=\lambda\}$ is not empty, since $g$ is continuous and nondecreasing on $(\lambda^-,\lambda^+)$. Let $\inf\{r\mid g(r)\geq\lambda\}=r_{\lambda}^-$ and let $\inf\{r\mid g(r)=\lambda\}=r_{\lambda}^+$. Both infima are attained, $r_\lambda^-\leq r_\lambda^+$, $g(r_{\lambda}^+)=\lambda$, and $g(r_{\lambda}^-)\geq\lambda$. Since $g$ is nondecreasing, $g(r_{\lambda}^-)\leq g(r_{\lambda}^+)=\lambda$. Thus, $g(r_{\lambda}^-)=\lambda$. But $r_{\lambda}^+$ was the smallest $r$ such that $g(r)=\lambda$, so $r_\lambda^-=r_\lambda^+$. Since $r_\lambda^-=g^{(-1)}(\lambda)$ by definition, $g(g^{(-1)}(\lambda))=\lambda$. 

Another property of $g^{(-1)}$ is that it is strictly increasing: If $\lambda<\mu$, $\lambda, \mu\in(\lambda^-,\lambda^+)$, then from what we have just shown, $g(g^{(-1)}(\lambda))<g(g^{(-1)}(\mu))$. Since $g$ is nondecreasing, we must conclude that $g^{(-1)}(\lambda)<g^{(-1)}(\mu)$.

The final property we wish to highlight is that $g^{(-1)}$ is lower semicontinuous. In fact, it is l.s.c. on all of $\barR$. We collect these results in the following lemma.

\begin{lemma}Let $g$ be a nonconstant continuous contrast change. Then, on the interval $(\lambda^-,\lambda^+)$, $g(g^{(-1)}(\lambda))=\lambda$ and $g^{(-1)}$ is strictly increasing. Furthermore, $g^{(-1)}$ is lower semicontinuous on $\barR$.
\end{lemma}
\begin{proof}It remains to be shown that $g^{(-1)}$ is l.s.c. If $\lambda\leq\lambda^-$, then $g^{(-1)}(\lambda)=-\infty$, and it is clear that $g^{(-1)}$ is l.c.s. for all of these values. The same is true for $\lambda>\lambda^+$. Now assume that $\lambda\in(\lambda^-,\lambda^+)$, and let $(\mu_n)$ be an increasing sequence that tends to $\lambda$. Since $g^{(-1)}$ and $g$ are nondecreasing and since $g$ is continuous, we see that $g(g^{(-1)}(\mu_n))=\mu_n\uparrow\lambda$ and $g^{(-1)}(\mu_n)\uparrow s_0$, for some value $s_0\leq g^{(-1)}(\lambda)$. Since $g(s_0)=\lambda$, we see from the definition of $g^{(-1)}(\lambda)$ that $ g^{(-1)}(\lambda)\leq s_0$. Thus, $s_0=g^{(-1)}(\lambda)$, which proves that $g^{(-1)}$ is lower semicontinuous at $\lambda$. The only point that remains to be investigated in $\lambda=\lambda^+$, and we leave this as the next exercise.
\end{proof}

\begin{exercise}Prove that $g^{(-1)}$ is l.s.c. at $\lambda=\lambda^+$. Hint: There are two cases: Either there is an $r\in\RR$ such that $g(r)=\lambda^+$, or $g(r)<\lambda^+$ for all $r\in\RR$. The techniques of Lemma 3.18 can be used in both cases. \finex  
\end{exercise}


\section{Comments and references}

\paragraph*{Contrast invariance and level sets.} It was Wertheimer who noticed that the actual local values of the gray levels in an image could not be relevant information for the human visual system \cite{Wertheimer:1923:ULG}. Contrast invariance is one of the fundamental model assumptions in mathematical morphology. The two basic books on this subject are Matheron \cite{Matheron:1975:RSI} and Serra \cite{Serra:1982:IAM,Serra:1988:IAM}. See also the fundamental paper by Serra \cite{Serra:1986:IMM}. Ballester et al. defined an ``image intersection'' whose principle is to keep all pieces of bilevel sets common to two images \cite{Ballester:1998:FCI}. (A bilevel set is of the form $\{\fxx\mid \lambda\leq u(\fxx)\leq\mu\}$.) Monasse and Guichard recently developed a \textit{fast level set transform} (FLST) to associate with every image the inclusion tree of connected components of level sets \cite{MnsseGchrd3}. They show that the inclusion trees of connected upper and lower level sets can be fused into a single inclusion tree; among other applications, this tree can be used for image registration. See Monasse \cite{MonassePhD}. 

\paragraph*{Contrast changes.} The ability to vary the contrast (to apply a contrast change) of a digital image is a very useful tool for improving image visualization. Professional image processing software has this capability, and it is also found in popular software for manipulating digital images. For more about contrast changes that preserve level sets, see \cite{Caselles:SPL}. Many reference on contrast-invariant operators are given at the end of Chapter 6.

\ifodd\count0
	\clearpage
	\leavevmode
	\thispagestyle{empty}
	\clearpage
\else\relax
\fi








 