def get_diff(self, delay=0.5): file1 = self.capture_image('1.jpg') sleep(delay) file2 = self.capture_image('2.jpg') self.image1 = Image.open(file1) self.image2 = Image.open(file2) self.diff = motion.images_diff(self.image1, self.image2) return self.diff
def get_diff(self, delay=0.5): print 'Capturing first image' filename1, frame1 = self.capture_image('1') print 'Sleeping for %s' % delay sleep(delay) print 'Capturing second image' filename2, frame2 = self.capture_image('2') print 'Setting images' self.image1 = Image.open(filename1) self.image2 = Image.open(filename2) print 'Getting image diff' self.diff = motion.images_diff(self.image1, self.image2) return self.diff