21 lines
500 B
Python
21 lines
500 B
Python
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()
|