4

I was wondering, if there is a projection matrix for a perspective projection of a 2D point to a line.

E.g. a random point being projected to the line at $x=1$, parallel to the y axis in the direction of the origin $(0,0)$.

I know that the easiest way to compute this would be to solve the linear equation at $x=1$ (or the intersection of the lines), but isn't there be a matrix based solution too?

To be concrete: I'm looking for a matrix $A$, that solves the equation $x \rightarrow Ax$ with $A\in \mathbb{R}^{3\times3} $

x=1 as example


To conclude Emilios answer below, the matrix I was looking for can be written as $$x\rightarrow Ax,\text{with }A= \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ \frac{1}{\text{intercept}_x} & \frac{1}{\text{intercept}_y} & 0 \end{bmatrix} $$

Corbie
  • 163
  • I do not understand what you're looking for, could you perhaps add a sketch? Is it correct that you are given a line $ax+by+d=0$ and a point $(u,v)$ and you want to know what point on the line corresponds to the orthogonal projection of $(u,v)$ onto the line? – flawr Apr 01 '16 at 15:42
  • I have expanded my question to be more precise, although Emilios answer below is exactly what I am looking for. – Corbie Apr 02 '16 at 13:20

1 Answers1

1

If I well understand your question, the answer can be done using homogeneous coordinates.

Given a point $P=(a,b)$, his homogeneous coordinates are $P=[a,b,1]^T\equiv [ca,cb,c]^T$ ( see here for a definition).

using this the projection from the origin on the line $x=1$ can be represented by the matrix: $$A= \begin{bmatrix} 1&0&0\\ 0&1&0\\ 1&0&0 \end{bmatrix} $$ that gives: $$ \begin{bmatrix} 1&0&0\\ 0&1&0\\ 1&0&0 \end{bmatrix} \begin{bmatrix} a\\ b\\ 1 \end{bmatrix}= \begin{bmatrix} a\\ b\\ a \end{bmatrix}\equiv \begin{bmatrix} 1\\ b/a\\ 1 \end{bmatrix} $$


For any $P=(a,b)$, the straight line from $O$ to $P$ has equation $y=\frac{b}{a}x$, so the point $P'$ of this line with $x=1$ has coordinates $P'=(1,\frac{b}{a})$

So, in homogeneous coordinates, the two points are represented as: $$ P=\begin{bmatrix} a\\ b\\ 1 \end{bmatrix} \qquad P'=\begin{bmatrix} 1\\ b/a\\ 1 \end{bmatrix}=\begin{bmatrix} a\\ b\\ a \end{bmatrix} $$ and a simple inspection show that the matrix that transforms $P \to P'$ is the matrix $A$

Emilio Novati
  • 62,675