write_pose ( : : Pose, PoseFile : )

Write a 3D pose to a text file.

write_pose is used to write a 3D pose Pose into a text file with the name PoseFile.

A pose describes a rigid 3D transformation, i.e., a transformation consisting of an arbitrary translation and rotation, with 6 parameters, three for the translation, three for the rotation. With a seventh parameter different pose types can be indicated (see create_pose).

A file generated by write_pose looks like the following:

  # 3D POSE PARAMETERS: rotation and translation

  # Used representation type:
  f 0

  # Rotation angles [deg] or Rodriguez-vector:
  r -17.8134 1.83816 0.288092

  # Translational vector (x y z [m]):
  t 0.280164 0.150644 1.7554


Parameters

Pose (input_control)
pose-array -> real / integer
3D pose.
Number of elements: 7

PoseFile (input_control)
filename -> string
File name of the exterior camera parameters.
Default value: 'campose.dat'
List of values: 'campose.dat', 'campose.initial', 'campose.final'


Example
*  read calibration images
read_image(Image1, 'calib-01') 
read_image(Image2, 'calib-02') 
read_image(Image3, 'calib-03') 
*  find calibration pattern
find_caltab(Image1, Caltab1, 'caltab.descr', 3, 112, 5) 
find_caltab(Image2, Caltab2, 'caltab.descr', 3, 112, 5) 
find_caltab(Image3, Caltab3, 'caltab.descr', 3, 112, 5) 
*  find calibration marks and start poses 
StartCamPar := [0.008, 0.0, 0.000011, 0.000011, 384, 288, 768, 576]
find_marks_and_pose(Image1, Caltab1, 'caltab.descr', StartCamPar,
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord1, CCoord1,
                    StartPose1) 
find_marks_and_pose(Image2, Caltab2, 'caltab.descr', StartCamPar,
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord2, CCoord2,
                    StartPose2) 
find_marks_and_pose(Image3, Caltab3, 'caltab.descr', StartCamPar,
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord3, CCoord3,
                    StartPose3) 
*  read 3D positions of calibration marks
caltab_points('caltab.descr', NX, NY, NZ) 
*  camera calibration
camera_calibration(NX, NY, NZ, [RCoord1, RCoord2, RCoord3],
                   [CCoord1, CCoord2, CCoord3], StartCamPar,
                   [StartPose1, StartPose2, StartPose3], 'all', 
                   CamParam, NFinalPose, Errors) 
*  write exterior camera parameters of first calibration image
write_pose(NFinalPose[0:6], 'campose.dat')

Result

write_pose returns 2 (H_MSG_TRUE) if all parameter values are correct and the file has been written successfully. If necessary an exception handling is raised.


Parallelization Information

write_pose is local and processed completely exclusively without parallelization.


Possible Predecessors

camera_calibration, hom_mat3d_to_pose


See also

create_pose, find_marks_and_pose, camera_calibration, disp_caltab, sim_caltab, read_pose, pose_to_hom_mat3d, hom_mat3d_to_pose


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH