Log in

View Full Version : removing camera flash(s)


Media
28th January 2006, 03:40
Hi all,
I'm a newbie to AviSynth and I have been lurking for a while searching the archives (without any luck) for a way to remove camera flashes (white frames) and a frame or two after the flash. My experience has been using VirtualDub and VirtualDubMod but haven't done any scripting, and I am hoping someone can recommend where I should start looking. I was thinking AverageLuma and DeleteFrame? Am I on the right track?
Thanks

Mug Funky
28th January 2006, 03:58
deleting the frames is a problem (conditional filter needs to output the same number of frames), but freezeframe'ing the last good one over the flash might work (and you wont lose AV sync), or even motion-interpolating over the flash might work too.

however, it might give poor results on scenechanges... you'd need some reliable way to detect a flash as opposed to a scenechange (try starting with the fact that a flash is always brighter than the adjacent frames, where a scenechange is brighter only half the time, and by a lesser amount).

[edit]

the little scriptlet here might help you. it detects identical frames and replaces them with an interpolated frame. if you mess with the comparison metric and make it compensate more frames, you'll have the outline of what you want

http://forum.doom9.org/showthread.php?p=753779#post753779

Media
28th January 2006, 15:54
Thanks Mug Funky :)
I'll give it a try, and thanks for your help.