Getting the Camera Intrinsics for Testing the Perception Module

Is it possible to know the camera intrinsics that follow the pinhole model. We would like to specifically know the focal length x (fx), focal length y (fy), center x, and center y, skew and distortions of the camera in order to construct the intrinsics matrix and distortions vector to test our perception module which requires these specifications.

Morning Mohammed,
It might be useful for you to have a look at the launchfile that starts the camera clients that take CarMaker camera data and publish it over ROS1. In your project, the path to the file would be something like FS_autonomous/ros/ros1_ws/src/carmaker_rsds_client/launch/carmaker_rsds_client.launch

It is actually possible to alter all of the parameters that you mentioned by launching the client with additional values for fx, fy, etc. However, just to answer the question at hand, the default parameters are:

  • width - image width in pixels
  • fov_rad - camera field of view in radians
  • c_x = 0.5 * arg(‘width’)
  • f_x = arg(‘c_x’)/(tan(0.5 * arg(‘fov_rad’)))

The camera parameters and calibration matrices also follow from these. Essentially, the defaults we have provided all depend on the image size and the camera FoV, everything else is dependent parameters.

If you want to provide your own launch parameters, you should know that the current launcher is being automatically called form the CarMaker ROS1 node: FS_autonomous/ros/ros1_ws/src/hellocm_cmnode/src/CMNode_ROS1_HelloCM.cpp

There is a comment around line 973 that says “/* Do a system call to roslaunch and launch the ROS node */”. The parameters are being passed to the launch file as if you are calling it from the terminal, you might add stuff like your own f_x, f_y, or any other that you wish to overwrite.