|laziness, impatience, and hubris|
Re: Re: comparing two images and detecting differencesby biosysadmin (Deacon)
|on Jan 01, 2004 at 09:46 UTC||Need Help??|
This is definitely a cool problem, here's a possible snag that you may run in to:
"My selected strategy is to reduce each image to a 4-by-4 grid of RGB values, yielding a 48-number vector of values from 0 to 255."
Assuming that the counterfeits would at least have similar color schemes to the originals, this has a very good chance of generating a lot of falsely positive matches. You could get around this by increasing the size of the grid (and therefore the length of your vectors), but this is the kind of algorithm in which C/C++ would probably outperform Perl (although you could check out the pdl). Even after making your vectors then you're left with the task of determining a metric for measuring similarity of vectors and deciding how similar two vectors must be in order to assume that they point to the same type of coin.
Here's what I think that I would do:
- Play with generating vectors using the method from Merlyn's article until you find an acceptable balance of speed and sensitivity.
- Use a measure of similarity between vectors (such as Euclidean distance) and compare different images of the same coin.
- Attempt to determine a reasonable threshold for assuming that they point to a counterfeit copy of the same type of coin.
Actually, more realistically I'd put this off until after vacation, when I could go back and ask an imaging scientist friend about the problem. :)
Good luck, and have fun.