Results 1 to 3 of 3

Thread: Calculate hash of an Image?

  1. #1
    Join Date
    Sep 2011
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Maemo/MeeGo

    Default Calculate hash of an Image?

    hi all,

    i am trying to compare 2 images in an efficient manner using Qt/c++, how can i find the hash of an image?

    i found this class QCryptographicHash that can be used but i am not sure, if this can be used then how do i convet the image say a Qimage to QByteArray?

    Is there any thing similar available in c++?

    thank u

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Calculate hash of an Image?

    how do i convet the image say a Qimage to QByteArray?
    QImage has constBits() method that returns the pixel data, you can use it to construct the QByteArray, which you can pass to QCrypthographicHash.
    Is there any thing similar available in c++?
    C++ is a programming language, it has no built-in support for image processing.

  3. #3
    Join Date
    Oct 2011
    Posts
    1
    Qt products
    Qt3
    Platforms
    MacOS X

    Default Re: Calculate hash of an Image?

    If you're just comparing images, QImage::cacheKey may be what you're looking for.

Similar Threads

  1. How to get sha1 hash
    By lyuts in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2012, 15:35
  2. override hash set and equals problem
    By mickey in forum General Programming
    Replies: 1
    Last Post: 9th September 2010, 18:28
  3. Hash a file with QT
    By manekineko in forum Qt Programming
    Replies: 5
    Last Post: 21st April 2010, 06:55
  4. Basic hash problem
    By feraudyh in forum Newbie
    Replies: 6
    Last Post: 4th December 2009, 08:59
  5. Are there functions to make md5 hash
    By learning_qt in forum Qt Programming
    Replies: 8
    Last Post: 22nd July 2009, 04:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.