Coordinate system conversion in machine vision

Machine vision, stereo vision, etc. often involve four coordinate systems: world coordinate system, camera coordinate system, image coordinate system, and pixel coordinate system.

The overall preview is as follows

Insert picture description here

1. World coordinate system and camera coordinate system

The world coordinate system , also known as the measurement coordinate system, is a three-dimensional rectangular coordinate system (Xw, Yw, Zw). The spatial position of the camera and the object to be measured can be described in the world coordinate system. The position of the world coordinate system is determined by itself according to the actual situation.

The camera coordinate system is also a three-dimensional rectangular coordinate system (xc, yc, zc). The origin of the camera coordinate system is the optical center of the lens, the x and y axes are respectively parallel to the two sides of the phase plane, and the z axis is the optical axis of the lens, which is perpendicular to the image plane.
Insert picture description here
The transformation from the world coordinate system to the camera coordinate system is a rigid body transformation, that is, only the spatial position (translation) and orientation (rotation) of the object is changed, but the shape of the object is not changed. The rotation matrix R and the translation vector t can represent this transformation.

In homogeneous coordinates, the rotation matrix R is an orthogonal matrix, which can be transformed into a rotation vector with only three independent variables by Rodrigues transformation. Therefore, the rigid body transformation can be represented by 6 parameters (3 rotation vectors, 3 translation vectors), and these 6 parameters are the external parameters of the camera. The camera external parameters determine the transformation of the space point from the world coordinate system to the camera coordinate system.

Insert picture description here
It can be expressed as
Insert picture description here

2. Camera coordinate system and image coordinate system

From the camera coordinate system to the image coordinate system, it belongs to the perspective projection relationship, and it is converted from 3D to 2D.

The image coordinate system is also called the plane coordinate system, and the position of the pixel is expressed in physical units, and the unit is mm. The coordinate origin is the position of the intersection of the camera's optical axis and the image coordinate system.
Insert picture description here
According to the principle of similar triangle
Insert picture description here

Represented in homogeneous coordinates as
Insert picture description here

3. Image coordinate system and pixel coordinate system

Both the pixel coordinate system and the image coordinate system are on the imaging plane, but their origins and measurement units are different. The origin of the image coordinate system is the intersection of the camera's optical axis and the imaging plane, which is usually the midpoint of the imaging plane or called the principal point. The unit of the image coordinate system is mm, which is a physical unit, while the unit of the pixel coordinate system is pixel. We usually describe a pixel as several rows and several columns. So the conversion between the two is as follows: where dx and dy indicate how many mm each column and each row represent, that is, 1pixel=dx mm
Insert picture description here

Combined together as follows:
Insert picture description here
Reference:
https://blog.csdn.net/lyhbkz/article/details/82254069?biz_id=102&utm_term=%E7%9B%B8%E6%9C%BA%E5%9D%90%E6% A0%87%E7%B3%BB%E8%BD%AC%E4%B8%96%E7%95%8C%E5%9D%90%E6%A0%87%E7%B3%BB&utm_medium=distribute.pc_search_result. none-task-blog-2 all sobaiduweb~default-0-82254069&spm=1018.2118.3001.4187

https://blog.csdn.net/heiheiya/article/details/96151958?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159997928719725247401998%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=159997928719725247401998&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v3~pc_rank_v4-3-96151958.first_rank_ecpm_v3_pc_rank_v4&utm_term=%E7%9B%B8%E6%9C%BA%E5%9D%90%E6%A0%87%E7%B3%BB%E8%BD%AC%E4%B8%96%E7%95%8C%E5%9D%90%E6%A0%87%E7%B3%BB&spm=1018.2118.3001.4187

Guess you like

Origin blog.csdn.net/weixin_45680994/article/details/108562665