View Full Version : looking for a (per frame) histogram stretch/equalization filter for VDub or Avisynth
Flexy
22nd February 2004, 05:26
hi,
i am looking for a dynamic filter/plug-in (VDubmod/Avisytnth) which stretches/equalizes the histogram of a video on a per frame basis.
(Means it should do an automatic contrast stretch depending on the vid contents/scene.)
All contrast/brightness filters i have/found are a 'set it one time' only....but this is only good for like one scene - when the lighting is different in another scene the settings wont work well. I need a automatic filter !
Thanks !
Wilbert
22nd February 2004, 15:18
If there are no responses, we will move it to the vdub forum ...
Didée
22nd February 2004, 16:02
For histogram equalizing, I' not aware of any solution for Vdub or AviSynth.
Per-frame histogram stretching can easily be done with ColorYUV(autogain=true) in AviSynth. However, don't expect any magic. Each single frame will be adjusted to use full range. Now imagine a scene in a disco, with flashing light conditions. Autogaining will totally spoil that scene.
Theoretically, one would need to evaluate the used levels over a FIFO buffered sequence of frames, and adjust the levels according to that measurement. (Somewhat similar to one-pass rate control in video codecs.)
- Didée
[edit] More detailed idea:
There is one - sometimes extremely useful - feature that no AviSynth filter offers, except for "SmartDecimate":
The possibility to feed not only one, but *two* clips into a filter. Then, instead of simply applying its work to the input clip, the analyzation of "what-is-to-be-done" is performed on input clip #1, but the actual processing is done on input clip #2.
Assuming this feature was available, one could do something like e.g.
ColorYUV( input1=last.temporalsoften(25), input2=last, autogain=true )
Alas we actually can't do so.
rfmmars
23rd February 2004, 06:42
Yes there is a very good one......it is based on the ACD-see which has no settings but was a good start. The new one EOD (Call AutoLevels) which has alot of setting to play with. I use it in my business for 8mm & 16mm movie color and dynamic range restoration. I would say it gets it right 97% of the time.
It can be used for vhs tape too. The only thing is that is must be the first plug-in.
Richard
photorecall.net
Flexy
23rd February 2004, 06:58
Now imagine a scene in a disco, with flashing light conditions. Autogaining will totally spoil that scene.
hi,
yeah..i totally see the problem...so 'per frame' basis proably would be too easy and not really practicable.
rfmmars,cant really follow you...you're talking about an available plug-in which comes with acdsee (which i have btw) ?
regarding FIFO...hope i get this right....yes..i think a solution definetly would have to read a number of frames (eg. over one second or longer) to get an impression of overall lighting of a scence.
Would not work in ALL circumstances, and you might also NOT want to apply this to all your clips..but would definetly be helpful in many cases.
echooff
23rd February 2004, 14:26
@rfmmars
Do you have a link for this filter? Any starting point for vhs settings?
rfmmars
23rd February 2004, 15:05
I thought I got it from Donald Graft's other filter site for VD plug-ins. Try searching using EOD, autolevels, or ACD-see. If you can't find it, send me a e-mail at rfmmars@cox.net and I will attach it.
The settings are as follows
White input level
Black input level
Gain
White expand
Black expand
Red level
Green level
Blue level
The old ACD see filter had no adjustment and the only problem was when you had a black scene, it whet to full gain.
It seems that the wrost the source is the better it works. It has a preview, and it neat just to sit back and watch the before and after in Virtualdub dual windows.
I usually follow it with a gamma streach. Remember it has to be the first filter, the old ACD-see didn't
Richard
echooff
23rd February 2004, 16:38
Thanx
Arachnotron
23rd February 2004, 23:09
Try here (http://eodvdf.cjb.net/) for EOD
(Don't know if this is the same one)
rfmmars
24th February 2004, 01:50
That's it. I tried to find this for you earlier today but all the links I found were dead. Have fun. If you need the orginal filter, e-mail me.
Richard
Flexy
25th February 2004, 09:17
That filter is 'good', because it basically does what i was loking for.
But...he (the second guy with the 'enhanced version', link on the same page) made ne BIG mistake....and i just wish i would have the time to re-code the filter because the source is available.
He said he stretches the R, G and B seperately, which (immediately) made me think ('uh uh') - because if he stretches the RGB *seperate* it means automatically it WILL have the wrong color balance. (AS opposite to the original).
He *has to* do a contrast stretch based on Luminance, or however he does it and leave color-balance like it is in the original.
Ad..voila....running the filter thru some first tests showed me exactly this: Various color-balances from scene to scene, sometimes from frame to frame.
Request: Some would have to re-write the filter
Filter: http://eodvdf.narod.ru/AutoLevels.rar
Source: http://eodvdf.narod.ru/AutoLevelsSrc.rar
so it uses luminance..then it would be VERY, VERY useful :)
trevlac
25th February 2004, 16:10
Have you looked at Grafts one?
http://neuron2.net/histogram.html
From a quick look i'd say it does auto gain using luma. Luma does seem to be calculated by 709 spec (not 601). He uses the term 'global histogram', but looking at the source, it seems he does a new one each frame.
I've never used the filter.
rfmmars
25th February 2004, 18:32
Flexy....... I think you will be suprise how good the color balance is, in fact thats the thing I use the most.
I would love for you to recode this to your ideas, it is always good to have fresh minds working.
Richard
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.