Hi! Welcome to Enyo Technology|Customized manufacturer of industrial camera module
Intrinsic and extrinsic parameters in matrix cameras
2025-01-06

1. The concept of internal participation in external parameters

In computer vision, especially in the fields of camera calibration and stereo vision, internal parameters and external parameters are very important concepts.They are related to the camera's geometric properties and poses.

  • Intrinsic Parameters: Intrinsic Parameters are parameters that describe the internal properties of the camera, including focal length, main point (optical center) coordinates, distortion coefficients, etc.Internal references are usually determined at camera calibration because they are usually fixed for a particular camera model and do not change over time.Once the camera internal references are determined, they are usually kept unchanged during the use of the camera.

  • Extrinsic Parameters: Extrinsic Parameters are parameters that describe the camera's position and posture in the world coordinate system, usually including a rotation matrix and a translation vector.The external parameters may change at different camera positions or shooting moments.For example, in stereo vision, if there are two cameras, their relative positions and directions will change each time the camera is moved, resulting in changes in the external parameters.If the camera does not change in position and direction, such as the camera is fixed in a fixed position, the external parameters may remain unchanged for a long time.However, if the camera's position or direction changes, such as moving the camera or changing the shooting angle, external participation will change accordingly.

2. The meaning of four coordinate systems, the world coordinate system (reference coordinate system) , camera coordinate system, image physical coordinate system and pixel coordinate system.

  1. World coordinate system is the coordinates of objects in the real world. For example, the origin of the world coordinate system of the black and white chessboard is fixed at the vertex of the first chessboard, , , , and are perpendicular to each other, and the direction is perpendicular to the chessboard panel.It can be seen that the world coordinate system changes with the size and position of the object, and the unit is a unit of length.As long as the size of the chessboard determines, no matter how the board moves, the coordinates of the corner points of the chessboard generally do not change (because the position relative to the origin of the world coordinate system remains unchanged), and it is considered to be .The camera coordinate system uses the light center as the origin, and is perpendicular to each other with the direction parallel to the image, and is the axis and the axis of the axis. The axis and the axis are parallel to the optical axis, and the axis are parallel to the optical axis, and the axis is perpendicular to each other, and the unit is a unit of length.The physical coordinate system of the image is used to connect the main optical axis and the image plane as the coordinate origin (usually the center of the image). The directions of and are shown in the figure, and the units are units of length.The image pixel coordinate system uses the upper left vertex of the image as the coordinate origin, and the and and directions are parallel to the and directions, and the units are measured in pixels.

The camera imaging process generally involves the transformation of four coordinate systems. The transformation relationship is: is the world coordinate system. After rigid body transformation (such as rotation and translation), it becomes the camera coordinate system, and then transforms into the image coordinate system through perspective projection, and finally transforms into the pixel coordinate system through affine transformation.

We consider the simplest small hole imaging model:

For the convenience of analysis, the imaging plane is often processed symmetrically along the small hole (light center) so that the image is no longer inverted, as the plane pointed by the solid blue line in the figure.

3. Camera external parameters

The external parameters matrix is ​​the transformation from the world coordinate system to the camera coordinate system.Since it is a transformation, we can express it as [R t], with the homogeneous form e3342aa8683f853af48d1ab107916daa_4600dbcd3405ec952499805b98b097ad.png

But so far, it seems that the outer parameter matrix is ​​not seen in the camera matrix.The previous camera matrix is ​​represented as follows:

2f614f644f468f2c8c9a2adaa3880e53_fe3b61941a18ba946877b15ba5176200.png

That's because, in the previous derivation, we default that the world coordinate system and the camera coordinate system overlap.In the small hole imaging model, the coordinates of the spatial point are described as [x y z 1]. The coordinate system of this point is originated in the small hole, and the center of the camera coordinate is also in the small hole. However, in actual application, the world coordinate system and the camera coordinate system often do not overlap, which brings the concept of an external parameter matrix. The figure below shows the situation when the camera coordinate system and the world coordinate system do not overlap. We only know the coordinates of point P in the world coordinate system. Because to use the small hole imaging principle, we want to know the coordinates of point P in the camera coordinate system, and the camera external parameter matrix realizes this transformation.

8bf4ba3f014aec60d57cf0a43fc287e3_20c0842b7b39f4fc42507675e0a8091a.png




 Are a certain point p in space, which is represented as [xw,yw,zw,1] in the world coordinate system and [xc,yc,zc,1] in the camera coordinate system, then they have the following relationship:


6f11e037553a7e7afeba588f07783d7c_e3874da0eee9d88f81e8bd39a9f3c4c9.png

 Bring it into the camera matrix expression:

39d607c0254a1d05322cebf23aa15747_71e71a133b0faa9ab135b8999a06307a.png


 Merge the two matrices on the right of the equation:


4. Camera internal reference


Before talking about the internal reference matrix, the concept of pixel coordinate system must be introduced.

The representation of the above image points is a unit of length, not a pixel. Since the images we get are measured by pixels, the image coordinate system needs to be converted into a pixel coordinate system.

Give a conclusion directly here:

1736156942029.png

 So I had to add another item to the previous camera matrix:

1736156967677.png

There is an assumption in the deduction, that is, the camera's photosensitive element is square, and the installation of the photosensitive element is also through the center of the optical axis, but this is impossible, so the following two problems will arise:

1. The basic unit of the photosensitive element is not square. A square object may finally be imaged as a rectangle (even a bevel effect, and the bevel factor can generally be ignored); this results in the expression that dx and dy are not equal, and

2. The center of the photosensitive element does not coincide with the main point passing through the optical axis, which will cause a small displacement of the normal projected image.

This results in the expression that u0 and v0 may not be equal to half of the length and width of the imaging sensor. (Ideally half)


In the expression, the first three matrices on the right side of the equation are merged to obtain the following formula: f96446d450df2e1d4eeef79a686b41e2_bd5765ed1d2ef3c2715c3b334178e4eb.png

, which is called the internal reference matrix05a2a43bb5250286bc0a64d2d246349e_b72598ee07e0637b3f202629ed484206.png

or only merge the first two matrices on the right of the equation to get the following formula:

021acccd2f12221501bc70e1df0aab3a_12a1849a9aa87c5b86c51385b922a8f7.png

So I also have the habit of c27c29535dfe486c224c0aa35ba8f3a5_9d5690cc83f1ea9ea11fefe8c6ce7397.png is called the inner parameter matrix (one column 0 is missing), and they all mean the same.

The parameters of the internal parameter matrix are:

f: focal length, unit millimeter, dx: pixel width in x direction, unit millimeter, 1/dx: how many pixels are there in 1 mm in x direction

f/dx: Use pixels to describe the length of the focal length in the x-axis direction

f/dy: Use pixels to describe the length of the focal length in the y-axis direction

f/dy: Use pixels to describe the length of the focal length in the y-axis direction

u0,v0, the actual position of the main point, and the unit is also a pixel.