3dv_tutorial
3dv_tutorial copied to clipboard
Question about object_localization (single view geometry)
Thanks for your awesome work. It does help! But I got confused about a line in code. Could you give me some help? Thanks in advance!
according to the slides (02 single view geometry, 24th): $Z = \frac{\bar{z}}{\bar{y}} L$ $X = \frac{\bar{x}}{\bar{y}} L$
However, in the code below, $X = \frac{c[0]}{c[2]} * L$ (line 62), which $c[2]$ is actually $\bar{z}$ instead of $\bar{y}$. So in my opinion, the code is supposed to be: $X = \frac{c[0]}{c[1]} * L$
https://github.com/mint-lab/3dv_tutorial/blob/f295338ae4a8c28bf7da0d3f2dea1506be652ef1/examples/object_localization.py#L54-L64
By the way, I think equation in slides above $[\bar{x}, \bar{y}, \bar{z}]^T = R^T* [x-c_x, y-c_y, f]^T$ is wrong, which $R^T$ should be $R$. ($R$ is the camera orientation)
The implementation in the CPP file is right: Rc
is the camera orientation.
https://github.com/mint-lab/3dv_tutorial/blob/f295338ae4a8c28bf7da0d3f2dea1506be652ef1/examples/object_localization.cpp#L85
Actually, R.t()
=Rc
, which is the camera orientation:
https://github.com/mint-lab/3dv_tutorial/blob/f295338ae4a8c28bf7da0d3f2dea1506be652ef1/examples/object_localization.cpp#L60-L63
From my perspective, what $R * [x-c_x, y-c_y, f]^T$ does is to represent the point $[x-c_x, y-c_y, f]^T$ under an unrotated coordinate system (its orientation is aligned with the world coordinate system, but the origin keeps unchanged), so that the similar triangles equation $\frac{\bar{x}}{X} = \frac{\bar{y}}{L} = \frac{\bar{z}}{Z}$ would be right.