goldskif wrote:Can you advise me how to perform the "-compare" provided that the second image can be shifted to the left-to the right ( -roll ?? )
If you want to do a compared of one small image vs one large image so that it shifts the small image and creates a match score image, then
see
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/#sub-image
my old example is at
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
However, now on newer versions of IM, you need to add -subimage-search to the command.
If you want to compare two same sized images and get the match score image, then expand one image with black in the bottom and right to 2w-1, 2h-1 size. Then do the above compare operation. Example compare an image to itself. zelda3.png is 128x128.
convert zelda3.png -background black -extent 255x255 zelda3_ext.png
compare -metric rmse -subimage-search zelda3_ext.png zelda3.png zelda3_selfmatch.png
0 (0) @ 0,0
This will produce two images -0 and -1. The match score image is -1 the other is the difference image.
The best match is a perfect match is at 0,0 corresponding to no shift (roll)
So just change the images above to some other pair of images such as the two you have above with slight parallax differences. Extend one and use it as the first image in compare and use the other one as the second image in the compare.
Note that this will NOT get you a pixel by pixel disparity image. It just shows the relative matches of the whole image as one is shifted relative to the other.