优化图片旋转的判断
This commit is contained in:
@@ -111,7 +111,7 @@ def rotate(image, angle):
|
|||||||
:param angle: 逆时针旋转角度
|
:param angle: 逆时针旋转角度
|
||||||
:return: 旋转后的图片NumPy数组
|
:return: 旋转后的图片NumPy数组
|
||||||
"""
|
"""
|
||||||
if angle == 0:
|
if angle == 0 or image is None or image.size == 0:
|
||||||
return image
|
return image
|
||||||
height, width = image.shape[:2]
|
height, width = image.shape[:2]
|
||||||
if angle == 180:
|
if angle == 180:
|
||||||
|
|||||||
Reference in New Issue
Block a user