For a school assignment, I have been asked to derive the homography in 2D that maps a given set of four points, $p_{i}$, to a another given set of four points, $q_{i}$.
My understanding is that this homography can be represented as a 3x3 matrix, $H$, s.t.:
$$Hp_{i}=\left[{\begin{array}{ccc}a & b & c\\d & e & f\\g & h & i\end{array}}\right]\left[{\begin{array}{c}x_{i} & y_{i} & 1\end{array}}\right]^{T}=\left[{\begin{array}{c}x_{i}^{'} & y_{i}^{'} & w_{i}\end{array}}\right]^{T}$$
where:
$$\left[\frac{x_{i}^{'}}{w_{i}},\frac{y_{i}^{'}}{w_{i}}\right]=q_{i}$$
when $p_{i}$ is represented in homogeneous coordinates.
However, this approach is giving me 12 equations in 13 unknowns.
If someone could tell me what I am doing wrong it would be appreciated.
Remember that homogeneous coordinates can be multiplied by any number and still represent the same point. Therefore, any multiple of the matrix will represent the same homography, because the outcome point will just be a multiple of the one you had before.
So you actually expect there to be a free variable in the answer, because you know that any nonzero multiple of the matrix represents the same homography.
Your 12 equations in 13 unknowns ought to give you a solution something like: $(a,b,c,d,e,f,g,h,i,w_1,w_2,w_3,w_4) = t(*,*,*,*,*,*,*,*,*,*,*,*,*)$ for some free variable $t$, where the stars represent numbers that you will figure out. So the first 9 coordinates of that vector will be the entries of your matrix.