Machine Vision (5)-Coordinate System Conversion

Machine Vision (5)-Coordinate System Conversion

1. Pixel coordinate system

The digital image collected by the camera can be stored as an array in the computer, and the value of each element (pixel, pixel) in the array is the brightness (gray scale) of the image point. As shown in Figure 4.1, a rectangular coordinate system uv is defined on the image, and the coordinates (u, v) of each pixel are the number of columns and rows of the pixel in the array. Therefore, (u, v) is the image coordinate system coordinates in pixels.
Insert picture description here

2. Retinal coordinate system

Since the image coordinate system only indicates the number of columns and rows of the pixel in the digital image, and does not indicate the physical location of the pixel in the image in physical units, it is necessary to establish an imaging plane expressed in physical units (for example, centimeters) The coordinate system xy is shown in Figure 4.1. We use (x, y) to represent the coordinates of the imaging plane coordinate system measured in physical units. In the xy coordinate system, the origin is defined at the intersection of the optical axis of the camera and the image plane, which is called the principal point of the image. This point is generally located at the center of the image, but due to the production of the camera, there may be some deviation. The coordinates in the coordinate system are (u0, v0), and the physical dimensions of each pixel in the x-axis and y-axis directions are dx and dy. The relationship between the two coordinate systems is as follows:
Insert picture description here

Where s'represents the skew factor derived because the coordinate axes of the camera imaging plane are not orthogonal to each other.

3. Camera coordinate system

The geometric relationship of the camera imaging can be shown in Figure 4.2, where point O is called the optical center of the camera, the axis and
axis are parallel to the x-axis and y-axis of the imaging plane coordinate system, and the axis is the optical axis of the camera, which is perpendicular to the image plane. The intersection of the optical axis and the image plane is the principal image point O', and the rectangular coordinate system composed of the point O and the axis is called the camera coordinate system. OO' is the focal length of the camera.
Insert picture description here

4. World coordinate system

In the environment, a reference coordinate system is also selected to describe the position of the camera and the object. This coordinate system is called the world coordinate system. The relationship between the camera coordinate system and the world coordinate system can be described by the rotation matrix R and the translation vector t. Therefore, the homogeneous coordinates of a point P in the world coordinate system and the camera coordinate system are sum and the following relationship exists:
Insert picture description here

Where R is a 3×3 orthogonal identity matrix, t is a 3-dimensional translation vector, and M1 is the connection matrix between the two coordinate systems.

5. Camera linear model

Perspective projection is the most commonly used imaging model, which can be approximated by a pinhole imaging model. Its characteristic is that all light from the scene passes through a projection center, which corresponds to the center of the lens. The straight line passing through the center of the projection and perpendicular to the image plane is called the projection axis or optical axis, as shown in Figure 4.3. Among them is the Cartesian coordinate system fixed on the camera. It follows the right-hand rule. Its origin is at the center of the projection. The axis and projection coincide and point to the scene. The axis and the axis are parallel to the coordinate axis of the image plane. The distance between the plane and the image plane is the camera Focal length f. In the actual camera, the image plane is located behind the projection center at a distance of f, and the projected image is inverted. In order to avoid image inversion, it is assumed that there is a virtual imaging x'y'z' plane in front of the projection center, and the point is on the image The projection position (x, y) on the plane can be obtained by calculating the intersection of the line of sight of the point and the virtual imaging plane.
Insert picture description here

The relationship between the camera coordinate system and the imaging plane coordinate system is:
Insert picture description here

Among them, (x, y) are the coordinates of point P in the imaging plane coordinate system, and the coordinates of the space point P in the camera
coordinate system. Expressed by homogeneous coordinates and matrix:
Insert picture description here

Substituting (4.1) and (4.2) into the above formula, the relationship between the image coordinate system and the world coordinate system is obtained:
Insert picture description hereInsert picture description here
Among them,,, [R t] is completely determined by the position of the camera relative to the world coordinate system, which is called the camera external parameter A matrix, which is composed of a rotation matrix and a translation vector; K is only related to the internal structure of the camera, called the camera internal parameter matrix, where (u0, v0) are the main point coordinates, which are the scale factors on the u-axis and v-axis of the image, respectively. s is a parameter describing the degree of inclination of the two image coordinate axes; P is a 3 × 4 matrix, called the projection matrix, that is, the conversion matrix from the world coordinate system to the image coordinate system. It can be seen that if the internal and external parameters of the camera are known, the projection matrix P is known. For any spatial point, if its three-dimensional coordinates are known, the position of the image coordinate point (u, v) can be obtained. However, if the coordinates (u, v) of the image point of a certain point in space are known, even if the projection matrix is ​​known, its spatial coordinates are not uniquely determined, and it corresponds to a straight line in space. That is, the monocular camera can only measure plane information, but cannot obtain depth information.

Guess you like

Origin blog.csdn.net/weixin_45661757/article/details/115284000