rsmbl / Resemble.js

Image analysis and comparison

Home Page:http://rsmbl.github.io/Resemble.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

REQUEST

myk7hackon opened this issue · comments

Hello..i m new to GitHub community and i shall be really obliged if anyone of you could tell me how this project works...i mean the algorithm used or the idea used to check resemblance between two images. It would be a great help.

Best to have a look at the code. But basically, the code iterates over every pixel in the image (an array of values, Red, Green, Blue, Alpha for each pixel) and then compares those values to the values of the pixel at the same index in the array of the other image. It's not a simple equality check though, it checks that the values are "close enough". There is a subsequent check for anti-aliasing in one or both of the images, where for each pixel all immediately surrounding pixels are checked to see if they are a similar hue (to the source pixel), if a certain number of pixels are of a similar hue the pixel is discarded from the comparison because it is considered unreliable. The anti-aliasing algorithm was developed through trial-and-error with no prior art as reference.