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

changing camera rotation changes the result ? #6

Open
Sondosmohamed1 opened this issue Jun 12, 2023 · 1 comment
Open

changing camera rotation changes the result ? #6

Sondosmohamed1 opened this issue Jun 12, 2023 · 1 comment

Comments

@Sondosmohamed1
Copy link

thank you for your great work. While reviewing the calibration file, I noticed that you used instinct matrix,. Based on my understanding in your definition this matrix represents both the extrinsic and intrinsic parameters. Could you kindly provide further clarification on this matter? i understand that the label file defined in camera coordinate therefore the rotation and position is already defined but why in definition ' 3x4 p0-p3 Camera P matrix. Contains extrinsic and intrinsic parameters. (P=K*[R;t])'
def save_calibration_matrices(filename, intrinsic matrix, lidar_cam_mat):
""" Saves the calibration matrices to a file.
AVOD (and KITTI) refers to P as P=K*[R;t], so we will just store P.
The resulting file will contain:
3x4 p0-p3 Camera P matrix. Contains extrinsic
and intrinsic parameters. (P=K*[R;t])
3x3 r0_rect Rectification matrix, required to transform points
from velodyne to camera coordinate frame.
3x4 tr_velodyne_to_cam Used to transform from velodyne to cam
coordinate frame according to:
Point_Camera = P_cam * R0_rect *
Tr_velo_to_cam *
Point_Velodyne.
3x4 tr_imu_to_velo Used to transform from imu to velodyne coordinate frame. This is not needed since we do not export
imu data.
"""
# KITTI format demands that we flatten in row-major order
ravel_mode = 'C'
P0 = intrinsic_mat
P0 = np.column_stack((P0, np.array([0, 0, 0])))
P0 = np.ravel(P0, order=ravel_mode)
R0 = np.identity(3)
I have another question. I changed the camera location (not inside a car), and it works fine. However, when I rotate the camera, I encounter incorrect projection results (I used the KITTI label file to describe the projection). On the other hand, when I don't rotate it, I obtain correct projections. Could you please explain why this is happening? Thank you very much.
000001
000007

@Sondosmohamed1 Sondosmohamed1 changed the title changing camera rotation change the result ? changing camera rotation changes the result ? Jun 13, 2023
@Sondosmohamed1
Copy link
Author

Sondosmohamed1 commented Sep 20, 2023

hello , i solved the problem by considering relative roll and and relative pitch but still sometimes i have shift in projection
image
image

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

1 participant