Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- data_file = "Dataset"
- file = open("./"+data_file+"/input_seg.txt", 'r')
- # Enter your name
- out_file = open("./results/almat_kenen_KBTU.txt", 'w')
- for line in file:
- if ".jpg" in line:
- imgPath = "./"+data_file+"/" + line[:-1]
- img = cv2.imread(imgPath)
- line1 = line
- else:
- cords = line[:-1].split(" ")
- y1 = int(cords[0])
- x1 = int(cords[1])
- y2 = int(cords[2])
- x2 = int(cords[3])
- lp_img = img[y1:y2, x1:x2]
- cv2.imshow("LP img", lp_img)
- cv2.waitKey(0)
- out_file.write(line1)
- out_file.write(line)
- out_file.write(out)
- #out_file.write("Here import cv2
- import tools as tl
- import numpy as np
- data_file = "Dataset"
- file = open("./"+data_file+"/input_seg.txt", 'r')
- # Enter your name
- out_file = open("./results/Artur_Abdalimov_KBTU.txt", 'w')
- for line in file:
- if ".jpg" in line:
- imgPath = "./"+data_file+"/" + line[:-1]
- img = cv2.imread(imgPath)
- line1 = line
- else:
- cords = line[:-1].split(" ")
- y1 = int(cords[0])
- x1 = int(cords[1])
- y2 = int(cords[2])
- x2 = int(cords[3])
- ar = [0, 0.12, 0.23, 0.34, 0.43, 0.55, 0.64, 0.74, 0.77, 0.87, 1.0]
- ans = []
- ln = x2 - x1
- for i in range(len(ar)):
- cur = x1 + ln * ar[i]
- ans.append(cur)
- out = " ".join(str(x) for x in ans)
- out_file.write(line1)
- out_file.write(line)
- out_file.write(out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement