\documentstyle[12pt,fullpage,epsfig]{article}

\newcommand{\lecturetitle}[4]{
  \noindent
  CS 280, Computer Vision (Prof. Jitendra Malik) \hfill #3\\
  Lecture \##1 (#2) \hfill {\bf DRAFT} Notes by #4\\[-.05in]
  \mbox{}\hrulefill \mbox{}\\}
\newtheorem{theorem}{Theorem}

\begin{document}

% MODIFY THE FOLLOWING TO INCLUDE THE LECTURE #, TOPIC, DATE, and YOUR NAME
\lecturetitle{10}{Stereo Disparity, Euclidean and Affine Transformation}{Feb 24, 1999}{Yan Chen}

% INCLUDE AN OUTLINE OF THE CLASS TOPICS
\begin{itemize} 
  \item Properties of Vieth-Muller Circle

  \item Calculating Stereo Disparity

  \item Euclidean Transformation

  \item Affine Transformation
\end{itemize}

% THE NOTES WILL GO HERE

\section{Stereo Disparity}

\subsection{Properties of Vieth-Muller Circle}

We can define the following properties for given Vieth-Muller Circle

\begin{enumerate}
\item If the eye movement is a pure version eye movement, the fixation point stays on the same Vieth-Muller Circle. 
As in Figure.~\ref{vm1}, the fixation point $P$ moves to $P'$.
\item Now keeping the fixation point, we study disparity for various points.
Disparity is defined as $\phi_R$ - $\phi_L$.  See Figure.~\ref{vm1}.
\end{enumerate}

\begin{theorem}
If point $Q$ is on Vieth-Muller Circle, its disparity is zero.
\end{theorem}

As $Q$ moves out (e.g. point $P$ moves to point $Q$ in Figure.~\ref{vm1}), $\phi_L$ gets smaller and $\phi_R$ gets larger and vice versa if $Q$
moves in. 

\begin{theorem}
Disparity is non-zero outside/inside Vieth-Muller Circle (with opposite sign for outside/inside).
\end{theorem}

For human vision system, when the disparity is very large, you will see double 
objects (one from left eye and the other from right eye).
It is called {\em Diplopia}.
The maximum disparity without diplopia is termed as {\em Panum's Fusional Limit}.

\begin{figure}
\begin{center}
\epsfig{file=vm1.eps}
\end{center}
\caption{\em Disparity Properties on Vieth-Muller Circle}
\label{vm1}
\end{figure}

\subsection{Calculating Disparity} 

In Figure.~\ref{vm2}, $\phi_L$ and $\phi_R$ are made by line of sight with the
straight ahead direction.\\
We define {\em Gaze Angle} $\gamma = \frac{1}{2}(\phi_L + \phi_R)$, \\ 
define {\em Vergence Angle} $\mu = \frac{1}{2}(\phi_L - \phi_R)$. $CE$ is the cyclopean eye. \\

\begin{figure}
\begin{center}
\epsfig{file=vm2.eps}
\end{center}
\caption{\em Calculating the Disparity}
\label{vm2}
\end{figure}

Horizontal Disparity $$h = \frac{Icos\gamma}{d}(\frac{\delta}{d+\delta} + \frac{dtan\gamma}{d+\delta}x + x^2)$$ \\

Vertical Disparity $$v = \frac{Icos\gamma}{d}(\frac{dtan\gamma}{d+\delta}y + xy)$$ \\
where ($x$, $y$) are cyclopean image coordinates, $x = X/Z$, $y = Y/Z$, $Z = d + \delta$, $I$ is the interocular distance.  So the coordinate system changes with the cyclopean eye.

\begin{theorem}
$d = I cos\gamma / sin 2\mu$
\end{theorem}

We have a simple justification for $\gamma$ = 0, see Figure.~\ref{justify}.

\begin{figure}
\begin{center}
\epsfig{file=justify.eps}
\end{center}
\caption{\em Simple Justification}
\label{justify}
\end{figure}

$I/2 = d \times sin\mu \times cos\mu$ $\Rightarrow$ $d = I cos\gamma / sin 2\mu$ \\

The image transformed from the left eye to the right eye can be modeled as an 
euclidean transformation with translation vector $t$ and rotation vector $\omega$: \\

$$t = [\matrix {t_x & 0 & t_z} ] 
= I[ \matrix {cos \gamma & 0 & sin \gamma} ] $$ \\
$$\omega = [\matrix{\omega_x & \omega_y & \omega_z}] 
= [\matrix {0 & -2\mu & 0}] 
= [\matrix {0 & \frac{-I cos\gamma}{d} & 0}] $$ \\

After plugging the above equation into the optical flow equation, we have \\
\begin{equation}
u(x, y) = [-\frac{t_x}{Z(x,y)} - \omega_y + \omega_z y] - x[-\frac{t_Z}{Z(x,y)} - \omega_x y + \omega_y x]  \\
= - \frac{I \times cos\gamma}{d + \delta} + \frac{I \times cos\gamma}{d} + \frac{x \times sin\gamma}{d + \delta} + \frac{I \times cos\gamma}{d} x^2
\end{equation}

So it is the same as horizontal disparity $h$.  Similarly, we can verify for the vertical disparity.
It is easy to see that when $\gamma$ and $x$ are zero and $\delta \ll d$, we have the special case as we discussed in the lecture before.

$$ h = -\frac{I}{d+\delta} + \frac{I}{d} = \frac{I\delta}{d(d+\delta)} \doteq \frac{I\delta}{d^2} $$

\section{Euclidean, Affine and Projective Transformations}

Euclidean transformation, which is rotation \/reflection, followed by translation, can be modeled as $x' = R x + d$, where $R$ is an orthogonal matrix.
Under Euclidean transformation, lengths, angels and areas are preserved. 
Also Euclidean transformation is closed under composition. \\

Affine transformation can be expressed by $x' = A x + d$, where $A$ is any non-singular matrix. 
So Euclidean transformation is a subset of affine transformation, similarly,
affine transformation is a subset of projective transformation.  
We will come to that in the next lecture. \\

Let us count the Degree Of Freedom (DOF) for Euclidean transformation and affine transformation mapping between $n$ dimension of space.
>From $R^1 \mapsto R^1$, Euclidean transformation has 1 DOF, affine transformation has 1+1=2 DOF.
>From $R^2 \mapsto R^2$, Euclidean transformation has 2+1=3 DOF, affine transformation has 4+2=6 DOF.
>From $R^1 \mapsto R^1$, Euclidean transformation has 3+3=6 DOF, affine transformation has 9+3=12 DOF.  \\

We also can think affine transformation as a generalized linear transformation.
So any linear composition of $x$, $y$ will be mapped to linear composition of $X$, $Y$ with the same coefficient as in the following formula:

If $x \mapsto X$ and $y \mapsto Y$ then $\lambda x + (1-\lambda) y \mapsto \lambda X + (1-\lambda) Y$. \\

Unlike Euclidean transformation, lengths, angels and areas are not preserved under affine transformation.
Relationship of parallelism and relationship of middle-point, or more generally, ratio on the length are invariants under affine transformation.
For example, if $C$ is a point on line $AB$, then $|AC|/|CB| = |f(A)f(C)| / f(C)f(B)|$.
Besides, incidence is also preserved under affine transformation, e.g., if a point $A$ is on line $l_1$, then after affine transformation, it is still on line $l_1$.
\end{document}
