project_3d_pointT_project_3d_pointProject3dPointProject3dPointproject_3d_point (算子)
名称
project_3d_pointT_project_3d_pointProject3dPointProject3dPointproject_3d_point — 将三维点投影到(亚)像素图像坐标中。
签名
Herror T_project_3d_point(const Htuple X, const Htuple Y, const Htuple Z, const Htuple CameraParam, Htuple* Row, Htuple* Column)
void Project3dPoint(const HTuple& X, const HTuple& Y, const HTuple& Z, const HTuple& CameraParam, HTuple* Row, HTuple* Column)
void HCamPar::Project3dPoint(const HTuple& X, const HTuple& Y, const HTuple& Z, HTuple* Row, HTuple* Column) const
def project_3d_point(x: Sequence[float], y: Sequence[float], z: Sequence[float], camera_param: Sequence[Union[int, float, str]]) -> Tuple[Sequence[float], Sequence[float]]
描述
project_3d_pointproject_3d_pointProject3dPointProject3dPointProject3dPointproject_3d_point projects one or more 3D points (with coordinates
XXXXxx, YYYYyy, and ZZZZzz) into the image plane (in pixels) and
returns the result in RowRowRowRowrowrow and ColumnColumnColumnColumncolumncolumn. The coordinates
XXXXxx, YYYYyy, and ZZZZzz are given in the camera coordinate
system, i.e., they describe the position of the points relative to the
camera.
The internal camera parameters CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param describe the projection
characteristics of the camera (see 标定 for
details).
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在内部数据级别上自动并行化。
参数
XXXXxx (输入控制) point3d.x-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
X coordinates of the 3D points to be projected in the
camera coordinate system.
YYYYyy (输入控制) point3d.y-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Y coordinates of the 3D points to be projected in the
camera coordinate system.
ZZZZzz (输入控制) point3d.z-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Z coordinates of the 3D points to be projected in the
camera coordinate system.
CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param (输入控制) campar → HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Internal camera parameters.
RowRowRowRowrowrow (输出控制) point.y-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Row coordinates of the projected points (in pixels).
ColumnColumnColumnColumncolumncolumn (输出控制) point.x-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Column coordinates of the projected points (in pixels).
示例(HDevelop)
* Set internal camera parameters and pose of the world coordinate
* system in camera coordinates.
* Note that, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, -731, 5.2e-006, 5.2e-006, \
654, 519, 1280, 1024, CameraParam)
create_pose (0.1, 0.2, 0.3, 40, 50, 60, \
'Rp+T', 'gba', 'point', WorldPose)
* Convert pose into transformation matrix.
pose_to_hom_mat3d(WorldPose, HomMat3D)
* Transform 3D points from world into the camera coordinate system.
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [3.8, 4.2], X, Y, Z)
* Project 3D points into image.
project_3d_point(X, Y, Z, CameraParam, Row, Column)
示例(HDevelop)
* Set internal camera parameters and pose of the world coordinate
* system in camera coordinates.
* Note that, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, -731, 5.2e-006, 5.2e-006, \
654, 519, 1280, 1024, CameraParam)
create_pose (0.1, 0.2, 0.3, 40, 50, 60, \
'Rp+T', 'gba', 'point', WorldPose)
* Convert pose into transformation matrix.
pose_to_hom_mat3d(WorldPose, HomMat3D)
* Transform 3D points from world into the camera coordinate system.
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [3.8, 4.2], X, Y, Z)
* Project 3D points into image.
project_3d_point(X, Y, Z, CameraParam, Row, Column)
示例(HDevelop)
* Set internal camera parameters and pose of the world coordinate
* system in camera coordinates.
* Note that, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, -731, 5.2e-006, 5.2e-006, \
654, 519, 1280, 1024, CameraParam)
create_pose (0.1, 0.2, 0.3, 40, 50, 60, \
'Rp+T', 'gba', 'point', WorldPose)
* Convert pose into transformation matrix.
pose_to_hom_mat3d(WorldPose, HomMat3D)
* Transform 3D points from world into the camera coordinate system.
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [3.8, 4.2], X, Y, Z)
* Project 3D points into image.
project_3d_point(X, Y, Z, CameraParam, Row, Column)
示例(HDevelop)
* Set internal camera parameters and pose of the world coordinate
* system in camera coordinates.
* Note that, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, -731, 5.2e-006, 5.2e-006, \
654, 519, 1280, 1024, CameraParam)
create_pose (0.1, 0.2, 0.3, 40, 50, 60, \
'Rp+T', 'gba', 'point', WorldPose)
* Convert pose into transformation matrix.
pose_to_hom_mat3d(WorldPose, HomMat3D)
* Transform 3D points from world into the camera coordinate system.
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [3.8, 4.2], X, Y, Z)
* Project 3D points into image.
project_3d_point(X, Y, Z, CameraParam, Row, Column)
示例(HDevelop)
* Set internal camera parameters and pose of the world coordinate
* system in camera coordinates.
* Note that, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, -731, 5.2e-006, 5.2e-006, \
654, 519, 1280, 1024, CameraParam)
create_pose (0.1, 0.2, 0.3, 40, 50, 60, \
'Rp+T', 'gba', 'point', WorldPose)
* Convert pose into transformation matrix.
pose_to_hom_mat3d(WorldPose, HomMat3D)
* Transform 3D points from world into the camera coordinate system.
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [3.8, 4.2], X, Y, Z)
* Project 3D points into image.
project_3d_point(X, Y, Z, CameraParam, Row, Column)
结果
project_3d_pointproject_3d_pointProject3dPointProject3dPointProject3dPointproject_3d_point returns 2 (
H_MSG_TRUE)
if all parameter values are
correct。如有必要,则抛出异常。
可能的前趋
read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par,
affine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3dAffineTransPoint3daffine_trans_point_3d
可能的后继
gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points,
gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygongen_region_polygon,
disp_polygondisp_polygonDispPolygonDispPolygonDispPolygondisp_polygon
另见
camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration,
disp_caltabdisp_caltabDispCaltabDispCaltabDispCaltabdisp_caltab,
read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par,
get_line_of_sightget_line_of_sightGetLineOfSightGetLineOfSightGetLineOfSightget_line_of_sight,
affine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3dAffineTransPoint3daffine_trans_point_3d,
image_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlaneImagePointsToWorldPlaneimage_points_to_world_plane
模块
标定