Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to estimate room dimensions from reconstructed layout? #15

Open
vuptran opened this issue Oct 1, 2019 · 4 comments
Open

How to estimate room dimensions from reconstructed layout? #15

vuptran opened this issue Oct 1, 2019 · 4 comments
Labels
question Further information is requested

Comments

@vuptran
Copy link

vuptran commented Oct 1, 2019

@sunset1995, thank you for the great work.

Is it possible to estimate the dimensions of the room, either from panorama or reconstruction, using known camera parameters, such as camera height or focal length? I would like to know how HorizonNet can recover the actual dimensions of the room in terms of height x width of the walls, for example. Thank you.

@sunset1995
Copy link
Owner

Please check layout_viewer.py which reads the HorizonNet prediction via inference.py on image coordinate and then convert layout corners to 3D space.
Line 207 contains layouts' xy coordinates.
Variables floor_z and ceil_z in line 206 and 210 contains the ceiling/floor height sharing by all xy coordinates.

Please note that the all xyz are up to a scale which means you can multiply all numbers by a constant.

@vuptran
Copy link
Author

vuptran commented Oct 3, 2019

@sunset1995, thank you for the prompt reply. This is all great information. I'm trying to understand the equations on Lines 207-210. Could you share the descriptions of those equations? Are they documented in your paper or appendix?

@sunset1995
Copy link
Owner

cor_id is the positions of corners on the panorama image which follow below format:

x_0 y_ceiling_0
x_0 y_floor_0
x_1 y_ceiling_1
x_1 y_floor_1
...

So cor_id[1::2] gives you all the floor corners.

np_coor2xy projects corner on images onto a imaginary floor plane whose distance to camera is floor_z in 3D space.

With all the XYZ 3D position of all the floor corners, the corresponding ceiling corners shared the same XY 3D position as floor corner but with different Z position.
So lines 208-210 solve the remain unknown ceiling Z position (in 3D space) with known cor_id[0::2] (ceiling corners on image) and their corresponding XY coordinates in 3D.

@sunset1995 sunset1995 added the question Further information is requested label Oct 3, 2019
@vuptran
Copy link
Author

vuptran commented Oct 4, 2019

Thank you @sunset1995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants