<p>I have <a href="https://dev.intelrealsense.com/docs/depth-and-tracking-cameras-alignment" rel="nofollow noreferrer">Intel T265 camera</a> which has a camera coordinates system like following diagram:
<a href="https://i.sstatic.net/XGDt4.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XGDt4.jpg" alt="enter image description here" /></a></p>
<ul>
<li><p>The camera system has two cameras and the center of the two cameras is the position of the camera system.</p>
</li>
<li><p>The point of my interest is P, which is translated from the position of the camera system by <code>z0</code> along z axis, and <code>x0</code> along x axis.</p>
</li>
</ul>
<p>What I am given is a series of 4X4 (pose) matrices coming with the camera data looking like:</p>
<pre><code>    0.9988    0.0175   -0.0466         0
   -0.0195    0.9989   -0.0426         0
    0.0458    0.0434    0.9980         0
   -0.0064   -0.0015   -0.0026    1.0000
</code></pre>
<p>or</p>
<pre><code>   -0.1226    0.0055   -0.9924         0
   -0.0438    0.9990    0.0109         0
    0.9915    0.0448   -0.1223         0
   -0.2279   -0.0244    0.1860    1.0000
</code></pre>
<p>They look like homogenous matrix (following diagram) except that they are transposed version
<a href="https://i.sstatic.net/eNbrK.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eNbrK.jpg" alt="enter image description here" /></a></p>
<p>Now, I have a few questions about this 4x4 matrices:</p>
<ol>
<li>What is the position of the camera at each time point? Are they in these 4x4 matrices?</li>
<li>Where exactly is the world coordinates and how is it oriented?</li>
<li>How do I use these 4X4 matrices to find the projected position of point P in the world coordinates system?</li>
</ol>
<p>Or do I misunderstand anything, and how should I use these matrices? Thank you.</p>
<hr />
<p>I have tried <code>P_w = M'*P_c</code>, where <code>P_c</code> is the center of the camera system, and <code>M'</code> is the transpose of the matrices I am given, but the projected positions do not look right to me when I plot it.</p>

CC BY-SA 4.0
2021-08-01T18:10:50.183Z
Transposed in relation to what. What your used to?
joojaa
CC BY-SA 4.0
2021-08-01T21:57:50.250Z
Usually a matrix is either row major or column major. The matrix in your example(with the red drawing) is column major.  The matrix coming from the software appear to be row major. Look through the documentation to confirm if it is row or column major. For a row major matrix the translation is the last row instead of the last column.
pmw1234
CC BY-SA 4.0
2021-08-01T22:00:32.653Z
Actually I just checked and the matrix coming from the SDK is row major. (search for the word row in the documentation. So the translation in the first example is  -0.0064   -0.0015   -0.0026    1.0000
pmw1234
CC BY-SA 4.0
2021-08-02T10:39:19.887Z
@pmw1234 I'd think so. Do you also know the answer of my 2nd and 3rd questions? Thanks.
Nick X Tsui
CC BY-SA 4.0
2021-08-02T11:05:06.117Z
If you'd think so, then the answer to the other questions seems self evident.
pmw1234
CC BY-SA 4.0
2021-08-02T11:13:48.687Z
@pmw1234 Please post an answer with some code so I can start testing. Thank you so much.
Nick X Tsui
CC BY-SA 4.0
2021-08-02T13:58:28.980Z
Possibly of interest to you: https://computergraphics.stackexchange.com/a/6093/8009 describing the Object Space → World Space → Eye Space → Clip Space → Normalized Device Space → Window Space transformation and its inverse.
Wyck
<camera><vector-graphics><camera-matrix>
How to get world coordinates from a 4X4 camera matrix
Nick X Tsui
# How to get world coordinates from a 4X4 camera matrix

(Asked by: username_0 on 2021-08-01)

I have [Intel T265 camera](https://dev.intelrealsense.com/docs/depth-and-tracking-cameras-alignment) which has a camera coordinates system like following diagram:
[![enter image description here](https://i.sstatic.net/XGDt4.jpg)](https://i.sstatic.net/XGDt4.jpg)

* The camera system has two cameras and the center of the two cameras is the position of the camera system.
* The point of my interest is P, which is translated from the position of the camera system by `z0` along z axis, and `x0` along x axis.

What I am given is a series of 4X4 (pose) matrices coming with the camera data looking like:

```
    0.9988    0.0175   -0.0466         0
   -0.0195    0.9989   -0.0426         0
    0.0458    0.0434    0.9980         0
   -0.0064   -0.0015   -0.0026    1.0000

```

or

```
   -0.1226    0.0055   -0.9924         0
   -0.0438    0.9990    0.0109         0
    0.9915    0.0448   -0.1223         0
   -0.2279   -0.0244    0.1860    1.0000

```

They look like homogenous matrix (following diagram) except that they are transposed version
[![enter image description here](https://i.sstatic.net/eNbrK.jpg)](https://i.sstatic.net/eNbrK.jpg)

Now, I have a few questions about this 4x4 matrices:

1. What is the position of the camera at each time point? Are they in these 4x4 matrices?
2. Where exactly is the world coordinates and how is it oriented?
3. How do I use these 4X4 matrices to find the projected position of point P in the world coordinates system?

Or do I misunderstand anything, and how should I use these matrices? Thank you.

---

I have tried `P_w = M'*P_c`, where `P_c` is the center of the camera system, and `M'` is the transpose of the matrices I am given, but the projected positions do not look right to me when I plot it.

**Tags:** camera, vector-graphics, camera-matrix

> **Comments:**
> **username_1**: Transposed in relation to what. What your used to?  
> **username_2**: Usually a matrix is either row major or column major. The matrix in your example(with the red drawing) is column major.  The matrix coming from the software appear to be row major. Look through the documentation to confirm if it is row or column major. For a row major matrix the translation is the last row instead of the last column.  
> **username_2**: Actually I just checked and the matrix coming from the SDK is row major. (search for the word row in the documentation. So the translation in the first example is  -0.0064   -0.0015   -0.0026    1.0000  
> **username_0**: @username_2 I'd think so. Do you also know the answer of my 2nd and 3rd questions? Thanks.  
> **username_2**: If you'd think so, then the answer to the other questions seems self evident.  
> **username_0**: @username_2 Please post an answer with some code so I can start testing. Thank you so much.  
> **username_3**: Possibly of interest to you: https://computergraphics.stackexchange.com/a/6093/8009 describing the Object Space → World Space → Eye Space → Clip Space → Normalized Device Space → Window Space transformation and its inverse.  

---

## 0 answers

