This is a RISE example script. It should work in itself. You can clone or download the repository. If you have additions to an example which you would like to share, you are welcome to create a Pull Request.
A script which compares images visually and prints the error between them.
Example on how to compare if images are similar visually. The script loads a number of images, shirinks them down, creates a grayscale version and then overlays them with each other. The larger the common area is, the more similar the images are.
- Install the requirements from requirements.txt:
pip install -f requirements.txt
-
Edit the example [Optional]
-
Execute the example:
python compare_images_visually.py
The images used in these example depict Elisabeth Baume-Schneider, a member of the Swiss Federal Council. She is a public figure, all images were downloaded from online newspapers in 2023.