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!
+ Reply to Thread
Results 1 to 20 of 20
-
-
Have you tried any logo removal or inpainting techniques /filters yet ?
-
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?
-
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
-
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 -
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")
Last edited by poisondeathray; 4th Oct 2012 at 17:01.
-
Last edited by Biddy; 4th Oct 2012 at 16:51.
-
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.
-
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.
-
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")
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.
-
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.
-
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")
-
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.
-
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! -
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) -
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.
-
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. -
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) .
Similar Threads
-
Greenscreen type editing by removing backgrounds in videos
By snafubaby in forum EditingReplies: 1Last Post: 26th Mar 2012, 08:39 -
Removing nasty, sticky, slimy DRM from news station videos - how can you?
By GymGirl in forum Newbie / General discussionsReplies: 6Last Post: 23rd Mar 2012, 22:59 -
White screen at end of trimmed videos - AviDemux 2.5
By BobAchgill in forum EditingReplies: 0Last Post: 6th Aug 2010, 23:12 -
[SOLVED] Removing scrolling lines from videos
By palyons in forum RestorationReplies: 8Last Post: 27th Jan 2008, 22:48 -
removing scrolling text from videos
By planetx in forum EditingReplies: 5Last Post: 27th Dec 2007, 03:53