Skip to content

project_3d_pointProject3dPointProject3dPointproject_3d_pointT_project_3d_point🔗

説明🔗

project_3d_pointProject3dPointProject3dPointproject_3d_pointT_project_3d_point — 3次元ポイントを(サブ)ピクセルへ投影する。

書式🔗

project_3d_point( point3d.x X, point3d.y Y, point3d.z Z, campar CameraParam, out point.y Row, out point.x Column )void Project3dPoint( const HTuple& X, const HTuple& Y, const HTuple& Z, const HTuple& CameraParam, HTuple* Row, HTuple* Column )static void HOperatorSet.Project3dPoint( HTuple x, HTuple y, HTuple z, HTuple cameraParam, out HTuple row, out HTuple column )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]]

Herror T_project_3d_point( 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

void HCamPar.Project3dPoint( HTuple x, HTuple y, HTuple z, out HTuple row, out HTuple column )

説明🔗

project_3d_pointProject3dPoint は、ひとつもしくはそれ以上の3Dポイント (座標 Xxx、Yyy、Zzz) で表される)を画像平面 (ピクセル) へ投影し、投影した結果の座標 Rowrowrow と Columncolumncolumn を返します。座標 Xxx、Yyy、 Zzz は、カメラ座標系で与えられます。つまり、カメラに相対的に ポイントの位置を記述します。

内部カメラパラメーター CameraParamcameraParamcamera_param は、カメラの投影特性を表します。 (Calibration 参照)。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 内部データレベルで自動的に並列演算処理を実施

パラメーター🔗

Xxx (input_control) point3d.x-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

投影される3次元ポイントのX座標系

Yyy (input_control) point3d.y-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

投影される3次元ポイントのX座標系

Zzz (input_control) point3d.z-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

投影される3次元ポイントのZ座標系

CameraParamcameraParamcamera_param (input_control) campar → (real / integer / string)HTuple (double / Hlong / HString)HCamPar, HTuple (double / int / long / string)Sequence[Union[int, float, str]]Htuple (double / Hlong / char*)

内部カメラパラメーター

Rowrowrow (output_control) point.y-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

ピクセルの行座標

Columncolumncolumn (output_control) point.x-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

ピクセルの列座標

例🔗

(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)
(C++)
HTuple WorldPose, HomMat3D, X1, Y1, Z1, X2, Y2, Z2\;
HTuple CameraParam, Row, Column\;
// 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 source into destination coordinate system.
X1[1] = 3.2\;
X1[0] = 3.0\;
Y1[1] = 4.5\;
Y1[0] = 4.5\;
Z1[1] = 4.2\;
Z1[0] = 3.8\;
affine_trans_point_3d(HomMat3D, X1, Y1, Z1, &X2, &Y2, &Z2)\;
// Project 3D points into image.
project_3d_point(X2, Y2, Z2, CameraParam, &Row, &Column)\;

結果🔗

project_3d_pointProject3dPointは、すべてのパラメーターが正しければ、値 2 (H_MSG_TRUE) を 返します。必要ならば、例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

read_cam_parReadCamPar, affine_trans_point_3dAffineTransPoint3d

後処理の候補

gen_region_pointsGenRegionPoints, gen_region_polygonGenRegionPolygon, disp_polygonDispPolygon

関連項目

camera_calibrationCameraCalibration, disp_caltabDispCaltab, read_cam_parReadCamPar, get_line_of_sightGetLineOfSight, affine_trans_point_3dAffineTransPoint3d, image_points_to_world_planeImagePointsToWorldPlane

モジュール🔗

Calibration