first
This commit is contained in:
1 parent
54ccfb11fe
commit
a0818377bb
194 files changed
+41681
-262
No files matched your search
+7
-5
@@ -1,7 +1,8 @@
|
||||
import os
|
||||
import cv2
|
||||
root_path = "/data1/Hatcher/model/data_MPKFNet/con/FFOutput(1)/"
|
||||
result_path = "/data1/Hatcher/model/data_MPKFNet/con/result/"
|
||||
root_path = "/data/Hatcher/con/8227/"
|
||||
result_path = "/data/Hatcher/con/result/"
|
||||
site = [[20,20,110,103],[111,20 , 225,103],[264,20 , 396,103],[416,20 , 550,103],[552,20 , 690,103],[720,20 , 850,103],[872,20 , 1000,103]]
|
||||
if not os.path.exists(result_path):
|
||||
os.mkdir(result_path)
|
||||
file_list = os.listdir(root_path)
|
||||
@@ -11,6 +12,7 @@ for file_path in file_list:
|
||||
for image_path in image_list:
|
||||
print(image_path)
|
||||
img = cv2.imread(os.path.join(os.path.join(root_path,file_path),image_path))
|
||||
Img = img.copy()[20:96, 806:903, :]
|
||||
cv2.imwrite(os.path.join(result_path,"{}.jpg".format(str(num).zfill(4))),Img)
|
||||
num+=1
|
||||
for site_1 in site:
|
||||
Img = img.copy()[site_1[1]:site_1[3], site_1[0]:site_1[2], :]
|
||||
cv2.imwrite(os.path.join(result_path,"{}.jpg".format(str(num).zfill(4))),Img)
|
||||
num+=1
|
||||
Reference in new issue
Block a user