VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 51 of 51
  1. You can simulate a Gaussian sharpen with several Sharpen() filters. Sharpen(0.5,0).Sharpen(0.5,0).Sharpen(0.5,0).
    Quote Quote  
  2. 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
    Click image for larger version

Name:	0.jpg
Views:	1284
Size:	140.6 KB
ID:	2007

    dehalo
    Click image for larger version

Name:	1.jpg
Views:	1286
Size:	96.4 KB
ID:	2006

    mask
    Click image for larger version

Name:	2.jpg
Views:	1339
Size:	97.6 KB
ID:	2005

    corrected
    Click image for larger version

Name:	3.jpg
Views:	1305
Size:	135.3 KB
ID:	2004

    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..
    Quote Quote  
  3. 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?
    Quote Quote  
  4. Overlay() supports an alpha channel mask so you could blur your mask to get smooth transitions.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    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?
    Quote Quote  

  6. and? How to do this?
    Quote Quote  
  7. I don't know if any way to do what you want. Unless you want to write your own AviSynth filter.
    Quote Quote  
  8. Originally Posted by jagabo View Post
    I don't know if any way to do what you want. Unless you want to write your own AviSynth filter.
    mmmh... is it difficult? Could you give me a hint to start?
    Quote Quote  
  9. Thank you.

    And what do you think? Could this progressive blur be a good solution? Or would you do something else?
    Quote Quote  
  10. It might work. This kind of thing is hard to say for sure until you've seen it with realtime playback.
    Quote Quote  
  11. 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)
    }
    Especially I don't understand these parts:
    - construct temporal gaussian average from linear averages
    - create clip for motion search
    Quote Quote  
  12. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    You can simulate a Gaussian sharpen with several Sharpen() filters. Sharpen(0.5,0).Sharpen(0.5,0).Sharpen(0.5,0).
    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?
    Quote Quote  
  13. 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.
    Quote Quote  
  14. 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.
    Quote Quote  
  15. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by mathmax View Post
    A first possibility could be to generate back & white masks from the original grayscale mask.
    - mask1 will be white : for 0 <= B < 25, 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!
    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...
    In principle, such a filter could be written, but it would be difficult if you've never written image processing code in general or Avisynth plugins in particular. To get an idea of where to start, see http://avisynth.org/mediawiki/Filter_SDK.

    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.
    Quote Quote  
  16. 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.
    Quote Quote  
  17. 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.
    Quote Quote  
  18. thank you

    What you need to do is find an algorithm that undoes what the analog sharpening circuit in the VCRs were doing.
    Yes but how to know the algorithm of the analog sharpening circuit? I mean, is it something standard or does it depends on the VCR? Is it even something fully reversible?
    Else, how to find that algorithm? By testing?
    Quote Quote  
  19. Originally Posted by mathmax View Post
    thank you

    What you need to do is find an algorithm that undoes what the analog sharpening circuit in the VCRs were doing.
    Yes but how to know the algorithm of the analog sharpening circuit? I mean, is it something standard or does it depends on the VCR?
    It depends on the VCR. And it looks like you have several generations of VHS to VHS dubs to undo.

    Is it even something fully reversible?
    It's probably not fully reversible.

    Else, how to find that algorithm? By testing?
    Yes.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!