% --------------------------------------------------------------
% This is all preamble stuff that you don't have to worry about.
% Head down to where it says "Start here"
% --------------------------------------------------------------
 
\documentclass[11pt]{article}
 
\usepackage[margin=1in]{geometry} 
\usepackage{amsmath,amsthm,amssymb}
 
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
 
\newenvironment{theorem}[2][Theorem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{lemma}[2][Lemma]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{exercise}[2][Exercise]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{reflection}[2][Reflection]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{proposition}[2][Proposition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{corollary}[2][Corollary]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
 
\begin{document}
 
% --------------------------------------------------------------
%                         Start here
% --------------------------------------------------------------
 
%\renewcommand{\qedsymbol}{\filledbox}
 
\title{HW1}%replace X with the appropriate number
\author{Srikumar Ramalingam\\ %replace with your name
CS 6320 - 3D Computer Vision\\
Due: 11:59 PM on 01/29/2017} %if necessary, replace with your
\date{}
 
\maketitle

\noindent
Please submit a zip file containing a PDF document (solutions to the problems) and a PLY file (3D model). 

\begin{enumerate}
\item Let us consider a car moving on a highway with four lanes. Show that the three parallel lane marking lines on the road intersect at a single point on the image captured by a car mounted camera. Let the origin of the camera be given by O$(0,0,0)$. The image resolution is $640 \times 480$ and the principal point is given by $(320,240)$. We assume the following parameters for the camera: 

\begin{equation}
\left(
         \begin{array}{c}
         u \\
         v \\
				 1
         \end{array}
\right )
\sim
\left(
\begin{array}{cccc}
  200 & 0   & 320 & 0 \\
  0   & 200 & 240 & 0 \\
  0   & 0   & 1   & 0
\end{array}
\right )
\left (
\begin{array}{cc}
  \mathsf{I}      & \mathbf{0} \\
  \mathbf{0}^T & 1
\end{array}
\right )
\left ( \begin{array}{c} X^m \\ Y^m \\ Z^m \\ 1 \end{array} \right )
\label{eq.projection}
\end{equation}
where $(u,v)$ correspond to pixel coordinates and $\mathsf{I}$ denotes the $3\times 3$ identity matrix. We use two 3D points (in some units, say meters) to represent a 3D line. The three parallel 3D lines ${\cal L}_1,{\cal L}_2$, and ${\cal L}_3$ are shown below:
\begin{equation}
{\cal L}_1
\{     
\left(
\begin{array}{c}
-10 \\
-10 \\
10
\end{array}
\right),
\left(
\begin{array}{c}
-10 \\
-10 \\
20
\end{array}
\right)
\},
{\cal L}_2
\{     
\left(
\begin{array}{c}
0 \\
-10 \\
 10
\end{array}
\right),
\left(
\begin{array}{c}
0 \\
-10 \\
 20
\end{array}
\right)
\},
{\cal L}_3
\{     
\left(
\begin{array}{c}
10 \\
-10 \\
10
\end{array}
\right),
\left(
\begin{array}{c}
10 \\
-10 \\
20
\end{array}
\right)
\}
\end{equation}
[25 points]

\item Let us consider the same camera model used in Question 1. Find the coordinates of two 3D points $A(X_1,Y_1,Z_1)$ and $B(X_2,Y_2,Z_2)$ that satisfy the following conditions:
\begin{itemize}
\item The projections of A and B on the image are given by $\mathbf{a}(120,240)$ and $\mathbf{b}(520,240)$, respectively.  
\item $OA = 100$ and $AB = 100\sqrt{2}$ [25 points].
\end{itemize}

\item Download the visual SFM software (http://ccwu.me/vsfm/). Create a 3D model using at least 25 images. The images can be obtained from the following sources:
\begin{itemize}
\item The images can be captured using your phone or any digital camera.
\item The images can also be downloaded from the web (Flickr, Google images). 
\end{itemize}
Submit the 3D model in PLY format, which can be visualized using \\ meshlab (http://www.meshlab.net/) [50 points]. 
\end{enumerate} 
\end{document}