【问题标题】:VideoCapture display video frame (frontal camera) as 45 degree rotatedVideoCapture 将视频帧(前置摄像头)旋转 45 度
【发布时间】:2023-03-04 12:21:01
【问题描述】:

我正在使用前置手机摄像头录制视频。我尝试在 python 上使用 VideoCapture() opencv 阅读它。

video = cv2.VideoCapture("out.mp4")
cv2.namedWindow("CurrentFrame", cv2.WINDOW_AUTOSIZE)
while True:
     ret,currentFrame = video.read()
     cv2.imshow("CurrentFrame", currentFrame)

框架显示为 45 度旋转 有没有人遇到过这个问题?

【问题讨论】:

    标签: python video-capture opencv3.0


    【解决方案1】:

    使用函数 cv2.flip(frame, axis_parameter) 来旋转你的框架。

     cv2.imshow("CurrentFrame", cv2.flip( currentFrame , -1 ))
    

    关于“-1”作为参数我不确定,你应该选择正确的参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-05-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多