I am trying to compare shapes in php. I have a database with a large number of images, these images have a form (mainly in the center of the image). Now I want to compare these images with a figure.
Input is a form (png) that is exactly the same size as the images in the database.
I made a function that takes the form color and turns it into black (and the background in white)
The input is as follows: 
The original looks like this: 
I can compare every pixel in the image and keep track of how many black pixels are the same, but this will require a lot of processor, and I think that it will not work every time.
I can also use another language, for example python, but I really fix this in PHP. Does anyone have an idea to do this in a practical way?
Anderser in the question " Compare 2 images in php " is different from what I expect. I need to compare part of the image (in the example, the background is white, but there may be some noise in it)
source share