Page 1 of 1

time lapse picture

Posted: 2016-01-15T08:22:28-07:00
by lionel
Hi,

I'm new to this forum, but I would like to know how I can use image magick to improve an sequence of images taken at night with a time lapse camera (Rasberry PI) so I can improve the overall quality of the video.

Thanks for your help.
Lionel

Re: time lapse picture

Posted: 2016-01-15T08:50:34-07:00
by snibgo
What don't you like about the quality? What do you want to improve? Adjusting levels or colour balance are two common needs. If you put up a sample image to somewhere like dropbox.com we can be more specific.

With images for a video, we generally want to adjust all the frames in the same way, so some features like "-auto-level" don't work well, but there are workarounds.

Re: time lapse picture

Posted: 2016-01-15T09:24:44-07:00
by lionel
Here is the context:
I'm taking many pictures (with different shutter speed) every 5 min
at night I use a shutter speed of 5 sec and here are two sample picture:
Image
Image

note that I would like to process them with convert version
graphickmagick 1.3.21 2015-02-08 Q16

Re: time lapse picture

Posted: 2016-01-15T09:41:19-07:00
by snibgo
It says:

Code: Select all

You need permission

Want in? Ask the owner for access, or switch to an account with permission.

Re: time lapse picture

Posted: 2016-01-15T09:46:32-07:00
by lionel
Sorry I changed it.

Re: time lapse picture

Posted: 2016-01-15T10:53:51-07:00
by lionel
Here are my two samples
https://drive.google.com/open?id=0B0u3v ... HYtM2kzM2s
https://drive.google.com/open?id=0B0u3v ... UZaWVRSU2c

I don't see the -auto-level as an option in convert or mogrify, but I need to normalize (I guess) the level from picture 50 to 120 for example. It this feasible ?

Re: time lapse picture

Posted: 2016-01-15T11:01:42-07:00
by fmw42
note that I would like to process them with convert version
graphickmagick 1.3.21 2015-02-08 Q16
This is an Imagemagick forum. Graphicsmagick is not the same as Imagemagick. The Imagemagick developers do not maintain GraphicsMagick.

They started out the same, but split off a long time ago and Graphicsmagick has not kept up with the improvements in Imagemagick. So it is likely they do not have -auto-level.

Re: time lapse picture

Posted: 2016-01-15T11:28:33-07:00
by lionel
Sorry I'm not too familiar with Imagemagick, How do I check the version from bash in UbuntuStudio 15.04, since I have both installed ?

Re: time lapse picture

Posted: 2016-01-15T11:55:53-07:00
by fmw42

Code: Select all

convert -version
If if it does not say Imagemagick, then try

Code: Select all

fullpath2/convert -version

Re: time lapse picture

Posted: 2016-01-18T13:33:38-07:00
by lionel
Thanks, I updated my version and now I'm at the proper level.

Version: ImageMagick 6.8.9-9 Q16 i686 2015-01-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib


It seems to work well on multiple pictures.
But is there a way to average the level for multiple consecutive picture which are not all at the same exposure ?

Thanks for your help.

Re: time lapse picture

Posted: 2016-01-18T13:48:48-07:00
by fmw42
Use the mean and standard deviation from the image statistics to match all the images to one common image statistics. See snibgo's page at http://im.snibgo.com/gainbias.htm for the math and examples. You could also get the average of the mean and std from all the images and match each image to that set of statistics

I also have a histmatch script for unix at my link below. It attempts to match the histograms. But I suspect the mean and std technique might be the quickest and safest.

Re: time lapse picture

Posted: 2016-01-18T14:04:31-07:00
by snibgo
There are many possible ways of improving the images, depending on what you want or like. For example, converting to HCL and applying a gamma to lightness works well. While in HCL space, increasing Chroma a little also looks good:

Code: Select all

convert 00090.jpg -colorspace HCL -channel B -gamma 2.6 -channel G -gamma 1.25 +channel -colorspace sRGB out.png
You can use "-gamma X" to change all images to have the same mean, where X is a number:

X = log(old_mean)/log(new_mean)

Re: time lapse picture

Posted: 2016-01-18T15:01:33-07:00
by fmw42
snibgo wrote:
You can use "-gamma X" to change all images to have the same mean, where X is a number:

X = log(old_mean)/log(new_mean)
-auto-gamma does just that for a desired mean of 50%

I wish there was a -define to set the desired mean. But Anthony did not want to add that originally.

My script autogamma allows an arbitrary desired mean.

Re: time lapse picture

Posted: 2016-01-21T08:12:52-07:00
by lionel
I tried both options above and they degrade the original picture. Part of it is better and part of it is degraded.
I tried a few options (auto-level, equalize, auto-gamma, normalize) but none of them is perfect because I work under different light scenarios.
Here is the original captured time-lapse video after ffmpeg put it together, I recorded for 3 days, 24hours, every 3 mins:
https://drive.google.com/file/d/0B0u3vN ... sp=sharing
the normalize gave the best result.
Thanks for your help.
Lionel