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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th October 2004, 11:02   #1  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Proof of Concept Filter and a Couple Questions

Alright, well I've been jumping around between a couple projects and thought I'd take a stab at an idea for a filter with a gui with real time preview (mainly just seeing if I could get one working). Meaning you see the changes immediately as you change the filter parameters in the gui instead of having to advance a frame in vdub. Pretty much like previews for vdub filter configs. After quite a bit of trial and error here it is:

TUnsharp v0.9.3

It currently supports YV12 and YUY2 colorspaces. To enable the gui use gui=true when calling the filter. The gui is pretty much like the other avisynth filter gui's, but also has a preview button that will pop up a new window that loads the current (last processed) frame. You can then change the filter parameters in the gui and the changes will show up immediately on the frame in the preview window.

The main problems and limitations are:

1.) The preview window is limited to the last processed frame. Meaning there is no frame advance in the preview window so you must change the frame in the vdub window to change the frame in the preview window.

2.) Only one instance of TUnsharp can exist with a gui... you can have multiple instances of the filter in a script but only one can have a gui. This isn't really a big deal in my opinion (how many instances of a gui for one filter do you really need? ).

3.) YUY2 display on the preview window seems to screw up on colors. The problem is most visible around sharp color transitions in areas of high saturation (bright reds, etc...). I'm not super fimilar with the DrawDib stuff so if anyone knows how to fix this or what is causing it please share . YV12 seems to be fine...

Now, I'm not sure the actual filter is all that useful. It's just a basic unsharpmasking filter that implements a few different operators and some basic sharpen limiting ideas from Didee's LimitedSharpen() script. It was really more a proof of concept to see if the preview stuff could be done and if it would be any good. Hopefully someone else might find it useful or expand on it for another project sometime.

EDIT: (May 01, 2005)
Finally got around to fixing all the gui related bugs in TUnsharp, there were thread sync and thread termination problems. Everything should work fine now, and I also added the method of sharpening from XSharpen as another option.

EDIT: (May 24, 2005)
Fixed a few more bugs.

Last edited by tritical; 25th May 2005 at 05:22.
tritical is offline   Reply With Quote
Old 24th October 2004, 14:58   #2  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
the release version crashes VDM on opening. no surprise from what i understand.

the debug version works pretty well. the realtime preview does it's job, and the filter sharpens things up for sure (needs supersampling, i think )

keep it up. there's a lot of filters out there that could use GUIs.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 31st October 2004, 05:53   #3  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
It would definitely benefit from super-sampling and a few other things, though atm I don't think it would really be worth it to add it. I wasn't tired off messing with the gui stuff yet though, and needed the win32 programming experience so I decided to make yet another gui based filter.. this one is probably a little more useful. It is a take off on AVSMon and is basically a monitor type filter. It allows previewing of the video at the point where the filter is inserted in the script, it has an extended info dialog you can pop up that will display pretty much all the relevant information about the clip, and it allows for adjusting the audio delay through the gui. The other main thing is unlike TUnsharp and AVSMon it supports multiple instances (as many as you want) per script. So anyways, here it is (plus a sample screen shot with only one instance open):

TMonitor v0.9.3

I think it could or would be useful for a couple of applications. It supports all colorspaces. Now, I think it's time to get back to TDeint and TFM .

EDIT: (May 02, 2005)
Fixed a few thread sync/exit issues that would sometimes cause random crashes when multiple instances of TMonitor were used in a script. Also fixed a few resource leak bugs.

EDIT: (May 24, 2005)
Fixed 2 remaining thread sync/exit issues... should always exit correctly now.

Last edited by tritical; 11th June 2005 at 19:53.
tritical is offline   Reply With Quote
Old 1st November 2004, 12:51   #4  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
nice

hmm... a filter GUI would be good for manual tweaks, especially with IVTC patterns. of course, if the automatic matching is clever enough there'll be no need for a GUI.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 30th November 2012, 09:40   #5  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 586
Please relax restriction on maximum value of radius

Quote:
Originally Posted by tritical View Post
Now, I'm not sure the actual filter is all that useful.
It's *very* useful - in a role you perhaps never had in mind - for deblurring video! Of all the unsharp masking filters I've tried for deblurring, it sets itself apart by being the only one that makes it possible to exclude fine level detail you *don't* want accentuated as well as well-defined edges you don't want sharpened further. This is by far the most useful approach to deblurring with unsharp masking I've come across. Here's how I'm using it at the moment:

Code:
...
shrpnum = (sharpnr == "Unsharpen") ? 0 : \
          (sharpnr == "Unsharp"  ) ? 1 : \
          (sharpnr == "SMSSQME"  ) ? 2 : \
          (sharpnr == "TUnSharp" ) ? 3 : 4
Assert(shrpnum < 4, """'sharpnr' choice """" + sharpnr + """" is invalid""")
#   Sharpener defaults:         Unsharpen   Unsharp     SMSSQME     TUnSharp
rshy    = Select( shrpnum,      31,         31,         12,         3        )  # Unsharp mask Y radius/TUnSharp radius
rshc    = Select( shrpnum,      31,         31,         8,          0        )  # Unsharp mask C radius, unused by TUnSharp
strsh   = Select( shrpnum,      1.13,       1.13,       1.62,       100      )  # Sharpening strength
thL     = Select( shrpnum,      0,          0,          0,          1        )  # TUnSharp lower edge magnitude threshold, unused by others
thU     = Select( shrpnum,      0,          0,          0,          5        )  # TUnSharp upper edge magnitude threshold, unused by others
type    = Select( shrpnum,      0,          0,          0,          1        )  # TUnSharp sharpening/unsharpmasking operator, unused by others
map     = Select( shrpnum,      0,          0,          0,          0        )  # TUnSharp output map type, unused by others
lim     = Select( shrpnum,      0,          0,          0,          2        )  # TUnSharp sharpening limit, unused by others
...
Eval(Select(shrpnum, \
        """a.gaussianblur(varY=vshy, varC=vshc, y=ysh, u=ush, v=vsh).mt_lutxy(a, "y x - " + String(strsh) + " * y +", y=ysh, u=ush, v=vsh)""", \
        """a.unsharp (varY=vshy, varC=vshc, strength=strsh, y=ysh, u=ush, v=vsh)""", \
        """a.mt_lutxy (a.repair (a.repair (a.repair (a.repair (a.repair (a.repair (a.repair (a.repair (a.medianblur (rshy, rshc, rshc), \
           4), 4), 4), 4), 4), 4), 4), 4), "x x y - abs " + string (strsh, "%#.2f") + " 2 ^ / 1 " + string (strsh, "%#.2f") + " / ^ " \
           + string (strsh, "%#.2f") + " 3 ^ * x y - x y - abs " + string (strsh, "%#.2f") + " + / * +", y=ysh, u=ush, v=vsh)""", \
        """a.TUnSharp(strength=Int(strsh), thresholdL=thL, thresholdU=thU, type=type, map=map, lim=lim, radius=rshy, gui=false)""" \
    ) \
)
The only - but unfortunately significant - limitation I've encountered with TUnSharp is that the maximum radius value of 3 limits the amount of deblurring that can be achieved. For the kind of deblurring I'm working with now, radius values up to 31 and sometimes beyond are needed as you can see.

Would it be possible to relax the limit on the maximum value of radius, please? I realise you've made the source available, but for me to get into coding and set up a build environment is something I really can't contemplate now. Hopefully it'd be a small edit for you?

Many thanks in advance,
Francois

PS. And if I may be so bold, how about adding optional chroma processing? E.g. the way MVTools does with the y, u, v parameters? The material I'm working with also suffers from some chroma blurring (=could benefit from chroma deblurring).

Last edited by fvisagie; 30th November 2012 at 10:19. Reason: Snuck in the PS
fvisagie is offline   Reply With Quote
Old 30th November 2012, 09:55   #6  |  Link
TheProfileth
Leader of Dual-Duality
 
TheProfileth's Avatar
 
Join Date: Aug 2010
Location: America
Posts: 134
@fvisagie
Would you mind sharing the complete script you are using for deblurring I think it would be interesting to see
__________________
I'm Mr.Fixit and I feel good, fixin all the sources in the neighborhood
My New filter is in the works, and will be out soon
TheProfileth is offline   Reply With Quote
Old 30th November 2012, 15:08   #7  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 586
Quote:
Originally Posted by TheProfileth View Post
@fvisagie
Would you mind sharing
For you I creata da thread
Adaptive Lens Blur Repair
fvisagie is offline   Reply With Quote
Old 30th November 2012, 15:18   #8  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,005
@fvisagie: I sure hope you realize that you just bumped a thread that nobody has posted in for eight years and one month? tritical himself hasn't posted on d9 at all since June.

Last edited by TheFluff; 30th November 2012 at 15:24.
TheFluff is offline   Reply With Quote
Old 30th November 2012, 15:29   #9  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 586
@TheFluff,

I realise that, but thought it was best to post this to "the TUnSharp thread". Or do you mean there's a problem with doing it? I did send tritical a PM alert in case he's no longer subscribed.
fvisagie is offline   Reply With Quote
Old 17th May 2014, 08:44   #10  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 473
no news ?
hydra3333 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 04:25.


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