-
Notifications
You must be signed in to change notification settings - Fork 0
/
resize.py
47 lines (41 loc) · 1.05 KB
/
resize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#%%
import os
import re
import json
import requests
import random
import time
from tkinter import filedialog
from tkinter import Tk
import cv2 as cv
import matplotlib.pyplot as plt
#%%
#run
#%%
f = open('C:/Users/idmakers/Desktop/image/filename.txt','r')
input_string = f.read()
name = input_string.split()
name.extend("q")
f.close
print(name)
#%%
for i in range(len(name)):
imgname=name[i]
imgname2=name[i+1]
print(imgname)
if imgname =="q":
print("test")
break
else:
img = cv.imread('C:/Users/idmakers/Desktop/image/'+imgname)
img2 =cv.imread('C:/Users/idmakers/Desktop/image/'+imgname2)
img = cv.resize(img,(900,600))
img2 =cv.resize(img,(900,600))
img[:,:,0] = img[:,:,0]*0
img[:,:,1] = img[:,:,1]*0
img[:,:,2] = img[:,:,2]
plt.imshow(cv.cvtColor(img, cv.COLOR_BGR2RGB))
print(imgname+" "+str(i))
print(imgname2+"++ ")
plt.show()
#%%