I'm trying to compare shapes in php. I have a database with a lot of images, in those images there is a shape ( mostly in the center of the image ). Now I want to compare those images to a Shape.
The input is a shape (png) that is exact the same size then the images in the database.
I made a function that takes the color of the shape and turns it in black ( and the background in white)
I can compare every pixel in the image and track how many black pixels are the same, but this will take a lot of CPU and I think it will not work every time.
I also can use an another language like python, but I really wanne fix this in PHP. Does anyone has an idea to do this in a practical way?
The anwser in the question "Compare 2 images in php" is different then I expect. I need to compare a part of an image ( in the example the background in white, but it can be there is some noise in the background )