Page 1 of 1

Display difference of two images

Posted: 2018-06-20T20:40:04-07:00
by ertank
Hello,

I have rather odd request. Below are two images, there is seemingly a software which produces 3rd image (the difference). I could not understand what method they use. Asking in here with the hope someone may understand it better than me.

Background information: There are car repair shops or maintenance places. They are taking picture of the bottom of a car. Next visit, another picture taken and people would like to see what has changed. How that picture taken is not known to me. Seems like a fish eye lens, or a stitch of several pictures.

Image 1: https://imgur.com/a/qABBRjD
Image 2: https://imgur.com/a/TH9xVoz
Difference of 1 and 2: https://imgur.com/a/LXsQkKx

Any help is appreciated.

Thanks.

Re: Display difference of two images

Posted: 2018-06-20T20:55:08-07:00
by fmw42
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown

If the two images are perfectly aligned with each other, you can use the compare function or -compose difference -composite.

See
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#difference


Your images are not well aligned nor the same size. So you will see lots of differences.

Unix syntax:

Input:
Image

Image


Darker Red is more different:

Code: Select all

compare -metric rmse image1.jpg image2.jpg diff.png
Image

Blue is more different than red:

Code: Select all

convert image1.jpg image2.jpg -compose difference -composite \
\( xc:red xc:orange xc:yellow xc:green1 xc:cyan xc:blue xc:blueviolet \
+append -filter Cubic -resize 512x1! \) \
-clut diff2.png
Image