SHARE
TWEET

combining

MrDrem Jan 12th, 2017 (edited) 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import os
  2. import glob
  3. import subprocess
  4.    
  5. for i in range(10):
  6.     normal_old = max(glob.iglob('/home/pi/images/regular/*.jpg'), key=os.path.getctime)
  7.     ir_old = max(glob.iglob('/home/pi/images/ir/*.jpg'), key=os.path.getctime)
  8.     cmd = 'gm montage -mode concatenate -tile 2x1 {} {} -append /home/pi/images/combined/{0:04d}.jpg'.format(normal_old, ir_old, i)
  9.     cmd_result = subprocess.run(cmd.split(), stdout=subprocess.PIPE, check=True)
  10.     cmd_result.stdout
RAW Paste Data
Top