from PIL import Image
import numpy as np
a=np.array(Image.open('scratchpad/cop_fwd_s.png').convert('RGB').resize((360,270)))
b=np.array(Image.open('scratchpad/cop_flip_s.png').convert('RGB').resize((360,270)))
gap=np.full((270,6,3),255,np.uint8)
Image.fromarray(np.concatenate([a,gap,b],axis=1)).save('scratchpad/cop_ab.png')
def stat(x): return "mean=%s greenfrac=%.2f"%(x.reshape(-1,3).mean(0).round(0), ((x[:,:,1]>100)&(x[:,:,0]<80)).mean())
print("forward:",stat(a)); print("flip:   ",stat(b))
print("saved cop_ab.png [forward | flip]")
