Skip to content

Question about object_localization (single view geometry) #12

@where2go947

Description

@where2go947

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$

image

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions