update,
This commit is contained in:
19
vinniesniper-54816/task1/_tools/crawer/merge copy.py
Normal file
19
vinniesniper-54816/task1/_tools/crawer/merge copy.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
def merge_images(input_folder, output_folder):
|
||||
if not os.path.exists(output_folder):
|
||||
os.mkdir(output_folder)
|
||||
count = 0
|
||||
for root, _, filenames in os.walk(input_folder):
|
||||
for fn in filenames:
|
||||
if fn.endswith('.jpg'):
|
||||
count += 1
|
||||
shutil.copy(os.path.join(root, fn), os.path.join(output_folder, 'c_{:010d}.jpg'.format(count)))
|
||||
|
||||
if __name__ == '__main__':
|
||||
for f in os.listdir('output_mountain'):
|
||||
if f.endswith('.jpg'):
|
||||
os.remove(os.path.join('output_mountain', f))
|
||||
merge_images("/home/logic/_workspace/task-list/servers/logic-NUC8i5BEH/opencv-workdesk/001_monitor/src/003-crawler-mountain/p/mountain", 'output_mountain')
|
Reference in New Issue
Block a user