opencv_sample/script1.py

21 lines
500 B
Python
Raw Permalink Normal View History

2018-09-10 23:09:39 +03:00
import cv2
import os
path = "media/Screenshot from 2018-07-18 11-41-15.png"
img = cv2.imread(path, 0)
print(type(img))
img_path = "/home/anya/Изображения/"
files = os.listdir(img_path)
for i in files:
img = cv2.imread(img_path + i, 0)
re = cv2.resize(img, (100, 100))
cv2.imshow("Hey", re)
cv2.waitKey(500)
cv2.destroyAllWindows()
cv2.imwrite("media/resized_" + i, re)
# print(list(files) )
# cv2.imshow("fractal", img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()