Page 1 of 1

Merge nearly same images into a better one

Posted: 2011-03-25T10:57:03-07:00
by PASDUCLAC
New on this forum (just discovering IM)
I have 10 images scanned from an old B/W old movie (really old) . The camera was fixed. Each image seems very close to each other. But one can have scratches, dust, halo and the other nothing at the same place. Of course, the image are not at the same place and the exact match can vary with perhaps up to 50 pixels (up, down , left, right)
I have 2 questions .
1)Considering 2 images, is it possible to find the best displacement (on X and Y) for the second one to 'best fit' on the first one. Using correlate ? Other techniques ?
2) Having now some images (3 or 4) 'best fitted' is it possible to find the best ... something like 'the most probable pixel' of the series to produce the most probable best image ???
Thanks in advance

Pascal

Re: Merge nearly same images into a better one

Posted: 2011-03-25T11:11:14-07:00
by fmw42
PASDUCLAC wrote:New on this forum (just discovering IM)
I have 10 images scanned from an old B/W old movie (really old) . The camera was fixed. Each image seems very close to each other. But one can have scratches, dust, halo and the other nothing at the same place. Of course, the image are not at the same place and the exact match can vary with perhaps up to 50 pixels (up, down , left, right)
I have 2 questions .
1)Considering 2 images, is it possible to find the best displacement (on X and Y) for the second one to 'best fit' on the first one. Using correlate ? Other techniques ?
2) Having now some images (3 or 4) 'best fitted' is it possible to find the best ... something like 'the most probable pixel' of the series to produce the most probable best image ???
Thanks in advance

Pascal

1) If one image is smaller than the other, then you can use compare -metric rmse -subimage-search largeimage smallimage resultimage to get the best match (or my script normcrosscor that works in the FFT domain). Or you can write your own script to do simple cross-correlate in the FFT domain.

see viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
and
http://www.fmwconcepts.com/imagemagick/ ... mcrosscorr

2) Is very hard and I know of no way to tell which is best? Presumably you need to average each image or take the median between each image on a pixel by pixel basis. See -evaluate-sequence mean or median at http://www.imagemagick.org/script/comma ... e-sequence.

PS. the images will need to be different sizes for 1) and the same size for 2). So you will need to crop appropriately.

Re: Merge nearly same images into a better one

Posted: 2011-03-25T23:07:51-07:00
by anthony
Really the problem more aligning the various images so you can then 'average' or some how merge the images correctly.

This can be tricky, especially if the image size and distortions can vary a bit.

I'd like to see what others have to say first.