\documentstyle[12pt,fullpage,psfig]{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{}\\}

\begin{document}

% MODIFY THE FOLLOWING TO INCLUDE THE LECTURE #, TOPIC, DATE, and YOUR NAME
\lecturetitle{4}{The Effect of Projection on Curved Surfaces}{Feb. 1, 1999}{Hector Magno}

% INCLUDE AN OUTLINE OF THE CLASS TOPICS
\begin{itemize} 
  \item The definition of the derivative

  \item The definition of the directional derivative

  \item The effect of perspective projection on curved surfaces

  \item An introduction to isometrics
\end{itemize}

% THE NOTES WILL GO HERE

\section{The definition of the derivative}

Define $Df$ to be the derivative of a given function $f$.  $Df$ is the ``best local linear 
approximation'' to $f$.  If $f$ is a vector valued function of a vector valued argument such that
$\vec{f}: R^n \Rightarrow R^m$, then $D\vec{f}$ is a linear function from $R^n$ to $R^m$ even if $\vec{f}$ 
itself is not linear.  As a result, $D\vec{f}$ can be represented as an $m*n$ matrix whose elements
 are the partial derivatives of $\vec{f}$.\\
\\
example:\\
define $\vec{f} : R^2 \Rightarrow  R^3$ such that $\vec{f} = 
\left[\matrix{f_1(x,y)\cr f_2(x,y)\cr f_3(x,y)}\right] e.g. 
\left[\matrix{2xy+3\cr x^2\cr y}\right]$
\\
\\
\\
$D\vec{f} = \left[\matrix{\delta f_1/\delta x&\delta f_1/\delta y\cr \delta f_2/\delta x&
\delta f_2/\delta y\cr \delta f_3/\delta x&\delta f_3/\delta y}\right] e.g. 
\left[\matrix{2y&2x\cr 2x&0\cr 0&1}\right]$
\\

\section{The definition of the directional derivative}

The directional derivative of $\vec{f}$ in the direction $\vec{v}$ is given by $(D\vec{f})\vec{v}$, the
result of simple matrix multiplication.  Hence, in the example above, to compute the directional 
derivative in the direction (1, 0), simply multiply $D\vec{f}$ and $\vec{v}$  as shown below:\\
\\
$(D\vec{f})\vec{v} = \left[\matrix{2y&2x\cr 2x&0\cr 0&1}\right]
\left[\matrix{1\cr 0}\right] = \left[\matrix{2y\cr 2x\cr 0}\right]
$
\\
\\
\\
{\bf NOTE:} Now the shape operator and curvature can be more precisely defined in terms of derivatives and 
directional derivatives.  The surface normal $\vec{N}$ can be used as a function that maps from
$R^2$ to $R^3$, that is, from the 2D coordinates that result from the parametrization of the 
surface to the 3D world coordinates.  $D\vec{N}$, the derivative of $\vec{N}$, defines the shape of the
 surface and $(D\vec{N})\vec{v}$, the directional derivative of $\vec{N}$, defines its curvature.


\section{The effect of perspective projection on curved surfaces}

\begin{figure}
\centerline{\psfig{file=lec4.eps,height=3in}}
\caption{Illustration}
\label{surface}
\end{figure}

Define $F(\vec{p})$ such that $\vec{F}: \vec{E} \Rightarrow \vec{S}$.  In other words, $F$ is a back projection function, a function
that maps coordinates on the viewing sphere to the surface in the world.  Let $r(\vec{p})$ be a 
function that returns the distance between the point on the viewing sphere and the point on the 
surface which are both hit by a ray going in the direction of $\vec{p}$ starting at the view point, as shown above.  It follows that $F(\vec{p}) = r(\vec{p})\vec{p}$.\\
\\
{\bf GOAL:} We will study the properties of $F_*$, the derivative of $F$, to help us understand the 
effect of perspective projection on a curved surface.\\
\\
Notice that because $F$ maps coordinates from one surface to another, it maps from $R^2$ to $R^2$.  
As a result, $F_*$ can be represented by a $2*2$ matrix.  To find the values of this matrix, it is 
helpful to define two local 3D coordinate systems, one centered on the intersection of the viewing
sphere $E$ with $\vec{p}$ and the other centered on the intersection of the surface $S$ with a ray going in the direction of $\vec{p}$:\\
\\
Define the $E$ coordinate system by making one of the axes point in the direction of $\vec{p}$.  
This direction is normal to the viewing sphere because the ray $\vec{p}$ starts at this sphere's
center.  Make another one of the axes point in the direction of $\vec{t}$, the tilt direction.  
Finally, make the last axis be perpendicular to the other two axes.\\
\\
Define the $S$ coordinate system by making one of the axes point in the direction of $\vec{N}$, 
its surface normal.  Make another one of the axes point in the direction of $\vec{T}$, the back 
projection of the tilt direction.  In other words, $\vec{T} = F(\vec{t}) / |F(\vec{t})|$.
Finally, make the last axis be perpendicular to the other two axes.\\
\\
Given that $r = r(\vec{p})$, $q =$ the slant (the angle between $\vec{N}$ and $\vec{p}$), 
and $\cos q = \vec{N}.\vec{p}$, the result is the following:
\\
$$F_* = \left[\matrix{r/\cos q&0\cr 0&r}\right]$$ 
\\
\\
This result still describes the derivative of a back projection, however.  To get the derivative of
a projection from the surface to the viewing sphere, we take the inverse of $F_*$ to get:\\
\\
$$F_*^-1 = \left[\matrix{(\cos q)/r&0\cr 0&1/r}\right]$$ 
\\
\\
{\bf CONCLUSION:} The division by $r$ shows the fact that curved surfaces will appear smaller on the 
viewing sphere.  This is the scaling or shrinking effect.  The $\cos q$ factor shows the fact that the 
object will appear to get ``squished'' in the tilt direction.  This is the foreshortening effect.
\\

\section{An introduction to isometrics}

Now that we have dealt with the effects of perspective projection on objects that are not moving, 
we can now focus on the properties of moving objects.  This is sometimes summed up as understanding
rotations and translations, and it involves topics such as rigid body motions, displacements,
euclidean motions, and isometrics.  Here, we begin with an introduction to isometrics.\\
\\
The definition of isometry is $|T(\vec{p}) - T(\vec{q})| = |\vec{p} - \vec{q}|$.  In 
other words, the distance between every point is preserved after a transformation $T$.  There are 
three examples of isometry:\\
\\
1. translation: $T(\vec{x}) = \vec{x} + a$\\
\\
2. rotation (in 2D): $\left[\matrix{x'\cr y'}\right] = 
\left[\matrix{\cos \theta&-\sin \theta\cr \sin \theta&\cos \theta}\right]
\left[\matrix{x\cr y}\right]$ \\
\\
\\
3. reflection (in 2D): $\left[\matrix{x'\cr y'}\right] = 
\left[\matrix{\cos \theta&\sin \theta\cr \sin \theta&-\cos \theta}\right]
\left[\matrix{x\cr y}\right]$ \\
\\
\\
{\bf NOTE:} Translation cannot be expressed as a matrix product because it is a not a linear
transformation.  If it were a linear transformation, then any $T(\vec{x})$ and $T(\vec{y})$, where $T$ is 
a translation, would be able to be expressed in the form $T(a\vec{x}+b\vec{y})$.  It can easily
be verified that this is not the case by applying the formula for translation above.\\
\\
An {\bf orthogonal transformation} is a linear transformation that preserves inner products such
that $T(\vec{x}).T(\vec{y}) = \vec{x}.\vec{y}$.  Because an orthogonal transformation is a linear 
transformation, it can be represented as a matrix multiplication, $T(\vec{x}) = A\vec{x}$.  The
matrix $A$ is called an {\bf orthogonal matrix} and it must satisfy $A^TA = I$ or $A^-$$^1 =  A^T$.

\end{document}

