VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Hi All,

    What could one try to improve the appearance of "glassy" video? It was shot with a wide-angle lens attachment which caused a glassy blur across almost the entire image except the centre. Here's a short sample:

    http://www.mediafire.com/file/0lym5r657vplaa7/Wide-angle_lens_blurring_sample.wmv

    What processes might this video benefit from?
    Which particular Avisynth or VirtualDub tools would you recommend for the job?

    Many thanks in advance,
    Francois
    Quote Quote  
  2. I'm guessing you tried to zoom in through a cheap adapter. The only way to fix it is to get a better lens. Surely those ants will retun for a retake.

    There's really no good way to unblur something that dramatic -- and you have center to edge VARIABLE blur.

    Sorry.
    Last edited by smrpix; 24th Oct 2012 at 14:06.
    Quote Quote  
  3. As smrpix suggested, one approach to improve it would be a variable sharpen through a mask . Areas in white are 100% transparent, black 0% transparent, shades in between are variable transparency

    So take a sharpened, higher contrast version and apply through a circular gradient mask . This can be done in any NLE, compositing tools like after effects , or avisynth

    I think the gradient isn't exactly circular - the top part on the center distortion is still a bit blurry in this quick demonsatration . I don't have time , but if you spend more time fixing up the mask to match your footage, or tweaking the filtered overlay layer - it should match better

    eg.
    https://forum.videohelp.com/attachments/14384-1351107027/sharpen.xvid.avi

    Code:
    a=ffvideoSource("Wide-angle lens blurring sample.wmv")
    
    b = a.medianblur(12,8,8)
    c = a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(b,1),1),1),1),1),1),1),1)
    d = mt_lutxy(a,c,"x x y - abs 1.62 2 ^ / 1 1.62 / ^ 1.62 3 ^ * x y - x y - abs 1.62 + / * +",U=3,V=3)
    d
    lsfmod(strength=300)
    filtered=last
    
    mymask=imagesource("mask2.jpg")
    
    overlay(a,filtered, mask=mymask)
    Image Attached Thumbnails Click image for larger version

Name:	mask2.jpg
Views:	443
Size:	12.0 KB
ID:	14385  

    Image Attached Files
    Quote Quote  
  4. Definitely helps. I'm impressed.

    But, as a lesson for going forward, it takes a lot more time to filter out the blur than to unscrew the lens.
    Quote Quote  
  5. Originally Posted by smrpix View Post
    Definitely helps. I'm impressed.

    But, as a lesson for going forward, it takes a lot more time to filter out the blur than to unscrew the lens.

    Agreed. Always much better to shoot it properly in the first place. Post work is always a last resort and 2nd best
    Quote Quote  
  6. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by smrpix View Post
    Definitely helps. I'm impressed.
    So am I. And grateful! Many thanks, poisondeathray. I hope to work on this the coming weekend.

    Originally Posted by smrpix View Post
    But, as a lesson for going forward, it takes a lot more time to filter out the blur than to unscrew the lens.
    Absolutely. What happened was I first made Rookie Mistake #1. I took the new lens on the trip without first evaluating its results on the computer at home. Of course it looked brilliant through the viewfinder!

    Then after I finished processing the trip's material, I made Rookie Mistake #2. I'd done what I wanted, wrote and backed up the output, then deleted the source! This was about 2 years ago and only since did I learn about all these awesome video restoration techniques and this knowledgeable restoration sub-forum. For my sins I'm now working with 1900 kbps WMV instead of 28880 kbps DV AVI .

    Many thanks again guys.
    Quote Quote  
  7. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Code:
    a=ffvideoSource("Wide-angle lens blurring sample.wmv")
    
    b = a.medianblur(12,8,8)
    c = a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(a.repair(b,1),1),1),1),1),1),1),1)
    d = mt_lutxy(a,c,"x x y - abs 1.62 2 ^ / 1 1.62 / ^ 1.62 3 ^ * x y - x y - abs 1.62 + / * +",U=3,V=3)
    d
    lsfmod(strength=300)
    filtered=last
    
    mymask=imagesource("mask2.jpg")
    
    overlay(a,filtered, mask=mymask)
    Results so far seem good! A couple of things to try still but I'm very happy with the results so far, thanks. If you don't mind I'd like to learn from what you've done here. At a very high level I know the original is being overlaid with a sharpened version through a gradiated mask. But your sequence starts off with blurring!
    • What is the purpose of medianblur() here?
    • Does calling repair() this way create further smoothing/blurring, and why?
    • Why so many instances of repair(), and when do you know what's enough?
    • What's the role of mt_lutxy() here and how did you arrive at that hectic RPN expression?
    • Does
    d
    lsfmod(strength=300)
    effectively achieve the same as
    d.lsfmod(strength=300)

    here? I.e. is lsfmod() applied to last=d?
    Quote Quote  
  8. I'm not sure - it's still work in progress by didee (one of the avisynth gurus) you can ask him. I think it's prebluring as preprocessing . I notice with masktools type sharpeners the more preblurred, the more sharp it becomes. I can only tell you it my observations with those settings - that it does more than sharpen, contrast and levels are adjusted too. "Traditional" sharpeners tend to enhance outer edges more, by masktools sharpeners like Finesharp() and masktools type sharpeners have a different look and enhance fine details and edges

    http://forum.doom9.org/showthread.php?p=1595531#post1595531

    Yes, d.lsfmod(strength=300) is the same thing
    Quote Quote  
  9. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Many thanks. And thanks also for confirming what I've begun to suspect about more pre-blurring as well as the adjustments that result from this; I've been playing with:
    Code:
    b = a.medianblur (64, 8, 8)
    ...
    d.lsfmod (strength=300)
    
    # brightness to compensate for manually decreasing contrast
    Tweak(hue=0.0, sat=0.8, bright=15.0, cont=0.8)
    
    filtered = last
    # GraMaMa.dll
    mymask = GraMaMa (filtered, mode=1, a=360, b=288, rad=300, binarize=false)
    overlay (a, filtered, mask=mymask)
    Quote Quote  
  10. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by smrpix View Post
    Surely those ants will retun for a retake.
    I just noticed this remark of yours - very valid point! Unfortunately the star in this clip is the fly that was robbing the ants of their food. And the only time I've ever seen that happen is when this clip was taken .
    Quote Quote  
  11. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    For the sake of posterity, below is what I ended up with:

    Code:
    # Stage 1 - deblur
    #
    a       = last
    dblurd  = ALBR(a)                           # Create deblurred copy
    originl = ALBR(a, mode="Denoise")           # Denoise original by same amount
    #   Splice in sharpened footage only where needed
    splclst= "3227:3271,6300:6345,7002:7034,7639:7680,8930:8971,11651,11696:11754,14849:14874,17085:17258,17487:17534,18025:18158"
    splclst= splclst+",18735:18810,19528,21872:21918,24691:24786,25014:25054,25516:25539,27338:27444"
    SpliceFiltered(originl, dblurd, splclst, absoverlap=true)
    Code:
    # Stage 2 - deshake
    #
    #   > VirtualDub.Deshaker() (could have put inline but Deshaker requires 2 passes through slow filter chain above)
    #
    #   Deshaker Max. correction limits lowered to prevent stabilising frames with motion blur - very unsighly glitches otherwise
    #   Deshaker() settings:
    #       VirtualDub.video.filters.Clear();
    #       VirtualDub.video.filters.Add("Deshaker v3.0");
    #       VirtualDub.video.filters.instance[0].Config("18|1|30|4|1.067|-1|1|0|640|480|1|2|1000|1000|1000|1000|4|0|6|2|8|30|300|4|C:\\Users\\fvisagie\\Videos\\Home Videos\\20081213 Namibia Insect Footage\\20081223 Namibia Ants Raiding Other Nest's Babies\\_2.Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|5|15|1|1|30|30|0|0|0|0|1|1|1|10|1000|1|88|1|1|20|5000|100|20|1");
    #
    #   < VirtualDub.Deshaker()
    Code:
    # Stage 3 - final nice soft contra-sharpening
    #
    FFT3DFilter(bw=48, bh=48, bt=-1, ow=24, oh=24, sharpen=0.3)
    Adaptive Lens Blur Repair (ALBR) and SpliceFiltered are two functions I wrote for this project.

    Many options remain half- or unexplored and a lot of this could have been done better/differently, but this is what I had time for and I am more than happy with the results.

    Many thanks to poisondeathray whom I blame/thank for giving this project direction, and also to the many others who helped along the way .
    Quote Quote  



Similar Threads

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