uji-ros-pkg / underwater_simulation

UWSim-NET, the Underwater Simulator
97 stars 64 forks source link

Documentation of camera parameters #43

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi, could you please document the specific meaning of the camera parameters used by the virtual cameras please? I.e. the definition of each of the following: fx, fy, x0, y0, f, n, and k.

perezsolerj commented 9 years ago

Hi, This are calibration parameters for cameras. Are used to obtain an opengl projection matrix from them. As far as I know the definitions are:

fx, fy: Camera's focal lengths on x and y axis. x0,y0: Image principal points. (usually image center) f,n : near and far camera planes (anything further or nearer this planes won't be displayed by the camera k: Distortion related to skew between x and y axis.

If you are confident on OSG matrices you can have a look at how it is constructed from those parameters: // How to obtain opengl projection matrix from camera calibration parameters: // 2.0_fx/w....2.0_k/w....1-2_x0/w......0 // 0...............2.0_fy/h...1-2_y0/h......0 // 0...............0.............(f+n)/(n-f)....2_fn/(n-f) // 0...............0.............-1................0