Re: [CinePaint] Looking for a feature useful to smooth timelapse sequences - grading

"John Arrowwood" <[email protected]>
Newsgroups gmane.comp.video.cinepaint.user
Message-ID <[email protected]>
On 11/22/06, Frank Peters <[email protected]> wrote:
> On Wed, 22 Nov 2006 07:41:40 -0800
> "John Arrowwood" <[email protected]> wrote:
>
> > I once wrote a script that took a timelapse sequence and calculated
> > the 'average' of some number of frames before and after each frame.
> > So I took the 15 frames before and the 15 frames after, or about one
> > second of video time, and took all 31 images and produced an 'average'
> > image.  I then used that as the frame for that moment.  Naturally, I
> > did the same thing with every single frame.  The end result was
> > amazingly smooth.  It was exactly what I wanted, as far as light
> > conditions goes.  The flashes of light were completely gone.  But cars
> > in motion were completely removed from the image, too!  The lighting
> > was perfect, but the action was missing!
> >
> > What I need is to automate the task of taking the actual frame and
> > tweaking it so that its overall appearence most closely matches that
> > average image.  It's just math, right?  It has to be possible!  If I
> > can find a way, then the end result would be as smooth as the average
> > image as far as overall lighting goes, but with all the details of the
> > individual frames intact.
> >
>
> What exactly is this "average" image?  Upon what basis are you
> computing this "average?"

ImageMagick has an 'average' function.  It lets you pass in 2 or more
images, and it comes back with an image where every pixel is the
average of the corresponding pixels in the input images.

> Most likely you need to adjust the histogram of the image
> to correct for any deviation in exposure between adjacent
> frames.

That's EXACTLY what I'm trying to do...

> Cinepaint now includes the script-fu module to
> automate image processing.  You can also consider the NETPBM
> suite (http://netpbm.sourceforge.net).  In particular,
> a utility called "pnmnorm" allows for an automated histogram
> normalization.  Also, the ImageMagick suite (www.imagemagick.com)
> allows for automation in adjusting histograms.

Obviously, I know about ImageMagick.  I was using it.  Unfortunately,
using the histogram normalization doesn't quite work, because it does
some truncation.  And because the histogram curve is not guaranteed to
be exactly where it needs to be from frame to frame.  Mind you, it got
it closer.  But it also had undesirable side-effects.

Picture this:  You are given two images.  Your task is to
AUTOMATICALLY adjust the histogram of the one so that it matches as
closely as possible the second.

I don't want a brute-force approach.  I don't want to experiment on
every frame to try and figure out what settings will work.  I want to
mathematically analyze the frame image and the average image, and
calculate the adjustments that will be necessary in order to bring the
histogram of the frame into alignment with the average.  Now,
mathematically, it's not trivial.  The histograms may have noticably
different shapes.  But the end result should be that if you have a
field of blue, it should, on average, be around the same shade of
blue.  If you have a field of white, it should be around the same
shade of white.  The frame image WILL have more details than the
average, and that's why the histograms won't match exactly.

As much trouble as I'm having just communicating what it is I'm trying
to do, can you see why I am having trouble searching for a tool that
does it?  I don't know, maybe you would call it inter-frame exposure
or levels smoothing or something like that...

-- 
--------------------------------------------------
John Arrowwood
John (at) Arrowwood Photography (dot) com

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.