Similarity between images
Posted: 2014-01-23T15:42:57-07:00
I have an algorithm to find the main product image from an e-commerce product page. Next step is: Given a set of images found in the page, I would like to be able to find out the similarity between those images and the product image that I already have.
So basically, my question would be:
How can use ImageMagick in order to find how similar two images are? I am not really interested in if they look similar on the color, but on the shape and how similar the aspect ratio is between those:
So, for example, on this page: http://www.tactics.com/adidas/busenitz- ... hite-black, the main product image would be:
http://www.tactics.com/a/52ce/2/2.jpg
And similar images would be:
http://w.p.mybuys.com//imgcache/TACTICS ... p90223.jpg
http://w.p.mybuys.com//imgcache/TACTICS ... p93568.jpg
Right now I am just focusing on finding a way to compare the aspect ratios of the images. Since I need to score those images in regards of how close their aspect ratio is to the main image, I would like that value to be between 0 and 1.
So, if I have a main image that is 100x50, and another one that is 200x100, the score should be high, because their aspect ratio is the same. However, if I have 100x50 and 50x100, the score should be low.
Anyway to find these kind of aspect ratio comparisons in ImageMagick?
So basically, my question would be:
How can use ImageMagick in order to find how similar two images are? I am not really interested in if they look similar on the color, but on the shape and how similar the aspect ratio is between those:
So, for example, on this page: http://www.tactics.com/adidas/busenitz- ... hite-black, the main product image would be:
http://www.tactics.com/a/52ce/2/2.jpg
And similar images would be:
http://w.p.mybuys.com//imgcache/TACTICS ... p90223.jpg
http://w.p.mybuys.com//imgcache/TACTICS ... p93568.jpg
Right now I am just focusing on finding a way to compare the aspect ratios of the images. Since I need to score those images in regards of how close their aspect ratio is to the main image, I would like that value to be between 0 and 1.
So, if I have a main image that is 100x50, and another one that is 200x100, the score should be high, because their aspect ratio is the same. However, if I have 100x50 and 50x100, the score should be low.
Anyway to find these kind of aspect ratio comparisons in ImageMagick?