def drawCross(img, params, center=(100, 100), scale=30.0):
R = cv2.Rodrigues(params[1:4])[0]
points = np.array([[1, 0, 0], [0, -1, 0], [0, 0, -1]])
points = np.dot(points, R.T)
points2D = points[:, :2]
points2D = (points2D * scale + center).astype(np.int32)
cv2.line(img, (center[0], center[1]), (points2D[0, 0], points2D[0, 1]), (255, 0, 0), 3)
cv2.line(img, (center[0], center[1]), (points2D[1, 0], points2D[1, 1]), (0, 255, 0), 3)
cv2.line(img, (center[0], center[1]), (points2D[2, 0], points2D[2, 1]), (0, 0, 255), 3)
评论列表
文章目录