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 11th March 2013, 11:21   #1  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
how to sharpen big details?

I'd like to know if there's a way to sharpen big details and avoid sharpening edges
I tried a lot of things but didn't get ideal results
so here's a frame

it looks blurry, I want to sharpen details like Britney's eyelash
If I use strong sharpening like mcsharp (sharp=1)
I get this

yes, the eyelash looks clear but edges are oversharped,the whole image texture just looks terrible...
and If I use strong sharpening+edgemask (like lsfmod (edgemode=-1),tcanny....)
I get this


only very small details like noise and grains get sharped, big details like eyelash still look blurry

so,what can I do about it? any ideas?

Last edited by feisty2; 11th March 2013 at 11:42.
feisty2 is offline   Reply With Quote
Old 11th March 2013, 14:41   #2  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
I just tried SeeSaw but it still sharpens some edges ,not strong as using sharpeners directly tho
Do I have any other choice?
feisty2 is offline   Reply With Quote
Old 12th March 2013, 18:17   #3  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 354
Quote:
Originally Posted by feisty2 View Post
I'd like to know if there's a way to sharpen big details and avoid sharpening edges
Have you tried xsharpen?
bxyhxyh is offline   Reply With Quote
Old 12th March 2013, 20:33   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
If you can you manage this project, can you tell me the difference between detail and edge.

(And dont say detail is what you do want and edge is what you dont want)

EDIT: And also noise.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 13th March 2013 at 10:30.
StainlessS is offline   Reply With Quote
Old 13th March 2013, 04:26   #5  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by StainlessS View Post
If you can you manage this project, can yo&u tell me the difference between detail and edge.

(And dont say detail is what you do want and edge is what you dont want)
I guess edge is strong and clear, I'd like to sharpen weak and blurry details
feisty2 is offline   Reply With Quote
Old 13th March 2013, 07:53   #6  |  Link
osgZach
Registered User
 
Join Date: Feb 2009
Location: USA
Posts: 676
Couldn't you do something like use a mask to sharpen only what you want? Or take the pixels from the sharpened areas you want and put them onto the image?
(no I don't know how to do that, just tossing out ideas)
osgZach is offline   Reply With Quote
Old 13th March 2013, 08:27   #7  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by feisty2 View Post
I guess edge is strong and clear, I'd like to sharpen weak and blurry details
In my understanding edge is strong contrast between regions, including line as a special region,
while details are either textures or very small area elements, with weak to strong contrast wrt surroundings.

But I agree the difference can be rather vague , sometimes.

Edit> Funny distinguishing:
Edges you see at the first look.
Details you see at the second one.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 13th March 2013 at 08:33.
Poutnik is offline   Reply With Quote
Old 13th March 2013, 08:40   #8  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by osgZach View Post
Couldn't you do something like use a mask to sharpen only what you want? Or take the pixels from the sharpened areas you want and put them onto the image?
(no I don't know how to do that, just tossing out ideas)
yes, the main idea is to create a edge mask, but u see, weak detail (only if it's big enough) is included in the mask too, so it's very hard to sharpen big and weak detail
feisty2 is offline   Reply With Quote
Old 13th March 2013, 12:10   #9  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
http://registry.gimp.org/node/11742
pandy is offline   Reply With Quote
Old 13th March 2013, 13:48   #10  |  Link
joka
Registered User
 
Join Date: May 2010
Posts: 28
Unfortunately we can not use wavelets. However look at this

http://people.csail.mit.edu/sparis/publi/2011/siggraph/Paris_11_Local_Laplacian_Filters_lowres.pdf

Reading the article I remembered Didées NonLinUSM that looks verry similar. I scripted it, but sorry, for some reasons I can not retest it. No warranty for typo's.


Function bandpassfilter(clip i, float "sigma", float "alpha", int "rad1", int "rad2", float "ldmp") {

sigma = Default(sigma, 0.2) * 255
alpha = Default(alpha, 0.7)
ldmp = Default(ldmp, 8)


rad1 = Default(rad1, 1)
rad2 = Default(rad2, rad1 * 2)

gx = (rad1 == 1) ? i : i.bicubicresize(i.width()/rad1/4*4, i.height()/rad1/4*4).bicubicresize(i.width(), i.height(),1,0)
gy = i.bicubicresize(i.width()/rad2/4*4, i.height()/rad2/4*4).bicubicresize(i.width(), i.height(),1,0)

mt_makediff(gx, gy)
mt_lut("x 128 - abs "+string(sigma)+" >= "+
\ "128 "+
\ "x 128 - abs "+string(sigma)+" / "+string(alpha)+" ^ "+string(sigma)+" * x 128 - x 128 - abs 0.001 + / * x 128 - 2 ^ x 128 - 2 ^ "+string(ldmp)+" + / * x 128 - - 128 + "+
\ "? "
\ ,U=1,V=1)

mt_adddiff(i).mergechroma(i)

Return last }


The parameters are named as in the article. ldmp is taken from NonlinUSM to handle the noise.

rad1=1 is for the highest frequencies (you don't need). Call it with rad1=2 and maybe in additional with rad1=4, rad1=8, ....
joka is offline   Reply With Quote
Old 13th March 2013, 15:31   #11  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by joka View Post
Unfortunately we can not use wavelets. However look at this

http://people.csail.mit.edu/sparis/publi/2011/siggraph/Paris_11_Local_Laplacian_Filters_lowres.pdf

Reading the article I remembered Didées NonLinUSM that looks verry similar. I scripted it, but sorry, for some reasons I can not retest it. No warranty for typo's.


Function bandpassfilter(clip i, float "sigma", float "alpha", int "rad1", int "rad2", float "ldmp") {

sigma = Default(sigma, 0.2) * 255
alpha = Default(alpha, 0.7)
ldmp = Default(ldmp, 8)


rad1 = Default(rad1, 1)
rad2 = Default(rad2, rad1 * 2)

gx = (rad1 == 1) ? i : i.bicubicresize(i.width()/rad1/4*4, i.height()/rad1/4*4).bicubicresize(i.width(), i.height(),1,0)
gy = i.bicubicresize(i.width()/rad2/4*4, i.height()/rad2/4*4).bicubicresize(i.width(), i.height(),1,0)

mt_makediff(gx, gy)
mt_lut("x 128 - abs "+string(sigma)+" >= "+
\ "128 "+
\ "x 128 - abs "+string(sigma)+" / "+string(alpha)+" ^ "+string(sigma)+" * x 128 - x 128 - abs 0.001 + / * x 128 - 2 ^ x 128 - 2 ^ "+string(ldmp)+" + / * x 128 - - 128 + "+
\ "? "
\ ,U=1,V=1)

mt_adddiff(i).mergechroma(i)

Return last }


The parameters are named as in the article. ldmp is taken from NonlinUSM to handle the noise.

rad1=1 is for the highest frequencies (you don't need). Call it with rad1=2 and maybe in additional with rad1=4, rad1=8, ....
thx! I'll try
feisty2 is offline   Reply With Quote
Old 14th March 2013, 12:47   #12  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by joka View Post
Unfortunately we can not use wavelets.
We can't because there is no plugin for Avisynth or there is another reason.

As source for wavelet decompose exist http://registry.gimp.org/files/wavelet-decompose-0.1.2.tar.gz perhaps emulating in a crude way Gimp architecture can solve this problem.
pandy is offline   Reply With Quote
Old 14th March 2013, 14:53   #13  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
VagueDenoise is wavelet based and comes with source (lots of asm).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 14th March 2013, 15:01   #14  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by StainlessS View Post
VagueDenoise is wavelet based and comes with source (lots of asm).
Aaah then seems that lack of wavelet is not Avisynth limitation but just lack of plugin - ok now i understand - i was just curious is there any reason (technical) why wavelets decomposition can't be implemented as plugin for Avisynth.
pandy is offline   Reply With Quote
Old 14th March 2013, 15:04   #15  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
You don't actually want to sharpen "big details". This is a case where you need a very selective sharpener. Also, the source has aliasing, so that will be a problem.
*.mp4 guy is offline   Reply With Quote
Old 14th March 2013, 15:06   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I seem to recall that one of the developers of VagueDenoise (Fizick I think) did not quite understand
wavelets or how they worked, and so would think it might be a very demanding task for any developer,
very definitely beyond me.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 14th March 2013, 16:32   #17  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by StainlessS View Post
I seem to recall that one of the developers of VagueDenoise (Fizick I think) did not quite understand
wavelets or how they worked, and so would think it might be a very demanding task for any developer,
very definitely beyond me.
Me either - i just know that wavelets can be useful in areas where other methods can't provide good results and vice versa - sometimes wavelets can be less than optimal - wavelet decomposition and chance to operate selectively only in part of signal bandwidth/spectrum (sharpen "large" details) seems to be optimal wavelet use.
pandy is offline   Reply With Quote
Old 15th March 2013, 09:25   #18  |  Link
joka
Registered User
 
Join Date: May 2010
Posts: 28
@pandy

Sorry for the unclear statement regarding wavelets. Of course it is possible to make a plug-in based on wavelets. But I do not know a plug-in that is ready for use for feisty2's problem.

@feisty2

The solution I proposed is based on the idea to splitt it in levels of details and process each level separately. Rad1 and rad2 select the "frequency band". Sigma influences the decision if it is detail (<Sigma) or egde (> sigma). Alpha is relevant for boosting (<1.0) or reduce / denoise details (>1.0). Ldmp is required to reduce noice. In my tests I had to use ldmp also for higher levels.

If you set rad2 = 2* rad1 you can create about 6 or 7 levels (bicubiresize fails with rad > 128 on a HD source - that results in a frame size less 8x8).

The sricpt is 1 level, so I proposed to call it twice or 3 times starting with the second level (rad=2).

Sorry again for not testing it finally. I cutted this one level out of a a recursive script. Reason was to enable it to start with a higher level (not to process the first already sharp level).

Hoever, I proposed this way because I thinks masking is not the rigth way to solve the problem.
joka is offline   Reply With Quote
Old 15th March 2013, 10:53   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Maybe V.C. Mohan has an interest in wavlets or other techniques for dealing with "large details", perhaps he can comment.
Here are V.C's plugs, very interesting.

EDIT: Oops, forgot the link:
http://avisynth.org/vcmohan/
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 15th March 2013 at 21:38.
StainlessS is offline   Reply With Quote
Old 15th March 2013, 15:02   #20  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by *.mp4 guy View Post
You don't actually want to sharpen "big details". This is a case where you need a very selective sharpener. Also, the source has aliasing, so that will be a problem.
so,where can I find this selective sharpener? thx
and aliasing isn't really a problem,just use a little supersample process with eedi and it will be fixed
sorry everyone, I'm just a new avs learner and know nothing about software development, I can tell wavelet is a great idea but I have no idea how to do it
feisty2 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 00:54.


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