修改视频旋转角度信息由opencv获取
This commit is contained in:
@ -342,13 +342,14 @@ class LoadImagesAndVideos:
|
|||||||
|
|
||||||
if success:
|
if success:
|
||||||
success, im0 = self.cap.retrieve()
|
success, im0 = self.cap.retrieve()
|
||||||
##======================
|
# ##======================
|
||||||
'''判断视频是否含旋转信息'''
|
# '''判断视频是否含旋转信息'''
|
||||||
rotation = self.get_rotation(path)
|
# rotation = self.get_rotation(path)
|
||||||
if rotation == 270:
|
# print('**********rotation', rotation)
|
||||||
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE)
|
# if rotation == 270:
|
||||||
###======================
|
# im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE)
|
||||||
|
# ###======================
|
||||||
|
print('&&&&&&&&&&&&&&&self.orientation', self.orientation)
|
||||||
if self.orientation == 270:
|
if self.orientation == 270:
|
||||||
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) # for use if cv2 autorotation is False
|
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) # for use if cv2 autorotation is False
|
||||||
|
|
||||||
|
@ -303,12 +303,12 @@ class LoadImages:
|
|||||||
ret_val, im0 = self.cap.read()
|
ret_val, im0 = self.cap.read()
|
||||||
|
|
||||||
self.frame += 1
|
self.frame += 1
|
||||||
##======================
|
# ##======================
|
||||||
'''判断视频是否含旋转信息'''
|
# '''判断视频是否含旋转信息'''
|
||||||
rotation = self.get_rotation(path)
|
# rotation = self.get_rotation(path)
|
||||||
if rotation == 270:
|
# if rotation == 270:
|
||||||
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE)
|
# im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE)
|
||||||
###======================
|
# ###======================
|
||||||
|
|
||||||
if self.orientation == 270:
|
if self.orientation == 270:
|
||||||
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) # for use if cv2 autorotation is False
|
im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) # for use if cv2 autorotation is False
|
||||||
|
Reference in New Issue
Block a user