VideoCapture显示视频帧(前置摄像头)旋转45度

问题描述 投票:0回答:1

我正用我的正面手机摄像头录制视频。我尝试在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个回答
0
投票

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

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

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

© www.soinside.com 2019 - 2024. All rights reserved.