-
Notifications
You must be signed in to change notification settings - Fork 7
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
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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])'
![000001](https://private-user-images.githubusercontent.com/92230886/245282897-9e4c2f8a-83c6-4956-9a07-5e2086227228.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMTczMTcsIm5iZiI6MTcyNDAxNzAxNywicGF0aCI6Ii85MjIzMDg4Ni8yNDUyODI4OTctOWU0YzJmOGEtODNjNi00OTU2LTlhMDctNWUyMDg2MjI3MjI4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDIxMzY1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM0ZTY2NGI5MTI0MWZmMGQ2OWRjYTljYmE3ZDU3MWMxODY2YTY3NGM3OTMwZjRlYjIzZDZlNzhkYmVkYmU0ZWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xTG4jM0WPpNWqV79dxIvG_fT1tGPGj9UfU_vtMYpNqw)
![000007](https://private-user-images.githubusercontent.com/92230886/245282911-272ec646-0611-46b6-936b-ba053be40e2a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMTczMTcsIm5iZiI6MTcyNDAxNzAxNywicGF0aCI6Ii85MjIzMDg4Ni8yNDUyODI5MTEtMjcyZWM2NDYtMDYxMS00NmI2LTkzNmItYmEwNTNiZTQwZTJhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDIxMzY1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlMWQ5NWQ3ZjMxM2JjYmNmOGYwMzIxMThiZjU5MmJjNTkwZTZjZTNkYzU5YWE4ZDAzMmFhYjdkMWY5NjA5M2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9YxEm3aSRhx-AFs0P887kUb2NdFvQ40InDPjaFT_vhA)
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.
The text was updated successfully, but these errors were encountered: