VideoHelp Forum




+ Reply to Thread
Results 1 to 20 of 20
  1. Hi there,

    I allready knew while filming that there was dust between my lenses and the result is that a fixed white stain appears in the middle of every video I shot. I tried a lot of different tricks, but so far no luck. At the moment I'm using Avysynth, but I can't figure out how to remove this white stain. Does anybody have an idea how I can fix this?

    Thanks!
    Image Attached Thumbnails Click image for larger version

Name:	Video.jpg
Views:	309
Size:	373.3 KB
ID:	14124  

    Quote Quote  
  2. Have you tried any logo removal or inpainting techniques /filters yet ?
    Quote Quote  
  3. No, so far I only tried the DeSpot filter (which causes the application to crash) and the RemoveSpot function. How can I use the logo removal or other inpainting techniques/filters?
    Quote Quote  
  4. A video sample would have been better. You'll have to play around with the ColorYUV adjustments for other shots but try something like this:

    Code:
    src=ImageSource("Video.jpg").ConvertToYV12()
    mask=ImageSource("mask.png").ConvertToYV12(matrix="PC.601").ColorYUV(gamma_y=200, gain_y=100)
    dark=ColorYUV(src,gain_y=-140,cont_u=100, cont_v=100)
    
    Overlay(src,dark,0,0,mask)
    Interleave(src,last,dark) # for comparison
    Click image for larger version

Name:	ovr.jpg
Views:	293
Size:	162.9 KB
ID:	14135
    Image Attached Thumbnails Click image for larger version

Name:	mask.png
Views:	331
Size:	19.1 KB
ID:	14134  

    Quote Quote  
  5. Originally Posted by Biddy View Post
    No, so far I only tried the DeSpot filter (which causes the application to crash) and the RemoveSpot function. How can I use the logo removal or other inpainting techniques/filters?

    DeSpot , RemoveDirt, RemoveSpots etc... those types of filters only work for non-persistent defects (the spots are sporadic and don't occur on adjacent frames)



    There are a bunch of guides and filters, some work better for opaque, some for semi-transparent
    http://avisynth.org/mediawiki/External_plugins#Logo_Removal

    e.g. delogo , vdub
    https://forum.videohelp.com/threads/221665-Removing-Logos-using-DeLogo-vdub-filter#1376335

    e.g. msu
    http://www.compression.ru/video/logo_removal/index_en.html

    e.g xlogo
    https://forum.videohelp.com/threads/273109-Remove-an-opaque-logo-using-Xlogo-in-Avisynth

    e.g. rm_logo
    http://forum.doom9.org/showthread.php?t=134919
    Quote Quote  
  6. You can play with layer blend modes (similar to photoshop layer blend modes) to get slightly better results.

    You might have to make adjustments to the mask, as it's hard to tell with a still jpeg. As jagabo said, a video sample would have been better

    If it's primarily a "white" spot with some transparency, you shouldn't have to make any major adjustments per scene or when there are lighting and exposure changes- unless you clip, crush, or overexpose in that scene

    This is from jagabo, just slightly modified
    Code:
    src=ImageSource("Video.jpg").ConvertToYV12()
    mask=ImageSource("mask.png").ConvertToYV12(matrix="pc.601")
    dark=src.levels(0,0.4,255,0,255,false)
    
    
    Overlay(src,dark,0,0,mask, opacity=1, mode="softlight")
    You can do this in NLE's or compositing applications like AE, blender. IMO they are easier to use and make adjustments , have better mask tools , feathering, and compositing filters for this sort of thing
    Image Attached Thumbnails Click image for larger version

Name:	rev.jpg
Views:	242
Size:	306.7 KB
ID:	14136  

    Last edited by poisondeathray; 4th Oct 2012 at 17:01.
    Quote Quote  
  7. Thanks so far jagabo and poisondeathray! I thought it would be a good idea to give you a video sample And I'm very new to all this video enhancing stuff, so using AVSEdit and Blender is a big challenge for me. If you have any step by step instructions ....you would help me a lot!
    Image Attached Files
    Last edited by Biddy; 4th Oct 2012 at 16:51.
    Quote Quote  
  8. That's not a good choice of clips. As far as the spot is concerned, except for a little camera shake at the start, you've uploaded 100 copies of the same image. A clip where the camera is panning or something is moving past the spot would be much better. Especially different colors and details moving past the spot.
    Quote Quote  
  9. It's probably easier learning basic avisynth than learning how to use blender or after effects . You just copy & paste the code , changing the paths & filenames to match your video

    An .avs file is just a text file. You can use notepad copy&paste, and save it, then change the extension from .txt to .avs

    Many people use avspmod to preview their scripts (push f5) , but you can use notepad, vdub



    For example, instead of ImageSource() , you would use AVISource() with the correct path and filenames . Change "PATH" to C:\folder or wherever the AVI file folder is

    I reused jagabo's mask, but resized it to 640x480 (the native clip size). If you spend more time on a better mask you might get better results

    e.g.

    Code:
    src=AVISource("PATH\MVI_0110.avi").ConvertToYV12() 
    mask=ImageSource("PATH\mask.bmp").BicubicResize(640,480).ConvertToYV12(matrix="pc.601") 
    dark=src.levels(0,0.4,255,0,255,false)  
    
    Overlay(src,dark,0,0,mask, opacity=1, mode="softlight")


    In addition to jagabo's comments about movement and detail, when you test semi-transparent overlays, you usually want a clip that exhibits a change in exposure (e.g. brighter scene , darker scenes)
    Last edited by poisondeathray; 4th Oct 2012 at 17:06.
    Quote Quote  
  10. Is this a better video sample?
    Image Attached Files
    Quote Quote  
  11. That's a much better sample. What I did earlier doesn't work well in some sections. poisondeathray's modification (with a little more modification) works better.

    Code:
    src=AviSource("MVI_0030.AVI") 
    mask=ImageSource("mask.png").ConvertToYV12(matrix="pc.601").ColorYUV(gain_y=100)
    dark=src.levels(0,0.4,255,0,255,false)
    
    Overlay(src,dark,0,0,mask, opacity=1, mode="softlight")
    Click image for larger version

Name:	mask.png
Views:	531
Size:	902.0 KB
ID:	14157

    If you can get the spot with a black background (I noticed there were a few others too) you can build a better mask and it will work better. The spot still showed up a fair amount in some parts of the video. Playing around with the mask and parameters may improve those areas. I built the mask from frame 454.
    Last edited by jagabo; 5th Oct 2012 at 20:19.
    Quote Quote  
  12. Thanks for that! Finally, I get the drift how to work with these masks and it does help a lot! Just an odd question, but how do you build a mask based on a frame?
    And is it possible to use different parameters for different frames within the same video, as in some parts the spot is hardly notable (so I don't need a mask in does areas, right?) and in other parts it is disturbingly there?
    Last edited by Biddy; 6th Oct 2012 at 12:36.
    Quote Quote  
  13. Originally Posted by Biddy View Post
    Thanks for that! Finally, I get the drift how to work with these masks and it does help a lot! Just an odd question, but how do you build a mask based on a frame?
    And is it possible to use different parameters for different frames within the same video, as in some parts the spot is hardly notable (so I don't need a mask in does areas, right?) and in other parts it is disturbingly there?

    You can build a mask in any paint or graphics program (photoshop, gimp etc...) e.g. take a screenshot a frame where the defect is visible (e.g againt a black background would be easier, but any frame where defect is visible) , then paint it in

    To use different settings & parameters, it's harder to do in avisynth (you can cut it up with trims() and use different settings then join) , or it's easier to use a NLE or compositing application (you keyframe the settings), you also have other tools to modify masks and composite things right at hand

    I think jagabo made his mask a bit small - there is a halo or ring around the defect. Instead of going back & forth in your graphics program, one way is use mask tools modifiers to expand the mask . You can do this right in avspmod (so you can see the mask and get feedback by pushing f5) . e.g. I added mt_expand to "grow" the mask, and use a blur to feather it a bit (to make edges more soft, so there is less abrupt transition) . Also I'm not sure why he didn't use a black/white/greyscale mask ?

    Code:
    src=AviSource("MVI_0030.AVI") 
    
    mask=ImageSource("mask.png").ConvertToYV12(matrix="pc.601").ColorYUV(gain_y=100).tweak(sat=0.2, coring=false).mt_expand(24,u=3,v=3).binomialblur(5) 
    
    dark=src.levels(0,0.4,255,0,255,false)
    Overlay(src,dark,0,0,mask, opacity=1, mode="softlight")
    This sample clip shows problems that can occur with clipping(overexposure) and color cast - this will impair up the channel calculation of any "fix" as the response is no longer linear. It's more difficult to fix with 1 setting or "automatic" process - to get a better repair you would need adjust the settings and use other masks but this requires some manual work
    Quote Quote  
  14. Originally Posted by poisondeathray View Post
    I think jagabo made his mask a bit small - there is a halo or ring around the defect.
    Yes, there was no frame with a nice black background behind the entire spot. I used the best I could find in the clip but ended up losing some of spot. Ie, I took frame 454 and painted everything around the spot black, including a little bit of the spot because there were image elements there.
    Quote Quote  
  15. I'm trying to get the code running, but can't get around the message that there is no function named binomialblur. I put VariableBlur.dll in my plugins, but it doesn't seem to work. What can I do about that?
    For the rest: I'm very thankful for your help jagabo and poisondeathray! It's allready so much better than before!
    Quote Quote  
  16. Try loading it manually with LoadPlugin("PATH\variableblur.dll")

    Or you can use another blur e.g. blur(1.5).blur(1.5).blur(1.5)
    Quote Quote  
  17. LoadPlugin doesn't work either: If I search through the Avisynth functions in AvsPmod, it doesn't seem to appear in the list. Can there be something wrong with the dll I downloaded (I tried two different downloads).
    Quote Quote  
  18. 0.5 is the latest
    http://avisynth.org/mediawiki/Variableblur
    http://bengal.missouri.edu/~kes25c/variableblur.zip

    0.4 is here , I think this is the one I'm using on this computer
    http://www.tsp.person.dk/VariableBlur040.zip


    The type of blur isn't important for this, any will do

    One reason why this 2nd clip won't be fixed/solved properly with 1 set of settings is the blue channel is almost non-existent in sections - so you will get a disparity with any repair . The yellow cast is so strong that the camera recorded almost nothing in the blue channel (ie. there is almost no data when looking at the blue channel in RGB) . To "solve" the equation you need at least 2 sets of settings, one for when B=0 and when B doesn't = 0 over the defect . This means keyframing or applying different settings to different sections

    The 1st clip is more balanced (no color cast) , so it possible to get a decent repair with 1 setting

    (Or another approach might be to color correct the clip first - if you desaturate yellows & some red it will be more balanced)
    Last edited by poisondeathray; 6th Oct 2012 at 16:01.
    Quote Quote  
  19. Thanks for your reply, I go for the Blur, Blur, Blur because VariableBlur just isn't working.

    I'll try the keyframing (as soon as I know what that means) or the different settings for sections wherever I can. The second clip is shot in a yellow tent, so that's why there is hardly any blue. But it's good to see that at least the spot 'disappears' while seeing a face (2nd clip) or if a motorcycle is passing by (1st clip). They have the main focus in these video's, so all the surroundings (with their smaller spots) are less import for me at this point.
    Quote Quote  
  20. Some of the other "spots" look like lens flares .

    You probably want to bring down the yellow and red saturation in the tent shot - there some of hidden detail that is obscured by it (the video has "illegal" non broadcast safe colors) .
    Quote Quote  



Similar Threads

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