Once again I come to the best for my pedestrian question. I'm building a small web app that would be vastly improved by the ability to recognize app icons. I've searched all ove开发者_如何学Cr but haven't found anything that suits my needs.
Basic Experience:
User uploads a screenshot
We extract icons
We return the name of the corresponding app
Here are a few points:
All icons will be grabbed from a screenshot.
All icons will be the same pixel width and height.
All icons will be grabbed from the same location in the screenshot.
All icons need to be matched against a library of icons (around 400 or so).
The app is built in rails so obviously anything with a ruby library is ideal, however, I'm willing to consider any alternate approaches.
Thanks in advance,
Harris
If the size and location of the icons will always be consistent, here's an idea: For each icon in your library of icons get the color of a few sample pixels, maybe 8 or 10 of them. Always the same 8-10 pixel locations. Store those in your database. When a user uploads their screenshot, take samples of the pixels at the same locations. Then search your database for colors that match in the same places. Since the colors might not be an exact match due to compression or other factors you'll need to include a "fudge factor." This shouldn't be too difficult to implement with ImageMagick or any imaging library that lets you grab a pixel color from an image.
精彩评论