Open osrf-migration opened 5 years ago
Original comment by Christian Rauch (Bitbucket: christian-rauch).
I wrongly assumed that S is the scale, but it's the skew.
The correct call to UpdateCameraIntrinsics
:
#!c++
UpdateCameraIntrinsics(536.473145060694, 536.8639285109052, 314.0086519801989, 246.7391576005324, 0);
sets the correct projection matrix:
1.67648 0 0.018723 0 0 2.23693 -0.02808 0 0 0 -1 -0.0002 0 0 -1 0
It's however still an issue that this projection matrix is not set correctly at the initial construction of the camera sensor.
Original report (archived issue) by Christian Rauch (Bitbucket: christian-rauch).
Sensor definition
I have a camera sensor with intrinsic parameters:
Expected projection matrix
According to http://www.songho.ca/opengl/gl_projectionmatrix.html#perspective, the projection matrix is:
For the given camera parameters this should be something around:
The signs are different because this is in a RDF (x - Right, y - Down, z - Front) coordinate system.
Projection matrix used in camera sensor
But the projection matrix (
Camera::ProjectionMatrix()
) gives (row-major):which is missing values for P(0,2) and P(1,2) (they are set to 0).
Since Gazebo 10 I can update the camera intrinsics via
Camera::UpdateCameraIntrinsics
:or compute the projection matrix manually via
Camera::BuildProjectiveMatrix
:in which case I get:
as projection matrix. This is still not correct since this time P(0,1)=0.003125, which should be 0.