calibrate_cameras
(CalibDataID, Errors) get_calib_data (CalibDataID, 'camera', 0, 'params', CamParam) NumImage := 11 get_calib_data (CalibDataID, 'calib_obj_pose', [0, NumImage], 'pose', Pose) * To take the thickness of the calibration plate into account, the z-value * of the origin given by the camera pose has to be translated by the * thickness of the calibration plate. * Deactivate the following line if you do not want to add the correction. set_origin_pose (Pose, 0, 0, 0.00075, Pose) * measure the distance between the pitch lines gen_measure_rectangle2 (195, 226, -0.526627271434, 174, 3, 652, 494, 'bilinear', MeasureHandle) measure_pairs (Image, MeasureHandle, 0.5, 5, 'all', 'all', RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, IntraDistance, InterDistance) Row := (RowEdgeFirst+RowEdgeSecond)/2.0 Col := (ColumnEdgeFirst+ColumnEdgeSecond)/2.0 disp_cross (WindowHandle, Row, Col, 6, 0) image_points_to_world_plane (CamParam, Pose, Row, Col, 'mm', X1, Y1) distance_pp (X1[0:4], Y1[0:4], X1[1:5], Y1[1:5], Distance) tuple_mean (Distance, MeanDistance) tuple_deviation (Distance, DeviationDistance) disp_message (WindowHandle, 'Mean distance: '+MeanDistance$'.3f'+'mm +/- '+DeviationDistance$'.3f'+'mm', 'window', 30, 150, 'yellow', 'false') close_measure (MeasureHandle) clear_calib_data (CalibDataID) |
|