Looking for MD5-like fingerprint for JPG-files

Discussion in 'Perl Misc' started by dede, Feb 3, 2004.

  1. dede

    dede Guest

    Dear all,

    in order to provide a convenient method for photographer like me to
    detect "equal" or "similar" pictures I am trying to develop a perl
    function/method that does exactly this:

    Input: JPG file
    Output: MD5-like fingerprint of JPG (to be stored in a db)

    It should be a hash-value that is very close if two pics are "almost
    identical". It must be robust against at least JPG-rotations
    (90/180/270 degrees) and "reasonable" scalings. The analysis will be
    stored in the EXIF-data of the JPG so the analysed data should be only
    the "naked JPG-data" itself.

    My basic idea is to create a 2-dimensional bitmap that will be
    "normalized", i.e. rotated to a "zero-position" and scaled to let's
    say a 1000x1000 JPG.

    "Sugar" for this algorithm could be robustness against primitiv
    operations like flipping, clipping, changing contrast, watermarking,
    etc.

    Is there anyone in the community who has done this already? Any help
    will be appreciated.

    Thanx in advance. Merci.

    Andreas
     
    dede, Feb 3, 2004
    #1
    1. Advertising

  2. (dede) wrote in news:166f59a6.0402031413.1d41f251
    @posting.google.com:

    > Dear all,
    >
    > in order to provide a convenient method for photographer like me to
    > detect "equal" or "similar" pictures I am trying to develop a perl
    > function/method that does exactly this:
    >
    > Input: JPG file
    > Output: MD5-like fingerprint of JPG (to be stored in a db)


    Well, I don't think you want MD5-like: Those algorithms are designed so
    that small variations in input cause large variations in the output (not
    that I know much).

    > It should be a hash-value that is very close if two pics are "almost
    > identical". It must be robust against at least JPG-rotations
    > (90/180/270 degrees) and "reasonable" scalings. The analysis will be
    > stored in the EXIF-data of the JPG so the analysed data should be only
    > the "naked JPG-data" itself.


    That is not an easy problem since JPEG is a lossy algorithm. This is the
    same issue that crops up in trying to digitally watermark compressed
    music files (again, I do not know that much about this stuff).

    OTOH, I know there is research in this area. Google is your friend.

    http://www.linux-mag.com/2003-08/perl_01.html

    Looks like a promising starting point.

    Sinan
    --
    A. Sinan Unur
    (reverse each component for email address)
     
    A. Sinan Unur, Feb 4, 2004
    #2
    1. Advertising

  3. >>>>> "A" == A Sinan Unur <> writes:

    A> OTOH, I know there is research in this area. Google is your friend.

    A> http://www.linux-mag.com/2003-08/perl_01.html

    Heh. I was just going to suggest my colum, although for many reasons
    I'd direct the user over here:

    <http://www.stonehenge.com/merlyn/LinuxMag/col50.html>

    print "Just another Perl column hacker,"

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
     
    Randal L. Schwartz, Feb 4, 2004
    #3
  4. dede

    Chris Guest

    Randal L. Schwartz wrote:
    >>>>>>"A" == A Sinan Unur <> writes:

    >
    >
    > A> OTOH, I know there is research in this area. Google is your friend.
    >
    > A> http://www.linux-mag.com/2003-08/perl_01.html
    >
    > Heh. I was just going to suggest my colum, although for many reasons
    > I'd direct the user over here:
    >
    > <http://www.stonehenge.com/merlyn/LinuxMag/col50.html>
    >
    > print "Just another Perl column hacker,"
    >


    Ewww. Beat to the punch, right from the horse's mouth... I was going
    to suggest the same column. This question couldn't be a better fit for
    your column. It was the first thing I thought of, which is funny
    because when I read your column, I remember thinking, "Only Randal
    Schwartz would ever want to do something like this ANYWAY..." And looky
    here at this question... :cool:

    Chris
    -----
    Chris Olive
    chris -at- --spammers-are-vermen-- technologEase -dot- com
    http://www.technologEase.com
    (pronounced "technologies")
     
    Chris, Feb 4, 2004
    #4
  5. dede

    dede Guest

    Thank you very much guys!

    I am all the time impressed about the quick and comprehensive response
    I receive from you. I ll try my best "to give something back" :)

    Greetings from Paris, France
    dede

    P.S.: I feel honored by the direct response of Randal himself - Merci!
     
    dede, Feb 6, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roland
    Replies:
    0
    Views:
    1,073
    Roland
    May 12, 2004
  2. Matthias
    Replies:
    5
    Views:
    437
    Whitecrest
    Jun 1, 2004
  3. Replies:
    9
    Views:
    17,115
    John Salerno
    May 8, 2006
  4. pradeep
    Replies:
    5
    Views:
    349
    Vladimir Lushnikov
    Apr 27, 2006
  5. Peter Woodsky

    create a md5 / md5 passwd with a salt

    Peter Woodsky, Nov 20, 2008, in forum: Ruby
    Replies:
    6
    Views:
    220
    Brian Candler
    Nov 21, 2008
Loading...

Share This Page