Using the SSIM index

Now, we'll repeat the experiment, but this time using the SSIM metric to measure the difference between the reference image and the reconstructed image. To make this happen, we'll modify the definition of getDiff(), as follows:

def getDiff(individual):    return imageTest.getDifference(individual, "SSIM"),

This experiment produced the following side-by-side milestones of the saved images:

Milestone results of Mona Lisa reconstruction using the SSIM index – part 1

The following image shows the results for the following generations:

Milestone results of Mona Lisa reconstruction using the SSIM index – part 2

The result seems ...

Get Hands-On Genetic Algorithms with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.