[SOLVED] How to compare two images?
-
I want to compare 2 images to find out if they are the same pixel by pixel..
so 1st thought was to compare them pixel by pixel with "QImage::pixel":http://doc.qt.digia.com/stable/qimage.html#pixel-2
2nd to use the "scanLine":http://doc.qt.digia.com/stable/qimage.html#scanLineis there any other way?
-
What about "QImage::operator==":http://doc.qt.digia.com/stable/qimage.html#operator-eq-eq ?
-
There is another way I heard of... "Perceptual Hash":http://phash.org/ , but never tried it. In any way, pixel by pixel or scanline might be problematic if the size of the 2 images are not the same or the color was modified in any way (e.g. losses).
-
[quote author="sidewinder" date="1360841983"]What about "QImage::operator==":http://doc.qt.digia.com/stable/qimage.html#operator-eq-eq ?[/quote]
Works perfectly and takes only 4 milleseconds to compare 2 images of 300 kb :)
Thank u!