本帖最后由 lixiangguo 于 2022-8-18 18:37 编辑
双目立体视觉矫正标点板图像后,利用视差可以求标定板的深度信息,但是将或得得标定板mark点坐标转到矫正前的相机坐标系拟合平面后发现法向量的坐标系不在标定板中心了,请问各位大佬这个问题该怎么解决呢?
*获取校正后的图像标定板区域
find_calib_object (ImageRectifiedL, CalibDataRectifiedIDL, 0, 0, 0, ['alpha'], 0.3)
find_calib_object (ImageRectifiedR, CalibDataRectifiedIDR, 0, 0, 0, ['alpha'], 0.3)
*找到校正后图像mark点位置坐标及校正后相机坐标系的objincampose
get_calib_data_observ_points (CalibDataRectifiedIDL, 0, 0, 0, RowRectifiedL, ColumnRectifiedL, IndexRowRectifiedL, PoseRectifiedL)
get_calib_data_observ_points (CalibDataRectifiedIDR, 0, 0, 0, RowRectifiedR, ColumnRectifiedR, IndexRowRectifiedR, PoseRectifiedR)
dm:=ColumnRectifiedR-ColumnRectifiedL
*返回的点是基于校正后的左相机坐标系下的点
disparity_to_point_3d (RectifiedInternalCammParaL, RectifiedInternalCammParaR, RectifiedLPosRectifiedR, RowRectifiedL, ColumnRectifiedL, dm, X1, Y1, Z1)
*转到校正前的左相机坐标系
read_pose (CameraparaPath+'RectifiedToOriginL.dat', RectifiedToOriginL)
pose_to_hom_mat3d (RectifiedToOriginL, HomMat3DL1)
affine_trans_point_3d (HomMat3DL1, X1, Y1, Z1, Ox1, Oy1, Oz1)
*获得拟合校正前左相机坐标系平面以及位姿
gen_object_model_3d_from_points (Ox1, Oy1, Oz1, ObjectModel3DRectified)
fit_primitives_object_model_3d (ObjectModel3DRectified, ['primitive_type'], ['plane'], ObjectModel3DOutRectified)
moments_object_model_3d (ObjectModel3DOutRectified, 'principal_axes', PoseOutO1)
dev_close_window ()
dev_open_window (0, 0, WightWidth*3, WightHeight*3, 'black', WindowHandle4)
read_image (ImageL, './Image/Binocular/Test/L/4' )
dev_set_colored (3)
disp_3d_coord_system (WindowHandle4,StartInterCamParamL , PoseOutO1, 0.6)
|