【发布时间】:2021-03-22 21:18:09
【问题描述】:
我的相机有3x3intrinsics和4x3extrinsics矩阵,通过cv2.calibrateCamera()获得
现在我想使用这些参数来计算从相机获得的帧中任何给定坐标的BEV (Bird Eye View) 变换。
哪个openCv函数可用于计算给定点坐标和相机extrinsics和/或intrinsics3x3 matrices的BEV透视变换?
我在以下帖子中发现了一些非常相关的内容:https://deepnote.com/article/social-distancing-detector/ 基于https://www.pyimagesearch.com/2014/08/25/4-point-opencv-getperspective-transform-example/,
他们使用cv2.getPerspectiveTransform() 来获得3X3 matrix,但我不知道这个矩阵是否代表intrinsics、extrinsecs 或其他东西。然后他们通过以下方式使用这样的矩阵转换点列表:
#Assuming list_downoids is the list of points to be transformed and matrix is the one obtained above
list_points_to_detect = np.float32(list_downoids).reshape(-1, 1, 2)
transformed_points = cv2.perspectiveTransform(list_points_to_detect, matrix)
我真的需要知道是否可以使用cv2.perspectiveTransform 函数来计算转换,或者是否有其他更好的方法可以使用extrinsics、intrinsics 或两者兼而有之,而无需重复使用框架,因为我已经将检测到/选择的坐标保存在数组中。
【问题讨论】:
标签: python-3.x matrix computer-vision cv2 camera-calibration