%gmChap12.tex. 

\graphicspath{{./figures/chapter12/}}

\chapter{Affine-Invariant Mathematical Morphology}

In Chapter 8, we introduced a class of simple set and function operators called erosions and dilations. These operators were defined by a single structuring set. They were contrast invariant and translation invariant, but they are not affine invariant. In this chapter, we introduce set operators, also called erosions and dilations, that are affine invariant. 

Our interest in affine-invariant smoothing, like our interest in contrast- and translation-invariant smoothing, is based on practical considerations. When we take a photograph of a plane image, say, a painting, the image is projected onto the focal plane of the camera. If the camera is an ideal pin-hole device, then this is a projective transformation where the center of projection is the pin hole. In any case, it approximates a projective transformation. If we are far removed from the plane of the painting, then the focal plane of the camera approximates the plane at infinity, and the transformation looks like an affine transformation. For a more common example, we note that most copy machines, fax machines, and scanners introduce a slight affine distortion. Thus, we would like the smoothing to be affine invariant so it is ``blind'' to any deformations introduced by these processes. It would be nice to have smoothing that is invariant under the full projective group, but we will see later (Chapter 20) that this is not possible. 

\section{Notes on geometry}

Isometries, by definition, preserve the distance between points, and hence, preserve the angle between vectors. In a finite dimensional space $\RR^N$, any isometry can be represented by $\fxx\mapsto A\fxx+\fxa$, where $A$ is an orthogonal matrix and $\fxa$ is a fixed vector. These transformations include all of the rigid motions of $\RR^N$ plus reflections. Classical Euclidean geometry in $\RR^2$ is concerned with the objects that are invariant under these transformations. If we loosen the requirement that the matrix $A$ be orthogonal and assume only that it is nonsingular, then we have generalized Euclidean motions to affine motions, and the distance between points is no longer an invariant. However, there are affine invariants, and the most important from our point of view are that parallel lines are mapped into parallel lines and finite points are mapped into finite points. Furthermore, if the determinant of $A$ is one, $|A|=1$, then the transformation preserves area: A unit square is mapped into a parallelogram whose area is one. Note, however, that this parallelogram can be arbitrarily long. 

If we jump to projective geometry and the projective plane, then parallel lines are not necessarily preserved. If, however, the point of projection (the central point) is a point on the line at infinity (or, said another way, the point at infinity in a given direction), then the mapping reduces to an affine mapping. Thus, affine transformations are a special class of  projective transformations. This means that affine geometry can be considered a generalization of Euclidian geometry or a specialization of projective geometry. In any case, the most we can ask is the our transforms be affine invariant and thus preserve parallel lines and area. Incidentally, this is the view taken in classical Chinese drawing, which tends always to display scenes as seen from a distance.

\section{Affine-invariant erosions and dilations}

Everything in this chapter will take place in $\RR^2$, so the following definition is given for $\RR^2$. Recall that the group of all linear affine transformations $A:\RR^2\to\RR^2$ is called the full linear group, $FL(\RR^2)$, and is represented by all $2\times2$ nonsingular matrices. The subgroup of those transformations represented by $A$ with determinant one, $|A|=1$,  is called the special linear group; it is often denoted by $SL(\RR^2)$.   

Our goal is to define erosions and dilations that are invariant under $SL(\RR^2)$. Any attempt to do so using Euclidean distance is doomed to failure, since the distances between points in any given direction can be arbitrarily augmented. It is thus necessary to base the definition of affine-invariant erosions and dilations on some affine invariant, and the most obvious one to use is area. This leads to the notion of the \textit{affine-invariant distance} between a point and a set. We begin with the definition of a \textit{chord-arc set}.

\begin{definition}Let $X$ be a subset of $\RR^2$ and let $\Delta$ be a straight line in $\RR^2$. Any connected component of $X\setminus\Delta=X\cap\Delta^c$ is called a chord-arc set defined by $X$ and $\Delta$.  
\end{definition}

\begin{exercise}Chord-arc sets take their name from the case where $X$ is a disk, in which case a chord-arc set is called a segment. What are the chord-arc sets if (i) $X$ is an open disk and (ii) $X$ is a closed disk? What is the situation when $X$ is an arc of a circle or a segment of a disk? \finex
\end{exercise}

\begin{exercise}Suppose that $\fxx\in({\overline X})^c\cap\Delta$. Show that there are two, and only two, chord-arc sets defined by $({\overline X})^c=(X^c)^\circ$ and $\Delta$ that contain $\fxx$ in their boundary. (Note that we are assuming that $({\overline X})^c\not=\emptyset$.) \finex
\end{exercise}

We are interested first is some special chord-arc sets that will be used to define the affine distance from a point $\fxx$ to a set $X$. From Exercise 12.2, we know that there are only two chord-arc sets defined by $({\overline X})^c$ and $\Delta$ that contain $\fxx$ in their boundary, if ${\overline X}\not=\RR^2$. In this case, we call these two sets  $CA_1(\fxx,\Delta,X)$ and $CA_2(\fxx,\Delta,X)$, and we order them so
\[
{\rm area}(CA_1(\fxx,\Delta,X))\leq{\rm area}(CA_2(\fxx,\Delta,X)).
\]

\begin{definition}Let $X$ be an arbitrary subset of $\RR^2$ and let $\fxx$ be an arbitrary point in $\RR^2$. We define the affine distance from $\fxx$ to $X$ to be $\delta(\fxx,X)=\inf_\Delta[{\rm area}(CA_1(\fxx,\Delta,X))]^{1/2}$ if $\fxx\in({\overline X})^c(\not=\emptyset)$ and $\delta(\fxx,X)=0$ otherwise. (See Figure \ref{figure_chord_arc_min}.) 
\end{definition}

The power $1/2$ is taken so $\delta$ has the ``dimension'' of a distance. Notice that $\delta$ is well defined because $CA_1(\fxx,\Delta,X)$ and $CA_2(\fxx,\Delta,X)$ are Borel sets and thus measurable. And notice that $\delta(\fxx,X)$ can be infinite: Take $X$ to be convex and compact and $\fxx\not\in X$. Then all chord-arc sets defined by a straight line $\Delta$ through $\fxx$ have infinite area. Notice also that $\delta(\fxx,\emptyset)=+\infty$ and $\delta(\fxx,\RR^2)=0$.

\begin{definition}The affine a-dilation $\tilde{\mathcal D}_a$ and the affine a-erosion $\tilde{\mathcal E}_a$ are set operators defined on $X\subset\RR^2$ by $\tilde{\mathcal D}_a X=\{\fxx\mid\delta(\fxx,X)\leq a^{1/2}\}$ and $\tilde{\mathcal E}_a X=\{\fxx\mid\delta(\fxx,X^c)> a^{1/2}\}$.
\end{definition}

\begin{exercise}Check that $\tilde{\mathcal D}_a\RR^2=\tilde{\mathcal E}_a\RR^2=\RR^2$. Show that $\tilde{\mathcal E}_a X=(\tilde{\mathcal D}_a X^c)^c$. (Recall Exercise 8.1(ii).) This relation shows that eroding a set and dilating its complement yield complementary sets. This is a useful symmetry, since the same shape can appear as an upper level set or as the complement of an upper level set, depending on whether it is darker or lighter then the background. \finex
\end{exercise}



\begin{figure}[!t]
\setkeys{Gin}{width=7cm}
\centerline{
\includegraphics{fig12.01.1.eps}
}
\caption[Affine distance to a set]{Affine distance to a set.}
\label{figure_chord_arc_min}
\end{figure}

The names we have used for the operators $\tilde{\mathcal E}_a$ and $\tilde{\mathcal D}_a$ are not standard nomenclature in mathematical morphology. Indeed, in mathematical morphology, a dilation must commute with set union and an erosion is expected to commute with set intersection. It is easy to check that the $\tilde{\mathcal E}_a$ and $\tilde{\mathcal D}_a$ do not satisfy these properties.\footnote{We thank Michael Schmidtt for pointing this out to us.} Nevertheless, we will use these names. There should be no confusion, and these operators are clearly sound generalizations of the corresponding Euclidean erosions and dilations discussed in Chapter 8.

\begin{proposition}Let $A$ be a linear affine transformation such that $|A|>0$. Then $\tilde{\mathcal E}_a$ and $\tilde{\mathcal D}_a$ are affine-invariant monotone operators in the sense that $\tilde{\mathcal E}_aA=A\tilde{\mathcal E}_{|A|^{-1}a}$ and $\tilde{\mathcal D}_aA=A\tilde{\mathcal D}_{|A|^{-1}a}$. In particular, $\tilde{\mathcal E}_aA=A\tilde{\mathcal E}_{a}$ and $\tilde{\mathcal D}_aA=A\tilde{\mathcal D}_{a}$ if $|A|=1$.
\end{proposition}

\begin{proof}If $X\subset Y$, then it is easily seen from the definitions that $\delta(\fxx,Y)\leq\delta(\fxx,X)$ for every $\fxx\in\RR^2$. It then follows from the definition of $\tilde{\mathcal D}_a$ that $\tilde{\mathcal D}_aX\subset\tilde{\mathcal D}_aY$. Hence, $\tilde{\mathcal D}_a$ is monotone. The monotonicity of $\tilde{\mathcal E}_a$ follows directly from the relation $\tilde{\mathcal E}_a X=(\tilde{\mathcal D}_a X^c)^c$.

The transformation $A$ preserves the topological properties of the configuration determined by $\fxx$, $X$, and $\Delta$. In particular $CA_i(A\fxx, AX, A\Delta)=A(CA_i(\fxx, X, \Delta)$ for $i=1$ and 2. Furthermore, ${\rm area}(CA_i(A\fxx, AX, A\Delta))=|A|{\rm area}(CA_i(\fxx, X, \Delta))$, if $|A|>0$. This means that $\delta(A\fxx,AX)=|A|^{1/2}\delta(\fxx,X)$. It follows from the definition of $\tilde{\mathcal D}_a$ that $\tilde{\mathcal D}_aAX=A\tilde{\mathcal D}_{|A|^{-1}a}X$, or that $\tilde{\mathcal D}_aA=A\tilde{\mathcal D}_{|A|^{-1}a}$. The result for $\tilde{\mathcal E}_a$ follows from the result for $\tilde{\mathcal D}_a$ and the relations $AX^c=(AX)^c$ and $\tilde{\mathcal E}_a X=(\tilde{\mathcal D}_a X^c)^c$.
\end{proof}

We have defined the operators $\tilde{\mathcal D}_a$ and $\tilde{\mathcal E}_a$ on all subsets of $\RR^2$, but it turns out that $\tilde{\mathcal E}_a$ maps many sets to $\emptyset$ and $\tilde{\mathcal D}_a$ maps many sets to $\RR^2$. This is shown by the next result.

\begin{proposition}For any $X\subset\RR^2$, $\tilde{\mathcal E}_aX=\tilde{\mathcal E}_aX^\circ$ and $\tilde{\mathcal D}_aX=\tilde{\mathcal D}_a\overline{X}$, where $X^\circ$ denotes the interior of $X$ and $\overline{X}$ denotes the closure of $X$.
\end{proposition}
\begin{proof}We will first prove the result about $\tilde{\mathcal E}_a$. Since $\tilde{\mathcal E}_a$ is monotone, $\tilde{\mathcal E}_aX^\circ\subset\tilde{\mathcal E}_aX$. Now, $\fxx\in\tilde{\mathcal E}_aX$ if and only if $\delta(\fxx,X^c)>a^{1/2}$. By the definition, $\delta(\fxx,Y)=\delta(\fxx,\overline{Y})$, so $\fxx\in\tilde{\mathcal E}_aX$ if and only if $\delta(\fxx,\overline{X^c})>a^{1/2}$. Since $\overline{X^c}=(X^\circ)^c$, this means that $\delta(\fxx,(X^\circ)^c)>a^{1/2}$, which proves that $\fxx\in\tilde{\mathcal E}_aX^\circ$. That $\tilde{\mathcal D}_aX=\tilde{\mathcal D}_a\overline{X}$ follows from the two identities $\tilde{\mathcal E}_a X=(\tilde{\mathcal D}_a X^c)^c$ and $((X^c)^\circ)^c=\overline{X}$.
\end{proof}

This result means that affine erosion erases all boundary points. It also means that $\tilde{\mathcal E}_aX=\emptyset$ if $X^\circ=\emptyset$ and that 
$\tilde{\mathcal D}_aX=\RR^2$ if $X$ is dense in $\RR^2$. If we let $X_i^\circ$, $i\in I$, denote the connected components of $X^\circ$, then the $\tilde{\mathcal E}_aX_i^\circ$ are disjoint $\tilde{\mathcal E}_aX^\circ=\bigcup_{i\in I} \tilde{\mathcal E}_aX_i^\circ$. 

We have not said so explicitly, but it should be clear that $\tilde{\mathcal E}_a(X+\fxb)= \tilde{\mathcal E}_aX+\fxb$ and $\tilde{\mathcal D}_a(X+\fxb)= \tilde{\mathcal D}_aX+\fxb$ for any fixed $\fxb\in\RR^2$, which means that these operators are translation invariant. Since these operators are also monotone, and since $\tilde{\mathcal D}_a\RR^2=\tilde{\mathcal E}_a\RR^2=\RR^2$, we can use Theorem 7.1 (Matheron) to represent them in the form
\[
\mathcal T X=\bigcup_{B\in\mathcal B}\bigcap_{\fxy\in B}(X-\fxy)=\{\fxx\mid\fxx+B\subset X \text{ for some }B\in\mathcal B\},
\]
where $\mathcal B=\{X\mid 0\in\mathcal TX\}$. The task reduces to characterizing the set of structuring elements $\mathcal B$. We know that 
$0\in\tilde{\mathcal E}_aX$ if and only if $\tilde{\mathcal E}_aX\not=\emptyset$ and $\delta(0,X^c)>a^{1/2}$, and this, and the results stated above, lead to the following definition.

\begin{definition}A set $B$ is an affine structuring element if $B$ is open and connected, $0\in B$, and $\delta(0,B^c)>1$. We denote the set of all affine structuring elements by $\mathcal B_{\rm aff}$.
\end{definition}

If $A$ is a linear affine transformation and $B$ is an affine structuring element, then $\delta(0,(AB)^c)=\delta(0,AB^c)=|A|^{1/2}\delta(0,B^c)$, and $AB$ is a structuring element if $|A|^{1/2}\geq1$. In particular, $A\mathcal B_{\rm aff}=\mathcal B_{\rm aff}$ for all $A\in SL(\RR^2)$.

\begin{proposition}For every set $X\subset\RR^2$,
\[
\tilde{\mathcal E}_a X=\bigcup_{B\in\mathcal B_{\rm aff}}\bigcap_{\fxy\in a^{1/2}B}(X-\fxy)=\{\fxx\mid\fxx+a^{1/2}B\subset X \text{ for some }B\in\mathcal B_{\rm aff}\}.
\]
\end{proposition}

\begin{proof}By Proposition 12.5 and the remark following it, we know that 
\[
\tilde{\mathcal E}_aX=\tilde{\mathcal E}_aX^\circ=\bigcup_{i\in I} \tilde{\mathcal E}_aX_i^\circ.
\]
This means that we may assume that $X$ is open and connected. The result then follows almost directly from Matheron's theorem. We need only check the scaling. Take $a=1$. Then $0\in\tilde{\mathcal E}_1X$ if and only if $\tilde{\mathcal E}_1X\not=\emptyset$ and $\delta(0,X^c)>1$, so by definition the set of structuring elements for $\tilde{\mathcal E}_1$ is $\mathcal B_{\rm aff}$. The structuring elements for $\tilde{\mathcal E}_a$ are the sets $\{X\mid 0\in\tilde{\mathcal E}_aX\}$. These are just the sets for which $\delta(0,X^c)>a^{1/2}$, which are exactly the sets $a^{1/2}B$, $B\in\mathcal B_{\rm aff}$.
\end{proof}

There is another way to characterize an affine structuring element $B$ that is perhaps more geometric. The condition $\delta(0,B^c)>1$, implies, by definition of $\delta$, that for any straight line $\Delta$ through the origin, the two connected components of $\RR^2\setminus(B^c\cup\Delta)(=B\setminus\Delta)$ that contain the origin in their boundary, $CA_1(0,\Delta, B^c)$ and $CA_2(0,\Delta, B^c)$, satisfy the relation $1<\delta(0,B^c)\leq CA_1(0,\Delta, B^c) \leq CA_1(0,\Delta, B^c)$. This means that all chord-arc sets defined by $B$ and $\Delta$, where $\Delta$ contains the origin, have area greater than some $b>1$. 

Conversely, if we assume that, for any $\Delta$ through the origin, the two connected components of $B\setminus\Delta$ that have the origin in their boundaries have areas greater than some $b>1$, then $\delta(0,B^c)>1$. 

This gives us an equivalent definition for the affine structuring elements: \textit{A set $B$ is an affine structuring element if it is open, connected, and contains the origin, and if, for every straight line $\Delta$ through the origin, the two connected components of $B\setminus\Delta$ that contain the origin in their bondary each have area greater than some number $b>1$, where $b$ depends only on $B$.} (See Figure \ref{figure_structuring_element}.)

\begin{figure}[!t]
\setkeys{Gin}{width=7cm}
\centerline{
\includegraphics{fig12.02.1.eps}
}
\caption[An affine structuring element]{An affine structuring element: All lines through $0$ divide $B$ into several connected components. The two of them which contain $0$ in their boundary have area larger or equal to $b$.}
\label{figure_structuring_element}
\end{figure}

It might seem that $\tilde{\mathcal E}_aX$ could be obtained from $X$ by removing all chord-arc sets $C$ defined by $X$ and $\Delta$ that have area less than or equal to $a$, but this is not quite the case. Nevertheless, from the practical numerical point of view, this is a way to perform an affine erosion. To have this idea mathematically correct, it is necessary to make some assumptions. Recall that affine erosion removes all of the boundary points of a set $X$, and this is not necessarily because these points are in a chord-arc set with small area, but because a boundary point is in $\overline X$ and thus, by the definition of affine distance, $\delta(x,X^c)=0$. This leads us to assume that $X$ is open, and from the results above, we may as well assume that $X$ is also connected. We will also assume that $X$ is bounded, which is surely true in practice. Even with these assumptions, removing small chord-arc sets defined by $X$ and lines $\Delta$ will not complete the erosion. A simple example is given by taking $X$ to be an open disk, say, $D(0,1)$. Removing all chord-arc sets with area less than or equal to $a$, for a small $a$, will leave a closed disk $D(0,r)$, whereas $\tilde{\mathcal E}_a D(0,1)$ is the open disk $D(0,r)$. The point is that removing small chord-arc sets can miss some points, but since these points are always in $\Delta$, we need only make a small modification. Thus, if $C$ is a chord-arc set defined by $X$ and $\Delta$, define $C^*$ by          
$C^*=C\cup({\overline C}\cap\Delta)$. Then we have the following result.

\begin{proposition}Assume that $X$ is open, connected, and bounded. Then $\tilde{\mathcal E}_aX$ can be obtained from $X$ by removing all of the sets $C^*$, where $C$ is a chord-arc set defined by $X$ and $\Delta$ that has area less then or equal to $a$.
\end{proposition}

\begin{proof}Let $C$ be any chord-arc set defined by $X$ and a line $\Delta$
such that ${\rm area}(C)\leq a$. Then we claim that $\fxx\in C^*$ implies that $\delta(\fxx, X^c)\leq a^{1/2}$. To see this, let $\Delta'$ be the line parallel to $\Delta$ that contains $\fxx$. The lines $\Delta$ and $\Delta'$ each define two open half-planes, which we denote by $R$ and $L$ and $R'$ and $L'$. Without loss of generality, we may assume that $\Delta'\subset R$, or equivalently, that $\Delta\subset L'$. (See Figure \ref{erosionaffinefacilefigure}.)

Consider the sets $CA_i(\fxx,\Delta',X^c)$, $i=1,2$. These are the connected components of $\RR^2\setminus({\overline{X^c}}\cup\Delta')=({\overline{X^c}})^c\cap(\Delta')^c=X^\circ\setminus\Delta'$ that contain $\fxx$ in their boundaries. One of these sets, say, $CA_1(\fxx,\Delta',X^c)$ is in $R\cap R'$. Now ${\overline{CA_1(\fxx,\Delta',X^c)}}\cap C\not=\emptyset$, since both sets contain $\fxx$. This means that ${CA_1}(\fxx,\Delta',X^c)\cup C$ is connected, and since $C$ was a maximal connected set in $X\setminus\Delta$ we conclude that $CA_1(\fxx,\Delta',X^c)\subset C$. Thus the area of $CA_1(\fxx,\Delta',X^c)$ is less than or equal to $a$, so $\delta(\fxx,X^c)\leq a^{1/2}$, and $\fxx\not\in\tilde{\mathcal E}_aX$.

For the converse, we must show that if a point was eroded, then it had to have been in a set $C^*$, where $C$ is a chord-arc set with area less than or equal to $a$. Our proof uses a result that we prove in the next exercise, namely, that if $\delta(x,X^c)\leq a^{1/2}$, then there is a line $\Delta$ that contains $\fxx$ such that $\delta(x,X^c)=[{\rm area}(C)]^{1/2}$, where $C$ is a chord-arc set defined by $X$ and $\Delta$. Then for this $C$,   $\fxx\in C^*$ and ${\rm area}(C)\leq a$.
\end{proof}

\begin{figure}[!t]
\setkeys{Gin}{width=5cm}
\centerline{
\includegraphics{fig12.03.1.eps}
}
\caption[Illustration of the Corollary \ref{erosionaffinefacile}]{\label{erosionaffinefacilefigure} Illustration for Proposition 12.8.}
\end{figure}

\begin{exercise}Assume that $X$ is open and bounded, and, since the argument involves only one component of $X$, assume that $X$ is connected. We refer to Figure \ref{figdef} below for the definitions of the various objects. Thus, $\Delta(0)$ is an arbitrary line that contains $\fxx$ and $C(0)$ is the connected component of $X\setminus\Delta(0)$ on the arrow-side of $\Delta(0)$ whose boundary contains $\fxx$. $C(\varphi)$ is the connected component of $X\setminus\Delta(\varphi)$ on the arrow-side of $\Delta(\varphi)$ whose boundary contains $\fxx$. Since $X$ is open, there is an $r>0$ such that the disk $D(x,r)$ is contained in $X$; since $X$ is assumed to be bounded, there is an $R>0$ such that $X\subset D(x,R)$.
 
\begin{figure}[!h]
\setkeys{Gin}{width=10cm}
\centerline{
\includegraphics{fig12.04.1.eps}
}
\caption[Definition of $C(0,\varphi)$]{\label{figdef}Definition of $C(0,\varphi)$. The set $C(0,\varphi)$ is the connected component of $X\setminus (\Delta(0)\cup\Delta(\varphi))$ that lies in the direction of the arrows. 
}
\end{figure}
\begin{enumerate}[(i)]\setlength\itemsep{2pt}
\item Show that $C(0,\varphi)\subset C(0)$ and $C(0,\varphi)\subset C(\varphi)$. 
\item Show that ${\rm area}(C(0)\cup C(0,\varphi)^c)\to0$ as $\varphi\to0$ and similarly that ${\rm area}(C(\varphi)\cup C(0,\varphi)^c)\to0$ as $\varphi\to0$.
\item Deduce that ${\rm area}(C(\varphi))\to{\rm area}(C(0))$ as $\varphi\to0$.
\end{enumerate}
This shows that ${\rm area}(C(\varphi))$ is a continuous function of $\varphi$. Thus, the $\inf_{\Delta(\varphi)}{\rm area}(C(\varphi))$ is attained, which means that for every $\fxx\in X$ there is some $\varphi$ such that $\delta(\fxx,X^c)=[{\rm area}(C(\varphi))]^{1/2}$. \finex
\end{exercise}

\begin{exercise}The aim of this exercise is to prove that a one-to-one mapping $\tilde A:\RR^2\to\RR^2$ that preserves parallelism must be of the form $\tilde A(\fxx)=A\fxx+\fxb$, where $A$ is a linear mapping and $\fxb$ is a fixed vector. The preservation of parallelism is defined as follows: If any four points $\fxx_1$, $\fxx_2$, $\fxx_3$, and $\fxx_4$ satisfy $\fxx_1-\fxx_2=\lambda(\fxx_3-\fxx_4)$ for some $\lambda\in\RR$, then there exists a $\mu\in\RR$ such that ${\tilde A}\fxx_1-{\tilde A}\fxx_2=\mu({\tilde A}\fxx_3-{\tilde A}\fxx_4)$.
\begin{enumerate}[(i)]\setlength\itemsep{2pt}
\item Let ${\bm i}$ and ${\bm j}$ be the usual orthonormal basis for $\RR^2$ and write $\fxx=x{\bm i}+y{\bm j}$. Define $A$ by $A\fxx={\tilde A}\fxx-{\tilde A}0$. Show that there are two real function $\mu_i:\RR\to\RR$, $i=1,2$, such that $A(x{\bm i})=\mu_1(x)A{\bm i}$ and $A(y{\bm j})=\mu_2(y)A{\bm j}$.
\item Notice that $A$ preserves parallelism and that $A0=0$.
\item Show that $A\fxx=\mu_1(x)A{\bm i}+\mu_2(y)A{\bm j}$.
\item Show that $\mu_1(\lambda)=\mu_2(\lambda)$.
\item We wish to show that $\mu_1(x)=x$. One way to do this is to prove that $\mu_1:\RR\to\RR$ is an isomorphism. This can be done using the fact that $\fxx_1-\fxx_2=\lambda(\fxx_3-\fxx_4)$ implies that $A\fxx_1-{A}\fxx_2=\mu({ A}\fxx_3-{A}\fxx_4)$. Once you have shown that $\mu_1:\RR\to\RR$ is an isomorphism, you can quote the result that says any isomorphism of $\RR$ onto itself must be $x\mapsto x$, or you can prove this result. \finex
\end{enumerate}
\end{exercise}



\section{Comments and references} 

Shape-recognition algorithms in the plane are clearly more robust if they are affine invariant, if only because most optical devices that copy plane images (photocopiers) or that convert plane images to digital information (scanners, faxes) create a slight affine distortion. Also, all diffeomorphisms are locally affine. Affine-invariant techniques for matching shapes are described in \cite{Hummel:1988:AIM}; discussions of the role of affine and projective invariance for object recognition can be found in \cite{Bose:1996:MBO}, \cite{Weiss:1995:LPA}, and \cite{Kempenaers:1991:SRU}. Corners and T-junctions can appear in images with arbitrary angles, and the detection of angles between straight lines should be affine invariant. Algorithms for affine-detection of angles are proposed in \cite{Blom:1992:AIC}, \cite{Alvarez:1997:AMM}, \cite{Vasselle:1994:FCC}, and \cite{Deriche:1993:CAC}. See Merriman, Bence, and Osher \cite{Merriman:1994:MMJ} for a very original numerical view for filtering multiple junctions. Because of the relevance to computer vision, there has been considerable research devoted to looking for affine-invariant definitions of classical concepts in  
geometric measure theory and integral geometry. An interesting attempt to define an ``affine-invariant length'' and an ``affine-invariant dimension'' analogous to Hausdorff lengths and dimensions is given in \cite{Dibos:1996:ALA}. The diameters of the sets of a Hausdorff covering are simply replaced by their areas. Several attempts to define affine-invariant analyses of discrete sets of points are described in \cite{Geraets:1995:ASS} and \cite{Sapiro:1997:SSC}. An affine-invariant symmetry set (skeleton) for shapes is defined in \cite{Giblin:1997:AIS}; the 1/3 power law of planar motion perception and generation is related to affine invariance in \cite{Pollick:1997:CAV}. Some of the techniques on affine erosions and dilations presented in this chapter were announced in \cite{Lisani:2000:AIM}. We have made liberal use of the Matheron formalism for monotone set operators \cite{Matheron:1975:RSI}.  
















