1
$\begingroup$

This question already has an answer here:

Really struggling with a question on coursera robotics perception:

Find the projective transformation $A$ which will keep the points $\boldsymbol{p}_{1}=(0,0,1)$ and $\boldsymbol{p}_{2} = (1,1,1)$ fixed and will map point $\boldsymbol{p}_{3} = (1,0,1)$ to $\boldsymbol{p}_{3}'=(1,0,0)$ and point $\boldsymbol{p}_{4} = (0,1,1)$ to $\boldsymbol{p}_{4}' = (0,1,0)$?

The answer is the matrix: \begin{bmatrix}-1&0&0\\0&-1&0\\-1&-1&1\end{bmatrix}

The idea from my lectures is to take 4 points (3 of which are not collinear) and use that to solve the equation:

$$\alpha \boldsymbol{a} + \beta \boldsymbol{b} + \gamma \boldsymbol{c} = \boldsymbol{d}$$

where $\boldsymbol{a}, \boldsymbol{b}, \boldsymbol{c}$ and $\boldsymbol{d}$ are the vector coordinates of 4 points.

If I pick $\boldsymbol{p}_{1}'$, $\boldsymbol{p}_{3}'$, $\boldsymbol{p}_{4}'$ and $\boldsymbol{p}_{2}'$ as $\boldsymbol{a}, \boldsymbol{b}, \boldsymbol{c}$ and $\boldsymbol{d}$ respectively I get the incorrect matrix. As far as I can see the point $\boldsymbol{p}_{1}'$, $\boldsymbol{p}_{3}'$, and $\boldsymbol{p}_{4}'$ are not collinear.

The actual solution uses $\boldsymbol{p}_{1}$, $\boldsymbol{p}_{3}$, $\boldsymbol{p}_{4}$ and $\boldsymbol{p}_{2}$ as $\boldsymbol{a}, \boldsymbol{b}, \boldsymbol{c}$ and $\boldsymbol{d}$ respectively and calculates the matrix the other way round.

Essentially gets the matrix that maps from $\boldsymbol{p}'$ to $\boldsymbol{p}$ and then inverts it.

I have no idea why that works (Gives a better estimate to exact)

Completely confused as to how one choses the correspondence points.

The answer here gives an estimate that is way off: projective matrix

$\endgroup$

marked as duplicate by amd, Community Dec 23 '17 at 19:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ It really shouldn’t matter which three of each set of four points you take to construct the projectivity. If you want someone to point out where you’re going wrong, show more of your work instead of making us guess. $\endgroup$ – amd Dec 22 '17 at 21:03
  • $\begingroup$ See math.stackexchange.com/a/339033/265466 for a good description of how to construct the transformation matrix. $\endgroup$ – amd Dec 22 '17 at 21:04
  • $\begingroup$ @amd Thanks, feel free to mark as duplicate to the link you provided. The linked solution worked! What I failed to understand is that you need to figure out mappings to and from the special "basis vectors" to and potentially your estimate might not also agree in scale factors (it was a multiple choice question, and my answer was incorrect, or rather correct, in terms of a negative scale factor). Thanks loads. $\endgroup$ – InKodeWeTrust Dec 23 '17 at 15:49
  • $\begingroup$ Glad that helped. Just to clarify my comment, you can use any three pairs of coordinates for the derivation, but you do have to keep them matched up on both sides. $\endgroup$ – amd Dec 23 '17 at 18:39