0
我正在使用Python,Open,Numpy和Scipy。我有一個我想旋轉某些角度的圖像目錄。我想編寫這個腳本。我正在使用這個,OpenCV Python rotate image by X degrees around specific point,但它似乎沒有像我設想的那樣流暢。我得到一個無效的輪換計劃,但我不認爲我應該得到這個。循環遍歷圖像目錄並將它們全部旋轉x度並保存到目錄
這裏是我的代碼如下所示:
from scipy import ndimage
import numpy as np
import os
import cv2
def main():
outPath = "C:\Miniconda\envs\.."
path = "C:\Miniconda\envs\out\.."
for image_to_rotate in os.listdir(path):
rotated = ndimage.rotate(image_to_rotate, 45)
fullpath = os.path.join(outPath, rotated)
if __name__ == '__main__':
main()