修改视频旋转角度信息由opencv获取

This commit is contained in:
jiajie555
2025-04-27 16:41:56 +08:00
parent e6803a29dd
commit d9129c1ea3
2 changed files with 14 additions and 13 deletions

View File

@ -342,13 +342,14 @@ class LoadImagesAndVideos:
if success:
success, im0 = self.cap.retrieve()
##======================
'''判断视频是否含旋转信息'''
rotation = self.get_rotation(path)
if rotation == 270:
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE)
###======================
# ##======================
# '''判断视频是否含旋转信息'''
# rotation = self.get_rotation(path)
# print('**********rotation', rotation)
# if rotation == 270:
# im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE)
# ###======================
print('&&&&&&&&&&&&&&&self.orientation', self.orientation)
if self.orientation == 270:
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) # for use if cv2 autorotation is False