XOR-ing and Summing Two Black and White Images
问题 Starting with two images im1 and im2 created with the PIL module, we have the corresponding black and white images, bw_im1 = im1.convert('1') and bw_im2 = im2.convert('1') Each pixel of bw_im2 and bw_im2 is either 0 or 256. Suppose both bw_im2 and bw_im2 have the same size. How do you XOR all the corresponding entries and then sum them up? My Work I wrote the following stub / proof of concept Python program, but worried that using the code (unpacking/translating over) would be complicated.