Project 3D points into (sub-)pixels.
project_3d_point is used to project one or more 3D points (with coordinates X, Y, and Z) into the image plane (in pixel). The coordinates X, Y, and Z are given in the camera coordinate system, i.e., they describe the position of the point relative to the camera.
The internal camera parameters CamParam (Focus, Sx, Sy, Cx, Cy, Kappa , ImageWidth and ImageHeight) describe the projection characteristics of the camera. The underlying camera model is a pinhole camera with radial distortions. It describes the transform of a 3D point P_C into a (sub-)pixel [r,c] of the video image by the following equations:
P_C = (x,y,z) u = Focus * x / z v = Focus * y / z u' = (2*u) / (1+sqrt(1-4*Kappa*(u^2+v^2))) v' = (2*v) / (1+sqrt(1-4*Kappa*(u^2+v^2))) c = u' / Sx + Cx r = v' / Sy + CyThese equations consist of the perspective projection into the image plane, a radial distortion of the projected point, and finally a sampling and a image center displacement.
X (input_control) |
real-array -> real |
X-coordinates of the 3D points to be projected. |
Y (input_control) |
real-array -> real |
Y-coordinates of the 3D points to be projected. |
Z (input_control) |
real-array -> real |
Z-coordinates of the 3D points to be projected. |
CamParam (input_control) |
number-array -> real / integer |
Internal camera parameters. | |
Number of elements: 8 |
Row (output_control) |
real-array -> real |
Row-coordinates of pixels. | |
Default value: 'ProjectedRow' |
Column (output_control) |
real-array -> real |
Column-coordinates of pixels. | |
Default value: 'ProjectedCol' |
/* read camera pose */ read_cam_pose(::'campose.dat':CamPose) > /* transform camera pose to transformation matrix */ pose_to_hom_mat(::CamPose:HomTransMat) > /* transform 3D points from source into destination coordinate system */ hom_3d_trans(::[3.0,3.2],[4.5,4.5],[5.8,6.2],HomTransMat:X,Y,Z) > /* read internal camera parameters */ read_cam_par(::'campar.dat':CamParam) > /* project 3D points into image */ project_3d_point(::X,Y,Z,CamParam:Row,Column).
project_3d_point returns TRUE if all parameter values are correct. If necessary an exception is raised.
store_coord, store_polygon, disp_polygon
camera_calibration, disp_caltab, read_cam_par, inverse_project_pixel, hom_3d_trans