我通过 cv2.calibrateCamera()
函数得到了相机的 3x3
的内参矩阵和 4x3
的外参矩阵。
现在我想要使用这些参数来计算给定坐标在相机帧中的 BEV (Bird Eye View)
变换。
哪个 openCv
函数可以用于计算具有给定点坐标以及相机的 3x3
内参和/或外参矩阵的 BEV
透视变换?
我在以下帖子中发现了相关内容:https://deepnote.com/article/social-distancing-detector/,基于https://www.pyimagesearch.com/2014/08/25/4-point-opencv-getperspective-transform-example/
他们使用 cv2.getPerspectiveTransform()
函数获取一个 3X3
的矩阵,但我不知道该矩阵是否代表相机的 内参
、外参
或其他什么参数。然后,他们使用该矩阵对点列表进行以下变换:
#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
或两者结合使用,而无需重新使用帧,因为我已经将检测/选择的坐标保存在一个数组中。
cv2.findHomography
来完成它。这里涉及到一些技术问题,建议您寻找一些教程。我记得在外面找到了一些非常有趣的教程 :) - Joseph Budinx
、y
、width
和height
。我认为这可以工作。 - Maf