This problem arose in my stereo vision project.
I have two matrix equations:
$$\left( \begin{array}{ccc} x_1.w_1 \\ y_1.w_1\\ w_1 \end{array} \right) = \left( \begin{array}{ccc} A_{11} & A_{12} & A_{13} & A_{14} \\ A_{21} & A_{22} & A_{23} & A_{24} \\ A_{31} & A_{32} & A_{33} & A_{34} \end{array} \right) * \left( \begin{array}{ccc} X \\ Y \\ Z \\ 1 \end{array} \right)$$
$$\left( \begin{array}{ccc} x_2.w_2 \\ y_2.w_2\\ w_2 \end{array} \right) = \left( \begin{array}{ccc} B_{11} & B_{12} & B_{13} & B_{14} \\ B_{21} & B_{22} & B_{23} & B_{24} \\ B_{31} & B_{32} & B_{33} & B_{34} \end{array} \right) * \left( \begin{array}{ccc} X \\ Y \\ Z \\ 1 \end{array} \right)$$
$x_{1}$,$y_{1}$,$x_{2}$,$y_{2}$ and all $A_{ij}$ and $B_{ij}$ are know scalars. Find the best-fit to $X$,$Y$,$Z$ (in a least squares sense).
I should point out that I don't know the values of $w_1$ and $w_2$, otherwise this would be the same question as in my other question (I accidentally poorly-defined my problem in that one).
The answer to the above problem is in here (page 6), but in the way described in the link it would be necessary to compute the matrix inversions every time, when $X$,$Y$ and $Z$ changes. I would like to know how to write the solution to the above problem in the following way:
$$\left( \begin{array}{ccc} X \\ Y \\ Z \\ 1 \end{array} \right) = U*\left( \begin{array}{ccc} x_{1} \\ y{1} \\ 1 \\ x_{2}\\ y_{2} \\ 1 \end{array} \right)$$ (or in some similar form)
Where the matrix U does not depend on the values of $x_{1}$,$y_{1}$,$x_{2}$,$y_{2}$.