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$
|
while True: |
|
img_copy = img.copy() |
|
if mouse_state['xy_e'][0] > 0 and mouse_state['xy_e'][1] > 0: |
|
# Calculate object location and height |
|
c = R.T @ [mouse_state['xy_s'][0] - cx, mouse_state['xy_s'][1] - cy, f] |
|
h = R.T @ [mouse_state['xy_e'][0] - cx, mouse_state['xy_e'][1] - cy, f] |
|
if c[1] < 1e-6: # Skip the degenerate case (beyond the horizon) |
|
continue |
|
X = c[0] / c[2] * L # Object location X [m] |
|
Z = c[2] / c[1] * L # Object location Y [m] |
|
H = (c[1] / c[2] - h[1] / h[2]) * Z # Object height [m] |
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}$ .$X = \frac{c[0]}{c[1]} * L$
So in my opinion, the code is supposed to be:
3dv_tutorial/examples/object_localization.py
Lines 54 to 64 in f295338