How to use python to calculate the similarity between two pictures

I have two pictures of the same pixel, both black and white.
it"s just that there is a slight deviation between the two pictures.
was previously used to convert to an array of comparisons, but the position is a little bit off. It"s basically wrong.

is there any way to use the program to identify the degree of similarity between the two pictures?
to cope with a slight position offset, which knowledge points need to be used, please advise

https://codeshelper.com/a/11.
, the great god"s post, is dealt with in terms of color features. But what about black and white?

Mar.28,2021

combine the posts of the two bigwigs.
has finally made a temporary tool. It's just not enough.

http://www.ruanyifeng.com/blo.

Menu