halcon攝像機標定

* create camera setup of three cameras
create_camera_setup_model (3, CameraSetupModelID)

* camera 0 is located in the origin
set_camera_setup_cam_param (CameraSetupModelID, 0, 'area_scan_division',\
                            [0.006, 0, 8.3e-6, 8.3e-6, 512, 384, 1024, 768],\
                            [0, 0, 0, 0, 0, 0, 0])

* camera 1 is shifted 0.07 m in positive x-direction relative to camera 0
set_camera_setup_cam_param (CameraSetupModelID, 1, 'area_scan_division',\
                            [0.006, 0, 8.3e-6, 8.3e-6, 512, 384, 1024, 768],\
                            [0.07, 0, 0, 0, 0, 0, 0])

* camera 2 is shifted 0.1 m in negative y-direction relative to camera 0
set_camera_setup_cam_param (CameraSetupModelID, 2, 'area_scan_division',\
                            [0.006, 0, 8.3e-6, 8.3e-6, 512, 384, 1024, 768],\
                            [0.0, -0.1, 0, 0, 0, 0, 0])

* there is an object, which is 0.5 away from the origin in
* z-direction, and is facing the origin
ObjectPose := [0, 0, 0.5, 180, 0, 0, 0]
* place the setup's origin in the object
set_camera_setup_param (CameraSetupModelID, 'general', 'coord_transf_pose',\
                        ObjectPose)

* now the camera poses are given relative to the object
get_camera_setup_param (CameraSetupModelID, 0, 'pose', CamPose0)
* CamPose0 is equivalent to [0.0, 0.0, 0.5, 180.0, 0.0, 0.0, 0]

get_camera_setup_param (CameraSetupModelID, 1, 'pose', CamPose1)
* CamPose1 is equivalent to [0.07, 0.0, 0.5, 180.0, 0.0, 0.0, 0]

get_camera_setup_param (CameraSetupModelID, 2, 'pose', CamPose2)
* CamPose2 is equivalent to [0.0, 0.1, 0.5, 180.0, 0.0, 0.0, 0]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章