You can simulate a Gaussian sharpen with several Sharpen() filters. Sharpen(0.5,0).Sharpen(0.5,0).Sharpen(0.5,0).
+ Reply to Thread
Results 31 to 51 of 51
-
-
Thank you
I made a program to detect the halos. It works pretty well. Here is for example I mask I put a dehalo version over the original version for the white part:
original version
dehalo
mask
corrected
As you can see the result isn't very good because the blurred parts are very visible..
I think it would be better to apply a progressive blur. Don't know if it exists but some filter that blur a lot whe you are pixels corresponding to the white of the mask and the more the pixels are dark the less the video is blurred. I hope you see what I mean
Maybe you have other ideas, but I don't think that putting two videos one over the other is a good solution.. -
of course, I'll make an other mask if I use a progressive blur.. The transition from the black to the white will be more progressive.
jagabo, do you know if it is possible to blur progressively according to a such mask? -
Overlay() supports an alpha channel mask so you could blur your mask to get smooth transitions.
-
yes but you mean put the blurred version on the top of the sharp version according to mask, right?
On the grey areas of the mask, both versions will be visible (blurred version will semi-transparent), which is not what I want to do...
I want to blur with :
- a strength of 0 when the mask is black
- a strength of 1 when the mask is white
- a strength of 0.5 when the mask is grey (R=127, G=127, B= 127)
- a strength of 0.25 when the mask is grey (R=63, G=63, B= 63)
- ...
Does such a progressive blur() exists? -
-
http://avisynth.org/mediawiki/Filter_SDK
http://avisynth.org/mediawiki/Filter_SDK/Compiling_instructions
I would start with the source to a filter that does something similar. -
Thank you.
And what do you think? Could this progressive blur be a good solution? Or would you do something else? -
It might work. This kind of thing is hard to say for sure until you've seen it with realtime playback.
-
Could you help me to understand this function?
Code:function Calm (clip clp, int "rep0") { ox = clp.width() oy = clp.height() # create linearily weighted temporal averaging ts1 = clp.temporalsoften(1,255,255,28,2) ts2 = clp.temporalsoften(2,255,255,28,2) # construct temporal gaussian average from linear averages t = ts1.merge(ts2,0.357).merge(clp,0.125) # Create clip for motion search. searchclip = t.removegrain(11).gaussresize(ox,oy,0,0,ox+.0001,oy+.0001,p=2) \ .merge(t,0.1).mt_lutxy(t3,"x 7 + y < x 2 + x 7 - y > x 2 - x 51 * y 49 * + 100 / ? ?",U=3,V=3) return (searchclip) }
- construct temporal gaussian average from linear averages
- create clip for motion search -
It's a bit tangential to the main thread, but I've been puzzling over this since I saw it, and I'm not sure if it's right. I know that repeated application of Blur() (in fact any lowpass filter) will converge to a Gaussian blur, but does the theory (Central Limit Theorem) apply to a sharpening filter?
Take for example a filter kernel of [-1/2 2 -1/2] (equivalent to Sharpen(1)).
Repeated convolution of this produces at each stage a strong positive central peak surrounded by series of alternating positive and negative values. As I understand it, a Gaussian sharpen kernel has the positive central peak, but all other values are strictly negative. I may be wrong about this, as I haven't been able to find a mathematical definition of 'Gaussian sharpen'.
Can you shed any light on this, or point me to some references? -
Yes, multiple Sharpen() filters are only a crude approximation of the opposite of multiple blur() filters. Three Sharpen(1.0) filters will not "undo" three Blur(1.0) filters. You will get ringing artifacts.
-
Gavino, jagabo.. I think I would need your help
I really don't know how to write such a progressive blurring function...
So lets recapitulate. I have a grayscale mask. The more the halo is strong and the more you're close to this halo, the more the corresponding area of the mask is white.
Now I want to blur according to this mask. The more the mask is white, the more I blur.
For example, I blur from 0 (when black) to 1 (when white).
So for each pixel of the picture, I need to blur with a strength of B/255, where B is the brightness of the corresponding pixel on the mask.
A first possibility could be to generate back & white masks from the original grayscale mask.
For example:
- mask1 will be white : for 0 <= B < 25, black for the rest.
- mask2 will be white : for 25 <= B < 50, black for the rest.
- mask3 will be white : for 50 <= B < 75, black for the rest.
...
- mask10 will be white : for 225 <= B <256, black for the rest.
Then blur the picture 10 times (with the appropriate value) and put these versions one over the other according to the masks.
Ok this is not a real progressive blur as there are a limited number of masks.. we would certainly need more masks to get something smooth.. and it'll be very slow to process!
An other possibility would be to have a blur function smart enough to really blur according to the brightness of the corresponding pixel of the mask. So it should changes its settings according to the B value for each pixel, if you see what I mean... And I really don't know to do this.
I would even do the same with a dehalo() function instead of the blur() function. dehalo() is a custom function that blur, sharpen, etc..it can contain any custom action but it must adjust it strength to the "B" for each pixel. -
Taking this to its logical extreme, you could use 256 different masks. This would do what you want, but would obviously be even slower.
An other possibility would be to have a blur function smart enough to really blur according to the brightness of the corresponding pixel of the mask. So it should changes its settings according to the B value for each pixel, if you see what I mean...
Note that, because each pixel must be processed differently, you cannot separate your processing into horizontal and vertical passes like a normal blur, so it will be inherently slow. -
Thank you.
As a starting point, how would you blur just one pixel according to the other around it? I just have to take the pixel to the left and to the right into account because I blur horizontally. -
You use weightings based on the distance from the center pixel. For example:
Equal weights, radius = 1, strong blur:
i[x]' = (i[x-1] + i[x] + i[x+1]) / 3
Unequal weights, radius = 1, less strong blur:
i[x]' = (i[x-1]/2 + i[x] + i[x+1]/2) / 2
(final /2 is the sum of the weights (1/2 + 1/1 + 1/2)
unequal weighting, radius = 2
i[x]' = (i[x-2]/4 + i[x-1]/2 + i[x] + i[x+1]/2 + i[x+2]/4) / 2.5
(2.5 is the sum of the weights, 1/4 + 1/2 + 1/1 + 1/2 + 1/4)
What you need to do is find an algorithm that undoes what the analog sharpening circuit in the VCRs were doing.Last edited by jagabo; 2nd Jun 2010 at 09:17.
-
thank you
What you need to do is find an algorithm that undoes what the analog sharpening circuit in the VCRs were doing.
Else, how to find that algorithm? By testing? -
Similar Threads
-
Pictures are blurred while capturing
By eliqush in forum Capturing and VCRReplies: 5Last Post: 31st May 2010, 19:02 -
My Caps Come out very Blurred
By zxfactor in forum Capturing and VCRReplies: 9Last Post: 17th Feb 2009, 06:10 -
Blurred Text on DVD Menu
By boofer in forum Authoring (DVD)Replies: 3Last Post: 10th Jan 2009, 17:45 -
Streamclip output blurred
By bijones2 in forum EditingReplies: 0Last Post: 14th Jun 2008, 06:37 -
DVD Lab - menu text blurred (PAL)
By BeachNut in forum Authoring (DVD)Replies: 12Last Post: 21st Jan 2008, 06:12