KlassenKlassenKlassenKlassen | | | | Operatoren

hom_mat3d_to_poseT_hom_mat3d_to_poseHomMat3dToPosehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose (Operator)

Name

hom_mat3d_to_poseT_hom_mat3d_to_poseHomMat3dToPosehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose — Konvertieren einer homogenen Transformationsmatrix in eine 3D-Lage (Pose).

Signatur

hom_mat3d_to_pose( : : HomMat3D : Pose)

Herror T_hom_mat3d_to_pose(const Htuple HomMat3D, Htuple* Pose)

Herror hom_mat3d_to_pose(const HTuple& HomMat3D, HTuple* Pose)

void HomMat3dToPose(const HTuple& HomMat3D, HTuple* Pose)

HPose HHomMat3D::HomMat3dToPose() const

void HOperatorSetX.HomMat3dToPose(
[in] VARIANT HomMat3d, [out] VARIANT* Pose)

VARIANT HHomMat3DX.HomMat3dToPose()

static void HOperatorSet.HomMat3dToPose(HTuple homMat3D, out HTuple pose)

HPose HHomMat3D.HomMat3dToPose()

Beschreibung

hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPosehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose konvertiert eine homogene Transformationsmatrix HomMat3DHomMat3DHomMat3DHomMat3DHomMat3DhomMat3D in eine 3D-Lage PosePosePosePosePosepose mit Typ-Code 0. Details zu 3D-Lagen und den zugehörigen Transformationsmatrizen findet sich bei create_posecreate_poseCreatePosecreate_poseCreatePoseCreatePose.

Ein typischer Anwendungsfall von hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPosehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose ist, dass eine 3D-Lage zuvor mit pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3d in eine homogene Transformatrix konvertiert wurde, um sie z.B. mit hom_mat3d_rotatehom_mat3d_rotateHomMat3dRotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotate oder hom_mat3d_translatehom_mat3d_translateHomMat3dTranslatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslate weiter zu transformieren, und dann wieder zurück in ein 3D-Lage konvertiert werden soll, um die als Eingabe für Operatoren wie image_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlane zu nutzen.

Achtung

hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPosehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose unterstützt nur rigide Transformationen in HomMat3DHomMat3DHomMat3DHomMat3DHomMat3DhomMat3D.

Parallelisierung

Parameter

HomMat3DHomMat3DHomMat3DHomMat3DHomMat3DhomMat3D (input_control)  hom_mat3d HHomMat3D, HTupleHTupleHTupleHHomMat3DX, VARIANTHtuple (real) (double) (double) (double) (double) (double)

Homogene Transformationsmatrix.

PosePosePosePosePosepose (output_control)  pose HPose, HTupleHTupleHTupleHPoseX, VARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

äquivalente 3D-Lage (Pose).

Parameteranzahl: 7

Beispiel (HDevelop)

camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose,6, \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree around the y-axis to obtain a world coordinate system
*  whose y- and z-axis lie in the plane of the calibration plate while the
*  x-axis point 'upwards': cam_H_w = cam_H_cal * RotY(90)
hom_mat3d_identity(HomMat3DIdent)
hom_mat3d_rotate(HomMat3DIdent, rad(90), 'y', 0, 0, 0, \
                 HomMat3DRotateY)
hom_mat3d_compose(cam_H_cal, HomMat3DRotateY, cam_H_w)
*  transform back to pose
hom_mat3d_to_pose(cam_H_w, cam_P_w)
*  use pose to transform an image point into the world coordinate system
image_points_to_world_plane(FinalCamParam, cam_P_w, 87, 23.5, 1, \
                            w_px, w_py)

Beispiel (HDevelop)

camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose,6, \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree around the y-axis to obtain a world coordinate system
*  whose y- and z-axis lie in the plane of the calibration plate while the
*  x-axis point 'upwards': cam_H_w = cam_H_cal * RotY(90)
hom_mat3d_identity(HomMat3DIdent)
hom_mat3d_rotate(HomMat3DIdent, rad(90), 'y', 0, 0, 0, \
                 HomMat3DRotateY)
hom_mat3d_compose(cam_H_cal, HomMat3DRotateY, cam_H_w)
*  transform back to pose
hom_mat3d_to_pose(cam_H_w, cam_P_w)
*  use pose to transform an image point into the world coordinate system
image_points_to_world_plane(FinalCamParam, cam_P_w, 87, 23.5, 1, \
                            w_px, w_py)

Beispiel (HDevelop)

camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose,6, \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree around the y-axis to obtain a world coordinate system
*  whose y- and z-axis lie in the plane of the calibration plate while the
*  x-axis point 'upwards': cam_H_w = cam_H_cal * RotY(90)
hom_mat3d_identity(HomMat3DIdent)
hom_mat3d_rotate(HomMat3DIdent, rad(90), 'y', 0, 0, 0, \
                 HomMat3DRotateY)
hom_mat3d_compose(cam_H_cal, HomMat3DRotateY, cam_H_w)
*  transform back to pose
hom_mat3d_to_pose(cam_H_w, cam_P_w)
*  use pose to transform an image point into the world coordinate system
image_points_to_world_plane(FinalCamParam, cam_P_w, 87, 23.5, 1, \
                            w_px, w_py)

Beispiel (C++ (HALCON 5.0-10.0))

HTuple CameraParam, StartPose, FinalPose, Errors, FinalCamParam;
HTuple HomMat3DIdent, HomMat3DRotateY, cam_H_cal, cam_H_w;
HTuple cam_P_w;
HTuple WorldPointsX, WorldPointsY, WorldPointsZ, PixelsRow, PixelsColumn;
HTuple w_px, w_py;
// calibration
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ,
                   PixelsRow, PixelsColumn, CameraParam, StartPose, "pose",
                   &FinalCamParam, &FinalPose, &Errors);
// transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, &cam_H_cal);
//  rotate it 90 degree around the y-axis to obtain a world coordinate system
//  whose y- and z-axis lie in the plane of the calibration plate while the
//  x-axis point 'upwards': cam_H_w = cam_H_cal * RotY(90)
hom_mat3d_identity(&HomMat3DIdent);
hom_mat3d_rotate(HomMat3DIdent, deg(90), 'y', 0, 0, 0, &HomMat3DRotateY);
hom_mat3d_compose(cam_H_cal, HomMat3DRotateY, &cam_H_w);
//  transform back to pose
hom_mat3d_to_pose(&cam_H_w, &cam_P_w);
//  use pose to transform an image point into the world coordinate system
image_points_to_world_plane(FinalCamParam, cam_P_w, 87, 23.5, 1,
                              &w_px, &w_py);

Beispiel (HDevelop)

camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose,6, \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree around the y-axis to obtain a world coordinate system
*  whose y- and z-axis lie in the plane of the calibration plate while the
*  x-axis point 'upwards': cam_H_w = cam_H_cal * RotY(90)
hom_mat3d_identity(HomMat3DIdent)
hom_mat3d_rotate(HomMat3DIdent, rad(90), 'y', 0, 0, 0, \
                 HomMat3DRotateY)
hom_mat3d_compose(cam_H_cal, HomMat3DRotateY, cam_H_w)
*  transform back to pose
hom_mat3d_to_pose(cam_H_w, cam_P_w)
*  use pose to transform an image point into the world coordinate system
image_points_to_world_plane(FinalCamParam, cam_P_w, 87, 23.5, 1, \
                            w_px, w_py)

Beispiel (HDevelop)

camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose,6, \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree around the y-axis to obtain a world coordinate system
*  whose y- and z-axis lie in the plane of the calibration plate while the
*  x-axis point 'upwards': cam_H_w = cam_H_cal * RotY(90)
hom_mat3d_identity(HomMat3DIdent)
hom_mat3d_rotate(HomMat3DIdent, rad(90), 'y', 0, 0, 0, \
                 HomMat3DRotateY)
hom_mat3d_compose(cam_H_cal, HomMat3DRotateY, cam_H_w)
*  transform back to pose
hom_mat3d_to_pose(cam_H_w, cam_P_w)
*  use pose to transform an image point into the world coordinate system
image_points_to_world_plane(FinalCamParam, cam_P_w, 87, 23.5, 1, \
                            w_px, w_py)

Ergebnis

Sind die Parameterwerte korrekt, dann liefert hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPosehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

hom_mat3d_rotatehom_mat3d_rotateHomMat3dRotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotate, hom_mat3d_translatehom_mat3d_translateHomMat3dTranslatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslate, hom_mat3d_inverthom_mat3d_invertHomMat3dInverthom_mat3d_invertHomMat3dInvertHomMat3dInvert

Nachfolger

camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration, write_posewrite_poseWritePosewrite_poseWritePoseWritePose, disp_caltabdisp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab, sim_caltabsim_caltabSimCaltabsim_caltabSimCaltabSimCaltab

Siehe auch

create_posecreate_poseCreatePosecreate_poseCreatePoseCreatePose, camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration, disp_caltabdisp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab, sim_caltabsim_caltabSimCaltabsim_caltabSimCaltabSimCaltab, write_posewrite_poseWritePosewrite_poseWritePoseWritePose, read_poseread_poseReadPoseread_poseReadPoseReadPose, pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3d, project_3d_pointproject_3d_pointProject3dPointproject_3d_pointProject3dPointProject3dPoint, get_line_of_sightget_line_of_sightGetLineOfSightget_line_of_sightGetLineOfSightGetLineOfSight, hom_mat3d_rotatehom_mat3d_rotateHomMat3dRotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotate, hom_mat3d_translatehom_mat3d_translateHomMat3dTranslatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslate, hom_mat3d_inverthom_mat3d_invertHomMat3dInverthom_mat3d_invertHomMat3dInvertHomMat3dInvert, affine_trans_point_3daffine_trans_point_3dAffineTransPoint3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren