

一 平移标定
- 到第一个原点位置,拍照,直接获取9个mark的像素坐标
- 再移动标定对象(和机械手固定住),到这9个物理位置,记录物理坐标。(不用对应的像素坐标)
- 再进行平移标定
read_image (Image, 'KinectScreenshot-Color-11-19-13')
rgb1_to_gray (Image, GrayImage)
threshold (GrayImage, Region, 0, 60)
connection (Region, ConnectedRegions)
PixelRow:= [213.292,214.673,216.293,512.318]
PixelColumn := [1647.45,1424.27,1200.09,1202.62]
RobotRow := [-1057.424,-1059.365,-1057.136,-1134.730]
RobotColumn :=[33.348,89.841,148.286,148.335]
** 构建仿射变换矩阵
vector_to_hom_mat2d (PixelRow, PixelColumn, RobotRow, RobotColumn, HomMat2D)
*保存矩阵
write_tuple (HomMat2D, '九点标定.tup')
二 定位
read_image (Image, 'KinectScreenshot-Color-11-48-42')
read_tuple ('九点标定.tup', HomMat2D)
* 651 1639
y := 651
x := 1639
affine_trans_point_2d (HomMat2D, y, x, Qx, Qy)