Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) 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.

In reply to Re: Re: comparing two images and detecting differences by biosysadmin
in thread comparing two images and detecting differences by moof1138

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found