Closed digitizdat closed 9 years ago
Please also add yourself to the AUTHORS file.
Well, that took more commits that I would like to admit, but it passes all the Travis tests for 2.7 now. I can't tell why it's not passing for 3.2. Have you seen this before?
Thanks for your contribution!
Gladly! Thanks for writing such a useful module!
When comparing many images against many other images, it can save a lot of time to cache SSIM objects. With that in mind I've modified the SSIM.ssim_value() method to recognize when it is passed an SSIM object rather than a regular PIL Image object, and in that case skip the process of building a new SSIM object for it. Now to compare an image to another one that already has an SSIM object created for it, we just pass the img1 member of the second SSIM object to the ssim_value method of the first SSIM object.
The code makes sure that not only is the object passed into ssim_value an SSIM object, but also that the kernel used to create it is the same as the current object.