Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th February 2005, 02:50   #61  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
I notice it too and argee with dvwannab.
Backwoods is offline   Reply With Quote
Old 20th February 2005, 02:51   #62  |  Link
KaiserS
Guest
 
Posts: n/a
And if you want it displayed out numerically here you go:

*Removed pics see below*

As this shows, there is no difference between the color channels at all. The only difference is in the luma channel, but like I said before this is only at the outlying part due to the EE removal.

Last edited by KaiserS; 20th February 2005 at 06:30.
  Reply With Quote
Old 20th February 2005, 02:53   #63  |  Link
KaiserS
Guest
 
Posts: n/a
Quote:
Originally posted by Backwoods
I notice it too and argee with dvwannab.
Except as I've showed in 2 examples there is no change in the color channels, as BlindDeHalo and LS don't work on the chroma only luma, so this notion that the second is "washed-out" is completely untrue. The only difference between the pics is in the luma channel and only in the outlying parts where the EE was removed. I don't deny that he may percieve a difference, but in reality there isn't and the histograms and the output from ColorYUV show this.

I think you two may want to give this page: http://www.videophile.info/Guide_EE/Page_01.htm a look at.

Last edited by KaiserS; 20th February 2005 at 03:05.
  Reply With Quote
Old 20th February 2005, 03:17   #64  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
After flipping the two images back and forth between each other, I see the differences more now. In the thread the source appears to be sharper and more vibrant of colours, but also it appears you did get rid of the EE at a cost of dimming the black lines.
Backwoods is offline   Reply With Quote
Old 20th February 2005, 05:03   #65  |  Link
KaiserS
Guest
 
Posts: n/a
Quote:
Originally posted by Backwoods
In the thread the source appears to be sharper and more vibrant of colours, but also it appears you did get rid of the EE at a cost of dimming the black lines.
Of course it appears sharper thats what EE is used for but in reality it isn't really sharper, sharpness being defined by level of detail, it just gives the appearance of sharpness (look at the first example on the link I posted and it shows what I'm talking about). And yes, the thinning of the lines is a result of BlindDeHalo, but with something like FastLineDarken they can be darkened and thickened up. For me, I like the look of it with thinner lines then the thick ones, but that's just me. And since the color channels aren't being modified its impossible for one to look more vibrant then the other (if the chroma channels were being modified I could see where you are coming from but they are untouched).

If the source hadn't had any EE applied to it, it would have looked more like the 2nd pictures (minus the thinner lines).

Last edited by KaiserS; 20th February 2005 at 06:34.
  Reply With Quote
Old 20th February 2005, 05:52   #66  |  Link
KaiserS
Guest
 
Posts: n/a
Rather then working off the pngs provided by ATM, since I have to do a ConvertToYV12 to do the the analysis, and since I have the R2 DVDs as well so I'll just use my DVDs instead.

Source:



Filtered with BlindDeHalo2(2.5,2.5,160) & LimitedSharpen(ss_x=2.0,ss_y=2.0,Smode=3,strength=100)
& FastLineDarken(strength=100):



Notice how the color channels aren't being changed at all, as like I said before neither BlindDeHalo or LS work on the chroma channel, and the only difference in the loose min and max between the source and filtered is the upper end of the luma which is due to the bright halos being removed. So while you may think that the colors are different in one from the other they aren't otherwise there would be a difference between the color channels given by ColorYUV.

Last edited by KaiserS; 20th February 2005 at 06:37.
  Reply With Quote
Old 20th February 2005, 07:54   #67  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Yes I realize that after the first reply you mentioned. I stand corrected. In this case the EE worked, it fooled me into thinking it was sharper.

Your filtering does correct the image and the black lines seem to fit in more with the overall image but still looked bland. I've heard of FastLineDarken and was going to mention it in my post but I forgot the exact name of the filter (or is it script?). It really makes a difference to your final product. Whenever I watch anime and notice EE (didn't know it was EE) I figured it was how cells looked on the painted backgrounds while being photographed to film. Didn't know it was actually EE. With FastLineDarken, great results.
Backwoods is offline   Reply With Quote
Old 20th February 2005, 08:04   #68  |  Link
KaiserS
Guest
 
Posts: n/a
Quote:
Originally posted by Backwoods
Yes I realize that after the first reply you mentioned. I stand corrected. In this case the EE worked, it fooled me into thinking it was sharper.
Yep and if you watch dvds like this on a normal interlaced set you might not even notice the EE. When watching these discs on a Hi-def 60" screen the haloing on these discs becomes quite noticeable and distracting. At some point when I get a dual layer burner I'm going to reauthor the discs using this filter chain which should make it a bit more pleasant to watch on the big screen tv.
  Reply With Quote
Old 22nd February 2005, 16:06   #69  |  Link
dvwannab
Registered User
 
Join Date: Feb 2002
Posts: 76
yes...I stand corrected

thanks for the detailed explanation KaiserS. I definitely see what you are talking about. Thanks for the educational lesson. Much appreciated.

I assume the EE-effect is also present in broadcast TV mpeg2 captures as well? No?

Last edited by dvwannab; 22nd February 2005 at 16:09.
dvwannab is offline   Reply With Quote
Old 9th March 2005, 15:11   #70  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
To my own surprise, I had some free time yesterday evening. So here is BDH's third incarnation:

BlindDeHalo3

Basically, it does the same as the 2nd version did. New are some tweaking possibilities (partly backported from BDH's initial version), an optional "postprocessing" mode, and ... better performance.

Feeding a cropped 720*432 DVD source, my Athlon XP1800 renders like this:

BDH2: ~10 fps
BDH3: ~25 fps (without PP)

I hope there are no objections against this minor performance increase

With PP activated, the performance gain is smaller: ~13 fps in above example. Also, I'm not yet really satisfied with the PP mode. But it may come handy in its current state already, and I don't want to keep that speedy version back from you, just because of that.

Let's start with parameters and explanations. The function comes at the end, as usual.

Full function call with default values:
Code:
BlindDeHalo3( rx=3.0, ry=3.0, strength=125, 
 \            lodamp=0.0, hidamp=0.0, sharpness=0.0, tweaker=0.0,
 \            PPmode=0, PPlimit=0, interlaced=false)
Parameter description

rx, ry [float]
The radii to use for the [quasi-] gaussian blur, on which the halo removal is based..

strength [int]
The overall strength of the halo removal effect.

lodamp, hidamp [float] (range: 0.0 ~ ??? / try 4.0 as a start)
With these two values, one can reduce the basic effect on areas that would change only little anyway (lodamp), and/or on areas that would change very much (hidamp).
lodamp does a reasonable job in keeping more detail in affected areas.
hidamp is intended to keep rather small areas that are very bright or very dark from getting processed too strong. Works OK on sources that contain only weak haloing - for sources with strong oversharpening, it should not be used, mostly.
(Usage has zero impact on speed.)

sharpness [float] (range: 0.0 ~ 1.58)
By setting this bigger than 0.0, the affected areas will come out with better sharpness. However, strength must be chosen somewhat bigger as well, then, to get the same effect than without.
(This is the same as initial version's "maskblur" option.)

tweaker [float] (range: 0.0 ~ 1.0)
May be used to get a stronger effect, seperately from altering "strenght".
(Also in accordance to initial version's working methodology. I had no better idea for naming this parameter.)

interlaced [bool]
As formerly, this is intended for sources that were originally interlaced, but then made progressive by deinterlacing. It aims in particular at clips that made their way through Restore24.

PPmode [int]
When set to "1" or "2", a second cleaning operation after the basic halo removal is done. This deals for
a) removing/reducing those corona lines that sometimes are left over by BlindDeHalo
b) improving on mosquito noise, if some is present.

PPmode=1 uses a simple gaussian blur for post-cleaning. PPmode=2 uses a 3*3 average, with zero weigthing of the center pixel.

Also, PPmode can be "-1" or "-2". In this case, the main dehaloing step is completely discarded, and *only* the PP cleaning is done. This has less effect on halos, but can deal for sources containing more mosquito noise than halos.

PPlimit [int]
Can be used to make the PP routine change no pixel by more than [PPlimit].
I'm not sure if this makes much sense in this context. However the option is there - you never know what it might be good for.


Comments & tips

Well, I just fiddled it together and checked that everything is working ... there's not very much practical experience yet I can share with you, about the new stuff. However:

- All that PP stuff isn't yet optimized. But it's difficult to make that part noticeably smarter without an aching slowdown, I fear. Try it, share your opinions. Make suggestions.

- Regarding "strength" & "sharpness" & "tweaker"
These three behave somewhat similar, but not the same.
A bigger value for "sharpness" is similar to reducing "strength". A bigger value for "tweaker" is similar to increasing "strength" value -- and vice versa for both.
Also the other way round: when increasing "sharpness", you probably have to increase "strength" a little as well, to get the same removal effect.
Usage of "sharpness" works in particular good when bigger radii (say, >2.5) are used for dehaloing. Usage of "tweaker" is more useful when working with sources containing thin, weak halos.
In the end, it comes down again to try&error

- lodamp and hidamp
Technically, these two are the "n" constants in two scaling factors of the form "x/(x+n)", which are used when creating a LUT from the difference between input clip and its gaussian blurred version.

As described above, "lodamp" deals for better protection of areas where this difference is alredy small. Effectively, it preserves some more of weak detail in areas of high contrast. A value of 4.0 seems a good starting point. One can also try to use bigger values like 16.0 or so, along with a bigger "strength" value. By this, one can somewhat change the characteristics of "what-is-processed-how-strongly" (if I can say so).

"hidamp" tries to do the opposite: protect small detail that is very bright or very dark from being toned down too much. But its usability is much more restricted: it seems to work OK when the actual halos of the source are rather weak, and/or when not too small radii are used - in this case, the protection of very prominent detail works out, mostly.
In case the source contains strong haloing, is's better to not use "hidamp" at all: in this case, the halos itself would be considerd to be "prominent detail" and be protected ... no go.


I think this is close to a "final" version of BlindDeHalo (without a number in the name )


The function script is attached to this post, and will show up upon approval. For reference, the script is posted below.

Have fun!
Attached Files
File Type: zip blinddehalo3_avs.zip (1.1 KB, 2332 views)
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 9th March 2005 at 15:26.
Didée is offline   Reply With Quote
Old 9th March 2005, 15:12   #71  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Here's the script:
Code:
function BlindDeHalo3( clip clp, float "rx", float "ry", int "strength",
 \                     float "lodamp", float "hidamp", float "sharpness", float "tweaker",
 \                     int "PPmode", int "PPlimit", bool "interlaced")
{
rx =         default( rx,           3.0 )
ry =         default( ry,           3.0 )
strength =   default( strength,     125 )
lodamp =     default( lodamp,       0.0 )
hidamp =     default( hidamp,       0.0 )
sharpness =  default( sharpness,    0.0 )
tweaker =    default( tweaker,      0.0 )
PPmode =     default( PPmode,         0 )
PPlimit =    default( PPlimit,        0 )
interlaced = default( interlaced, false )

sharpness = (sharpness>1.58) ? 1.58 : sharpness
tweaker   = (tweaker > 1.00) ? 1.00 : tweaker
strength  = float(strength)*(1.0+sharpness*0.25)
RR   = string((rx+ry)/2.0)
ST   = string(float(strength)/100.0)
LD   = string(lodamp)
HD   = string(pow(hidamp,2))
TWK0 = "x y - 12 "+ST+" / "+RR+" / /"
TWK  = "x y - 12 "+ST+" / "+RR+" / / abs"
TWK_HLIGHT = "x y = 128 "+TWK+" 128 "+TWK+" - "+TWK+" 128 / * + "+TWK0+" "+TWK+" "+LD+" + / * "
 \         + "128 "+TWK+" - 20 / 2 ^ 128 "+TWK+" - 20 / 2 ^ "+HD+" + / * 128 + ?"

i     = (interlaced==false) ? clp : clp.separatefields()
oxi   = i.width
oyi   = i.height
sm    = i.bicubicresize(m4(oxi/rx),m4(oyi/ry))
mm    = yv12lutxy(sm.expand,sm.inpand,"x y - 4 *").expand.deflate.blur(1.58).bicubicresize(oxi,oyi,1.0,.0)
sm    = sm.bicubicresize(oxi,oyi,1.0,.0)
smd   = yv12lutxy(i.sharpen(tweaker),sm,TWK_HLIGHT)
smd   = (sharpness==0.0) ? smd : smd.blur(sharpness)
clean = yv12lutxy(i,smd,yexpr="x y 128 - -").mergechroma(i)
clean = maskedmerge(i,clean,mm)

LL    = string(PPlimit)
LIM   = "x "+LL+" + y < x "+LL+" + x "+LL+" - y > x "+LL+" - y ? ?"

small = (PPmode>0) ? clean.bicubicresize(m4(oxi/2.125),m4(oyi/2.125))
 \                 :    i .bicubicresize(m4(oxi/2.125),m4(oyi/2.125))
ex1 = small.expand.blur(.5)
in1 = small.inpand.blur(.5)
hull = logic( yv12lutxy( ex1.expand.blur(1), ex1, "x y - 1 1 / * 1.0 ^ 1 - 4 *" )
 \           ,yv12lutxy( in1, in1.inpand.blur(1), "x y - 1 1 / * 1.0 ^ 1 - 4 *" )
 \           ,"max", U=-128, V=-128)
 \     .bicubicresize(oxi,oyi,1.0,.0)
postclean = (PPmode== 1) ?  maskedmerge(clean,small.bicubicresize(oxi,oyi,1.0,.0),hull)
 \        : (PPmode== 2) ?  maskedmerge(clean,clean.DEdgeMask(0,255,0,255,"2 3 2 3 0 3 2 3 2"),hull)
 \        : (PPmode==-1) ?  maskedmerge(i,small.bicubicresize(oxi,oyi,1.0,.0),hull)
 \        : (PPmode==-2) ?  maskedmerge(i,i.DEdgeMask(0,255,0,255,"2 3 2 3 0 3 2 3 2"),hull)
 \        :                 clean
postclean = (PPlimit==0) ?  postclean
 \        :                 yv12lutxy(clean,postclean,LIM,U=2,V=2)

(PPmode==0) ? clean   : postclean
interlaced  ? weave() : last

return( last )
}
#---------------------------------------------------------
function m4(float x) {return(x<16?16:int(round(x/4.0))*4)}
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 9th March 2005, 20:23   #72  |  Link
COREiP
Registered User
 
COREiP's Avatar
 
Join Date: Oct 2004
Posts: 65
I'm getting an error:

Script error: there is no function named "yv12lutxy"
(BlindDeHalo3.avs, line 32)
COREiP is offline   Reply With Quote
Old 9th March 2005, 23:44   #73  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Could be your PC being ill. Try some medicine.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 10th March 2005, 01:03   #74  |  Link
ArabianSwan
Registered User
 
Join Date: May 2004
Posts: 21
Quote:
Originally posted by COREiP
I'm getting an error:

Script error: there is no function named "yv12lutxy"
(BlindDeHalo3.avs, line 32)

you need the new masktool ..
ArabianSwan is offline   Reply With Quote
Old 10th March 2005, 01:27   #75  |  Link
COREiP
Registered User
 
COREiP's Avatar
 
Join Date: Oct 2004
Posts: 65
I'm using MaskTools 1.4.16 is there a newer version?
COREiP is offline   Reply With Quote
Old 10th March 2005, 01:29   #76  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Quote:
Originally posted by COREiP
I'm using MaskTools 1.4.16 is there a newer version?
2 posts above your's.
Backwoods is offline   Reply With Quote
Old 10th March 2005, 01:48   #77  |  Link
COREiP
Registered User
 
COREiP's Avatar
 
Join Date: Oct 2004
Posts: 65
lol thnx guys. Keep up the good work Didée the script is great
COREiP is offline   Reply With Quote
Old 21st March 2006, 15:39   #78  |  Link
Mr. Brown
Step into the Light
 
Mr. Brown's Avatar
 
Join Date: Dec 2005
Location: Germany
Posts: 20
could anyone make a masktools 2 version of BDH3 thanks
Mr. Brown is offline   Reply With Quote
Old 21st March 2006, 18:58   #79  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
You should try DeHalo_Alpha, which is made by Didée too. It's miles ahead of BDH3, and there's a masktools v2.x version.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 21st March 2006, 19:25   #80  |  Link
Mr. Brown
Step into the Light
 
Mr. Brown's Avatar
 
Join Date: Dec 2005
Location: Germany
Posts: 20
Quote:
Originally Posted by Chainmax
You should try DeHalo_Alpha, which is made by Didée too. It's miles ahead of BDH3, and there's a masktools v2.x version.
i normally use dehalo_alpha (mt2 version)
but in some cases i need bdh3 for postprocessing

example:
Code:
DeGrainMedian(limitY=5,limitUV=5,mode=3)

den   = last
dh    = Dehalo_Alpha(rx=3.0,ry=3.0).BlindDehalo3(PPmode=-1,PPlimit=4)
edges = dh.removegrain(12,-1).prewitt(multiplier=2.5)
 \         .mt_expand().mt_inflate().mt_inflate().removegrain(12,-1).mt_expand()

mt_merge(den,dh,edges)
that's why i a faster BDH3 would help me
Mr. Brown is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.