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

Question about the calib in bev_transformer.py #31

Open
zjr-bit opened this issue Apr 13, 2023 · 4 comments
Open

Question about the calib in bev_transformer.py #31

zjr-bit opened this issue Apr 13, 2023 · 4 comments

Comments

@zjr-bit
Copy link

zjr-bit commented Apr 13, 2023

Hi, thanks for your great work!
When I read your code, I am confused about the use of calib in class sample_polar2cartin in bev_transformer.py.

x_zmax = self.z_max / f * cu

Accoding to the meaning of intrinsics of camera, I think this should be
x_zmax = self.z_max / f * (u_max - cu)
So that we can get the maximum of X when Z is z_max.
Am I wrong? Could you please check it or let me know where my thoughts are incorrect?
Thanks in advance

@sngImagry
Copy link

I think it is fine, it is the basic formula of perspective projection: tan(fov/2)=cu/f; where f is the focal length and cu is the range between the origin_x coordinate and the center_x of the image. In the attached line we try to find a similar triangle in which the tan(fov/2)= X/self.z_max.
Therefore: X = self.z_max*cu/f

@Thang1703hrsh
Copy link

I have a question, as far as I know calib is a 3x3 matrix with 2 dimensions, but in this line of code calib is a 3-dimensional matrix f, cu = calib[:, 0, 0], calib[ :, 0, 2]

@avishkarsaha
Copy link
Owner

avishkarsaha commented Jun 15, 2023 via email

@Thang1703hrsh
Copy link

So what is the calib size here, I think it's still 3x3, so when I run to that line I get the error too many indices for tensor of dimension 2

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

No branches or pull requests

4 participants