View Full Version : Averaging brightness?
Skul 9
13th May 2005, 20:33
I have some time lapse video where the auto-iris was not consistant resulting in the brightness jumping up and down from frame to frame. It's a minor amount but it is noticeable.
What filter should I use that will analyse the brightness of each frame and adjust it so that all frames have the same level, preferably one that I can set or at least be able to average it over the entire video?
Leo 69
13th May 2005, 23:34
http://forum.doom9.org/showthread.php?s=&threadid=93571
Play with its settings a bit ;-) I hope it helps
Skul 9
14th May 2005, 02:54
I've tried HDR-AGC but I can't get it to average the entire frame.
Ideally I would like a filter where you could specify by x\y coordinates a small area in the frame that stays static, like a wall, and use it to evaluate the luminance level.
That way, things like a big white truck driving by won't skew the overall luminance in a filter that might judge the overall frame.
sh0dan
14th May 2005, 03:12
Something like this perhaps:
global compensate = 0 #Will be overridden by conditional filter
global areamedian = 128 #Adjust to fit your images 0->255
v = avisource("...")
analyzeMe = Crop(v,0,0,64,64) # Area to analyze. Adjust 0,0 to a uniform colored area.
v = scriptclip(v, "Coloryuv(off_y=compensate)")
v = v.FrameEvaluate("compensate = areamedian - YPlaneMedian(analyzeMe)")
(Not tested at all)
Skul 9
14th May 2005, 05:59
I ran it but it's giving me an error that's hard to read. I'm a newb so I hope I am doing the right thing. When I first ran it it said "the scripts return value was not a video clip. I added "return(v)" (hope that's right?) and now virtualmod displays the video in the preview window but at the top it says something like this "E\MinMax:image must be planar!" with something else written underneath it so it hard to read. Below this line it reads "([ScriptClip], Line 1)"
Wilbert
14th May 2005, 14:37
Scriptclip needs YV12. Try
...
v = avisource("...").ConvertToYV12
...
Skul 9
15th May 2005, 03:23
That did it. Script worked perfect. Thanks everyone!
Skul 9
15th May 2005, 22:07
Video (http://rapidshare.de/files/1767386/TL_side_by_side.wmv.html)
Here's a side by side comparison of before and after the filter was applied. Scroll to bottom of the page and click the "free" button, scroll to bottom again and wait for link to video.
FredThompson
18th May 2005, 08:09
Whoa, this looks really cool. I've got some NTSC DV shot at a trade show in Paris 2 years ago. Some of the light is natural, some is flourescent. The flourescent pulses at 50 Hz. From looking at the sample video, there just might be a way to "rescue" the video. Boy! This is wonderful!
HighInBC
19th May 2005, 15:29
It truly amazes me how new video technology is forming so fast... I am sure there are large end production companies that don't know this one yet.
FredThompson
8th June 2005, 10:10
OK, I'm stumped. This isn't working with my DV at all. Why the heck does the script puke with a report that the returned argument is not a clip?
global compensate = 0
global areamedian = 128
v = AVISource("flicker.avi").ConvertToYV12()
analyzeMe = Crop(v,528,42,34,34)
v = scriptclip(v, "Coloryuv(off_y=compensate)")
v = v.FrameEvaluate("compensate = areamedian - YPlaneMedian(analyzeMe)")
actually, this will make it puke:
v = AVISource("flicker.avi")
huh?
Wilbert
8th June 2005, 10:36
It pukes, because no clip is returned in the last line, try
global compensate = 0
global areamedian = 128
v = AVISource("flicker.avi").ConvertToYV12()
analyzeMe = Crop(v,528,42,34,34)
v = scriptclip(v, "Coloryuv(off_y=compensate)")
v = v.FrameEvaluate("compensate = areamedian - YPlaneMedian(analyzeMe)")
return v
FredThompson
8th June 2005, 10:47
Oh, geez, what an obvious thing to miss. Think I'll slinnnk off now and get some sleep.http://home.mindspring.com/~fredthompson/Smiley-HeadSlap.gif
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.