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 14th November 2005, 23:01   #41  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Good idea, I'm going to email neuron2 and ask him to create a "New halo removers discussion" thread and move all posts from #21 onward to there.
__________________
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.

Last edited by Chainmax; 15th November 2005 at 00:59.
Chainmax is offline   Reply With Quote
Old 15th November 2005, 00:03   #42  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Threads split as requested.
Guest is offline   Reply With Quote
Old 15th November 2005, 13:19   #43  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
@ Revgen: Sorry for hijacking

@ neuron2: Thanks for splitting.


@ all: here's a new plaything

The following proof-of-concept function uses a method that I had in mind for a longer time already, but never actually tried it ... because during theorising I always thought "nah, this way it can't work. Well, I should have tried it earlier ... this is probably not the worst Halo remover ever seen

Currently, there are the following parameters:

- rx, ry [float, 1.0 ... 2.0 ... ~3.0]
As usual, the radii for halo removal.
Note: this function is rather sensitive to the radius settings. Set it as low as possible! If radius is set too high, it will start missing small spots.

- darkkstr, brightstr [float, 0.0 ... 1.0] [<0.0 and >1.0 possible]
The strength factors for processing dark and bright halos. Default 1.0 both for symmetrical processing. On Comic/Anime, darkstr=0.4~0.8 sometimes might be better ... sometimes. In General, the function seems to preserve dark lines rather good.

- lowsens, highsens [int, 0 ... 50 ... 100]
Sensitivity settings, not that easy to describe them exactly ... in a sense, they define a window between how weak an achieved effect has to be to get fully accepted, and how strong an achieved effect has to be to get fully discarded.
Defaults are 50 and 50 ... try and see for yourself.

- ss [float, 1.0 ... 1.5 ...]
Supersampling factor, to avoid creation of aliasing.


source vs. DeHalo_alpha():




The function: (needs MaskTools and Repair from the RemoveGrain package)

(edit: forgot to include that small "m4" helper function. It's included now.)

(edit2: an "r" had disappeared, causing parameterless call to deliver a black clip. fixed )
Code:
function DeHalo_alpha(clip clp, float "rx", float "ry", float "darkstr", float "brightstr", float "lowsens", float "highsens", float "ss")
{
rx        = default( rx,        2.0 )
ry        = default( ry,        2.0 )
darkstr   = default( darkstr,   1.0 )
brightstr = default( brightstr, 1.0 )
lowsens   = default( lowsens,    50 )
highsens  = default( highsens,   50 )
ss        = default( ss,        1.5 )

LOS = string(lowsens)
HIS = string(highsens/100.0)
DRK = string(darkstr)
BRT = string(brightstr)
ox  = clp.width()
oy  = clp.height()
uv  = 1
uv2 = (uv==3) ? 3 : 2

halos  = clp.bicubicresize(m4(ox/rx),m4(oy/ry)).bicubicresize(ox,oy,1,0)
are    = yv12lutxy(clp.expand(U=uv,V=uv),clp.inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
ugly   = yv12lutxy(halos.expand(U=uv,V=uv),halos.inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
so     = yv12lutxy( ugly, are, "y x - y 0.001 + / 255 * "+LOS+" - y 256 + 512 / "+HIS+" + *" )
lets   = maskedmerge(halos,clp,so,U=uv,V=uv)
remove = (ss==1.0) ? clp.repair(lets,1,0) 
          \        : clp.lanczosresize(m4(ox*ss),m4(oy*ss))
          \             .logic(lets.expand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"min",U=uv2,V=uv2)
          \             .logic(lets.inpand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"max",U=uv2,V=uv2)
          \             .lanczosresize(ox,oy)
them   = yv12lutxy(clp,remove,"x y < x x y - "+DRK+" * - x x y - "+BRT+" * - ?",U=2,V=2)

return( them )
}

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!)

Last edited by Didée; 15th November 2005 at 17:38.
Didée is offline   Reply With Quote
Old 15th November 2005, 14:48   #44  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
At first glance DeHalo_alpha() seems just as good as abcxyz(rad=1.75) but with even a slight better treatment of small details: if you compare the abcxyz(rad1.75) picture Anonymouses posted with the DeHalo_alpha() one in the white beads chain that hold the chandelier, they seem a bit brighter on the DeHalo_alpha() one. Will test this beauty ASAP .
__________________
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 15th November 2005, 16:57   #45  |  Link
Dreassica
Registered User
 
Join Date: May 2002
Posts: 384
Someone care to tell me which versiosn of masktools and removegrain i need, cuz i tried liek 3 different ones and all close my script upon loading.
Dreassica is offline   Reply With Quote
Old 15th November 2005, 17:11   #46  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
MaskTools are these (unless I rebuild the script for MT v2.0aX)

RemoveGrain is not needed, but Repair.dll is. Latest official version should suffice for this one, although using the v1.0 pre-release might be a good idea.


Oh, and:
Quote:
Originally Posted by Chainmax
At first glance DeHalo_alpha() seems just as good as abcxyz(rad=1.75) but with even a slight better treatment of small details: if you compare the abcxyz(rad1.75) picture Anonymouses posted with the DeHalo_alpha() one in the white beads chain that hold the chandelier, they seem a bit brighter on the DeHalo_alpha() one.
Yep, from the basic principle alone, this alpha should retain more detail than the abcxyz thingy.
However, when removing halos, there's always some apparent loss of overall contrast ... after all, the sharpening procedure that caused the haloing was not applied with the intention to bug the viewer, but to please him

So, what about adding some minor areabased tralala afterwards?


(quickly thrown together, so not tweaked at all.)
__________________
- 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; 15th November 2005 at 17:24.
Didée is offline   Reply With Quote
Old 15th November 2005, 17:23   #47  |  Link
Dreassica
Registered User
 
Join Date: May 2002
Posts: 384
thnx, taht worked, but now using plain DeHalo_alpha() in script, i get all black frames.
Dreassica is offline   Reply With Quote
Old 15th November 2005, 17:30   #48  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
Quote:
Originally Posted by Dreassica
thnx, taht worked, but now using plain DeHalo_alpha() in script, i get all black frames.
Nevermind - the halos are gone, aren't they?

Seriously: that's interesting! After finishing the function this morning, I also had the case that just a black clip was returned. Searched for an error in the script, but found none ... loaded the script again, and - ba-ding! - everything was fine.

Sorry, no clue ... try again.


edit: wait, something's fishy when defaults are produced. A moment ...

editedit: grrr, an "r" had disappeared somehow, and I didn't see it. ("brightstr" was "brightst"). Fixed. Sorry for being sloppy.
__________________
- 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; 15th November 2005 at 17:40.
Didée is offline   Reply With Quote
Old 15th November 2005, 17:55   #49  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Quote:
Originally Posted by Didée
Yep, from the basic principle alone, this alpha should retain more detail than the abcxyz thingy.
However, when removing halos, there's always some apparent loss of overall contrast ... after all, the sharpening procedure that caused the haloing was not applied with the intention to bug the viewer, but to please him

So, what about adding some minor areabased tralala afterwards?


(quickly thrown together, so not tweaked at all.)
I don't know if I told you before, but You Are The Man!!.

I can't wait to try this one .
__________________
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.

Last edited by Chainmax; 15th November 2005 at 18:08.
Chainmax is offline   Reply With Quote
Old 15th November 2005, 21:44   #50  |  Link
Anonymouses
Guest
 
Posts: n/a
Didée, thanks for all the work you do and for refining this function more. Even better halo removing then with the original and preserves the small bright areas better.

Here's some more screenshots (especially make note of the eyebrows on the sculpture and the guys fingernails):

Source:



abcxyz(rad=1.75):



DeHalo_alpha():



Wow, I think with this I can finally reauthor this disc without the halos and it preserves a great deal of the detail that BDH was removing.

Last edited by Anonymouses; 15th November 2005 at 21:49.
  Reply With Quote
Old 15th November 2005, 22:04   #51  |  Link
Anonymouses
Guest
 
Posts: n/a
And one more example from Trigun again:

Source:



abcxyz(rad=1.75):



DeHalo_alpha():



Again most noticeable is the small bright areas being preserved especially the tight lines on the kanji credits and the small bright areas on the gun and his hair.
  Reply With Quote
Old 15th November 2005, 22:07   #52  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I have some comparisons of my own (from left to right: Source+IVTC, Filtering+HQDering, Filtering+DeHalo_Alpha):

__________________
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 15th November 2005, 22:22   #53  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
One more comparison:

abcxyz:


DeHalo_Alpha:


The letters look much better, they are bright and white, not yellowish and dull . Coming up soon: my ultimate test, small detail handling with an X-Men VHS capture.
__________________
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 16th November 2005, 00:05   #54  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I pitted DeHalo_Alpha against FixVHSOverSharp in a VHS capture of the X-Men 1992 animated series's pilot intro. DeHalo_Alpha not only does as good a job (maybe even better) at dehaloing, but there's virtually no difference regarding small details. Here are the comparison shots (in all cases, from left to right: Source, Filtering + FixVHSOverSharp, Filtering + DeHalo_Alpha):







I'm sold, this is by far the best halo remover I ever tried .
__________________
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 16th November 2005, 00:58   #55  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,554
On the simpsons clip it's noticably less sharp. Other comparisons don't show any similar degradation though, maybe it's a fluke, or maybe the filterchain just changed slightly.
foxyshadis is offline   Reply With Quote
Old 16th November 2005, 18:32   #56  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I think that the HQDering and DeHalo_Alpha filterchains on the Simpsons screenshots were the same (except for the dehalo method, of course). I'm going to check that again just in case.
__________________
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 12th December 2005, 22:18   #57  |  Link
SirCanealot
Aspiring l33tz0rz0rz0r...
 
Join Date: Mar 2003
Location: London, England
Posts: 88
http://www.williams1.homechoice.co.uk/M1.png
http://www.williams1.homechoice.co.uk/M2.png

Frickening awesome!

Thanks, Didée. Maybe I'll repay you in... RAPE DOLLERS... $$$
__________________
SirCanealot

And they shall know no fear....
SirCanealot is offline   Reply With Quote
Old 12th December 2005, 22:27   #58  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Good timing, I was just going to make a new post here .

Didée, would it be possible to include some kind of strength control? From what I can gather on the readme, the strongest setting would be something like DeHalo_Alpha(rx,ry,lowsens=1,highsens=100), but that is not enough on a nasty source (3rd generation VHS captured to DV) I have.
__________________
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 14th December 2005, 13:01   #59  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
Mind you, there's a reason for that function being titled "alpha". It's perfectly possible that it just can't cope with your source.

If it's just about mere strength, you can set "darkstr" and "brightstr" to values bigger than 1.0, to force even stronger removal. From some certain point on, it will start doing "over-removal" resulting in strange artefacts, but strengths like 1.1 or 1.2 should be okay. Just try, you'll see when things start going overboard.

Does the source have rather "thick" halos? I noticed that dehalo_alpha has its problems both with very thin and very thick halos. I understand the problem behind, but am still waiting for the sudden inspiration to make a general solution.

Moreover, the settings lowsens and highsens work only "sort of" how they were intended ... don't know what I was thinking when creating the LUT for that. Currently, the consequences of altering these two values are not at all intuitive. This definetly needs a change.
__________________
- 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 14th December 2005, 13:23   #60  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
The source has all kinds of halos, it's maybe as f***ed up as the Halo Torture clip I sent you some time ago. I'll try just setting darkstr and brightstr to 1.2 and report back.
__________________
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.

Last edited by Chainmax; 14th December 2005 at 22:30.
Chainmax 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 14:18.


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