Page 1 of 1

Composing multiple images

Posted: 2011-09-14T08:45:15-07:00
by lego
Hi,

I don't know how to solve my problem.. I have no idea of image manipulation.. sorry. Probably it' very easy for most of you!

Suppose that I have a photo camera that can take photos every 0.5 s, and I photograph a jump of a motorcycle. Suppose that the jump lasts 3 seconds, so I have 6 images. I would like to compose the 6 images and obtain a result like this:
http://www.showlinephoto.com/fencecheck ... e-jump.jpg

I don't know how to do it with imagemagick.. Any help would be highly appreciated!

Thanks,
Lego.

Re: Composing multiple images

Posted: 2011-09-14T09:50:54-07:00
by Bonzo
Mc Afee did not like that site and the image is not there, only a 404 page.

Re: Composing multiple images

Posted: 2011-09-14T09:54:22-07:00
by fmw42
I don't know how well this will work, but if your camera has not moved so that the ground is not different in each image, then you could try,

convert image1 image2 image3 image4 image5 image6 -evaluate sequence mean result.

see http://www.imagemagick.org/script/comma ... e-sequence

however that will mix each motorcycle with the sky and so look a bit faded. you might have to increase the contrast (-brightness-contrast function)

The best way would be to make a mask (say white) where the motorcycle are located (manually draw around them in some other program like GIMP) with the rest black and then use the masks with convert image 1 image2 mask2 -compose over -composite image3 mask3 -compose over -composite etc result.

see
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/layers/#convert

Re: Composing multiple images

Posted: 2011-09-14T10:18:49-07:00
by Bonzo
I have just remember that Anthony had a background removal example: http://www.imagemagick.org/Usage/compose/#changemask

If you had a photo of the background only you could use that? May take some time to process a photo though.

Re: Composing multiple images

Posted: 2011-09-14T19:16:47-07:00
by anthony
See Photo Handling Double Exposures...
http://www.imagemagick.org/Usage/photos/#double

Basically you either 'average' the images to get 'ghosts', whcih enhances the background the more images you have.

Or you work out various masks to select the component from each image. Typically you again create an average background, then use that to work out the masks for each frame.

Re: Composing multiple images

Posted: 2011-09-14T19:21:40-07:00
by fmw42
If all of the motorcycle and rider were darker than the sky, then you could use

convert image1 image2 image3 image4 image5 image6 -evaluate sequence min result


But unfortunately, the sun is reflecting on the rider making part of him or the cycle brighter than the sky.

Re: Composing multiple images

Posted: 2011-09-15T01:58:38-07:00
by lego
Thank you!!!

Well I didn't had motorcycle photos, this was just an example in order to express my problem.
I tried with

Code: Select all

convert img1 img2 img3 img4 ... -evaluate-sequence mean img-final
but the images looked faded, but with

Code: Select all

convert img1 img2 img3 img4 ... -evaluate-sequence min img-final
the result is just what I wanted!!

Thank you very much!!

Re: Composing multiple images

Posted: 2011-09-15T17:32:18-07:00
by anthony
lego wrote:I tried with

Code: Select all

convert img1 img2 img3 img4 ... -evaluate-sequence mean img-final
but the images looked faded
It is as I said, averaging (mean) will generate a strong background with the moving foreground appearing as 'ghosts'. It is generally used as just one step in a larger process.

The key to getting a perfect layering of all foreground objects, is the generating masks of the the individual objects.

The use of 'min' will work fine but only if the foreground object is completely darker than the background, but it is a step. Be warned however that it could pick one channel value from one image, and another value from the other image. Much like the composition method Lighten and Darken.
http://www.imagemagick.org/Usage/compose/#lighten

The boolean (comparision) composition methods such as ChangeMask, Lighten-Intensity and Darken-Intensity, etc can also help in generating either the final image, or just the masks.
http://www.imagemagick.org/Usage/compos ... _intensity
http://www.imagemagick.org/Usage/compose/#changemask

Re: Composing multiple images

Posted: 2011-09-16T03:25:30-07:00
by lego
Thanks for that information, for the moment I will use the min method, when I have some time I will take a look at those other methods.
Thank you!