ClassesClasses | | Operators

create_cam_pose_look_at_pointT_create_cam_pose_look_at_pointCreateCamPoseLookAtPointCreateCamPoseLookAtPoint (Operator)

Name

create_cam_pose_look_at_pointT_create_cam_pose_look_at_pointCreateCamPoseLookAtPointCreateCamPoseLookAtPoint — Create a 3D camera pose from camera center and viewing direction.

Signature

create_cam_pose_look_at_point( : : CamPosX, CamPosY, CamPosZ, LookAtX, LookAtY, LookAtZ, RefPlaneNormal, CamRoll : CamPose)

Herror T_create_cam_pose_look_at_point(const Htuple CamPosX, const Htuple CamPosY, const Htuple CamPosZ, const Htuple LookAtX, const Htuple LookAtY, const Htuple LookAtZ, const Htuple RefPlaneNormal, const Htuple CamRoll, Htuple* CamPose)

void CreateCamPoseLookAtPoint(const HTuple& CamPosX, const HTuple& CamPosY, const HTuple& CamPosZ, const HTuple& LookAtX, const HTuple& LookAtY, const HTuple& LookAtZ, const HTuple& RefPlaneNormal, const HTuple& CamRoll, HTuple* CamPose)

static HPoseArray HPose::CreateCamPoseLookAtPoint(const HTuple& CamPosX, const HTuple& CamPosY, const HTuple& CamPosZ, const HTuple& LookAtX, const HTuple& LookAtY, const HTuple& LookAtZ, const HTuple& RefPlaneNormal, const HTuple& CamRoll)

void HPose::CreateCamPoseLookAtPoint(double CamPosX, double CamPosY, double CamPosZ, double LookAtX, double LookAtY, double LookAtZ, const HTuple& RefPlaneNormal, double CamRoll)

static void HOperatorSet.CreateCamPoseLookAtPoint(HTuple camPosX, HTuple camPosY, HTuple camPosZ, HTuple lookAtX, HTuple lookAtY, HTuple lookAtZ, HTuple refPlaneNormal, HTuple camRoll, out HTuple camPose)

static HPose[] HPose.CreateCamPoseLookAtPoint(HTuple camPosX, HTuple camPosY, HTuple camPosZ, HTuple lookAtX, HTuple lookAtY, HTuple lookAtZ, HTuple refPlaneNormal, HTuple camRoll)

void HPose.CreateCamPoseLookAtPoint(double camPosX, double camPosY, double camPosZ, double lookAtX, double lookAtY, double lookAtZ, HTuple refPlaneNormal, double camRoll)

Description

The operator create_cam_pose_look_at_pointcreate_cam_pose_look_at_pointCreateCamPoseLookAtPointCreateCamPoseLookAtPointCreateCamPoseLookAtPoint creates a 3D camera pose with respect to a world coordinate system based on two points and the camera roll angle.

The first of the two points defines the position of the optical center of the camera in the world coordinate system, i.e., the origin of the camera coordinate system. It is given by its three coordinates CamPosXCamPosXCamPosXCamPosXcamPosX, CamPosYCamPosYCamPosYCamPosYcamPosY, and CamPosZCamPosZCamPosZCamPosZcamPosZ. The second of the two points defines the viewing direction of the camera. It represents the point in the world coordinate system at which the camera is to look. It is also specified by its three coordinates LookAtXLookAtXLookAtXLookAtXlookAtX, LookAtYLookAtYLookAtYLookAtYlookAtY, and LookAtZLookAtZLookAtZLookAtZlookAtZ. Consequently, the second point lies on the z axis of the camera coordinate system.

Finally, the remaining degree of freedom to be specified is a rotation of the camera around its z axis, i.e., the roll angle of the camera. To determine this rotation, the normal of a reference plane can be specified in RefPlaneNormalRefPlaneNormalRefPlaneNormalRefPlaneNormalrefPlaneNormal, which defines the reference orientation of the camera. Finally, the camera roll angle can be specified in CamRollCamRollCamRollCamRollcamRoll, which describes a rotation of the camera around its z axis with respect to its reference orientation.

The reference plane can be seen as a plane in the world coordinate system that is parallel to the x axis of the camera (in its reference orientation, i.e., with a roll angle of 0). In an alternative interpretation, the normal vector of the reference plane projected onto the image plane points upwards, i.e., it is mapped to the negative y axis of the camera coordinate system. The parameter RefPlaneNormalRefPlaneNormalRefPlaneNormalRefPlaneNormalrefPlaneNormal may take one of the following values:

'x'"x""x""x""x":

The reference plane is the yz plane of the world coordinate system. The projected x axis of the world coordinate system points upwards in the image plane.

'-x'"-x""-x""-x""-x":

The reference plane is the yz plane of the world coordinate system. The projected x axis of the world coordinate system points downwards in the image plane.

'y'"y""y""y""y":

The reference plane is the xz plane of the world coordinate system. The projected y axis of the world coordinate system points upwards in the image plane.

'-y'"-y""-y""-y""-y":

The reference plane is the xz plane of the world coordinate system. The projected y axis of the world coordinate system points downwards in the image plane.

'z'"z""z""z""z":

The reference plane is the xy plane of the world coordinate system. The projected z axis of the world coordinate system points upwards in the image plane.

'-z'"-z""-z""-z""-z":

The reference plane is the xy plane of the world coordinate system. The projected z axis of the world coordinate system points downwards in the image plane.

Alternatively to the above values, an arbitrary normal vector can be specified in RefPlaneNormalRefPlaneNormalRefPlaneNormalRefPlaneNormalrefPlaneNormal, which is not restricted to the coordinate axes. For this, a tuple of three values representing the three components of the normal vector must be passed.

Note that the position of the optical center and the point at which the camera looks must differ from each other. Furthermore, the normal vector of the reference plane and the z axis of the camera must not be parallel. Otherwise, the camera pose is not well-defined.

create_cam_pose_look_at_pointcreate_cam_pose_look_at_pointCreateCamPoseLookAtPointCreateCamPoseLookAtPointCreateCamPoseLookAtPoint is particularly useful if a 3D object model or a 3D shape model should be visualized from a certain camera position. In this case, the pose that is created by create_cam_pose_look_at_pointcreate_cam_pose_look_at_pointCreateCamPoseLookAtPointCreateCamPoseLookAtPointCreateCamPoseLookAtPoint can be passed to project_object_model_3dproject_object_model_3dProjectObjectModel3dProjectObjectModel3dProjectObjectModel3d or project_shape_model_3dproject_shape_model_3dProjectShapeModel3dProjectShapeModel3dProjectShapeModel3d, respectively.

It is also possible to pass tuples of different length for different input parameters. In this case, internally the maximum number of parameter values over all input control parameters is computed. This number is taken as the number of output camera poses. Then, all input parameters can contain a single value or the same number of values as output camera poses. In the first case, the single value is used for the computation of all camera poses, while in the second case the respective value of the element in the parameter is used for the computation of the corresponding camera pose.

Execution Information

Parameters

CamPosXCamPosXCamPosXCamPosXcamPosX (input_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

X coordinate of the optical center of the camera.

CamPosYCamPosYCamPosYCamPosYcamPosY (input_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Y coordinate of the optical center of the camera.

CamPosZCamPosZCamPosZCamPosZcamPosZ (input_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Z coordinate of the optical center of the camera.

LookAtXLookAtXLookAtXLookAtXlookAtX (input_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

X coordinate of the 3D point to which the camera is directed.

LookAtYLookAtYLookAtYLookAtYlookAtY (input_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Y coordinate of the 3D point to which the camera is directed.

LookAtZLookAtZLookAtZLookAtZlookAtZ (input_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Z coordinate of the 3D point to which the camera is directed.

RefPlaneNormalRefPlaneNormalRefPlaneNormalRefPlaneNormalrefPlaneNormal (input_control)  string-array HTupleHTupleHtuple (string / real) (string / double) (HString / double) (char* / double)

Normal vector of the reference plane (points up).

Default value: '-y' "-y" "-y" "-y" "-y"

List of values: '-x'"-x""-x""-x""-x", '-y'"-y""-y""-y""-y", '-z'"-z""-z""-z""-z", 'x'"x""x""x""x", 'y'"y""y""y""y", 'z'"z""z""z""z"

CamRollCamRollCamRollCamRollcamRoll (input_control)  angle.rad(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Camera roll angle.

Default value: 0

CamPoseCamPoseCamPoseCamPosecamPose (output_control)  pose(-array) HPose, HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

3D camera pose.

Result

If the parameters are valid, the operator create_cam_pose_look_at_pointcreate_cam_pose_look_at_pointCreateCamPoseLookAtPointCreateCamPoseLookAtPointCreateCamPoseLookAtPoint returns the value 2 (H_MSG_TRUE). If necessary an exception is raised. If the parameters are chosen such that the pose is not well defined, the error 8940 is raised.

Possible Predecessors

convert_point_3d_spher_to_cartconvert_point_3d_spher_to_cartConvertPoint3dSpherToCartConvertPoint3dSpherToCartConvertPoint3dSpherToCart

Alternatives

create_posecreate_poseCreatePoseCreatePoseCreatePose

Module

3D Metrology


ClassesClasses | | Operators