VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member Deter's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Search Comp PM
    Hi,

    You have all seen it, the little white or black specs that pop up on the screen from time to time. Sometimes with old VHS or Betamax tapes this can happen a lot. Looking for a filter that will find these specs, remove them, and replace the surrounding fields. However don't want it to also remove good data.

    In General, would love to just remove the white or black specs.

    They normally only last like a frame, it can be a few pixels or many, it just depends.
    Last edited by Deter; 1st Aug 2010 at 14:13.
    Quote Quote  
  2. AviSynth RemoveDirt() but modified a bit to RemoveSpots():

    function RemoveSpots(clip input, bool "_grey", int "repmode")
    {
    _grey=default(_grey, false)
    repmode=default(repmode, 16)
    clmode=17
    clensed=Clense(input, grey=_grey, cache=4)
    sbegin = ForwardClense(input, grey=_grey, cache=-1)
    send = BackwardClense(input, grey=_grey, cache=-1)
    alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
    restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
    corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
    return corrected
    }
    Quote Quote  
  3. ...However don't want it to also remove good data....
    Not going to happen, at least not with "automatic" filters. In my experience , these filters - e.g. removedirt, removespots, despot etc.... also tend to blur and remove detail - this might be good enough for some purposes

    It's tough to find an automatic algorithm that detects everything and misses nothing. Because how can it determine whether a spot is "wanted" or to be eliminated? You usually end up losing good stuff or missing unwanted spots.

    Even if you do 1 pass on weak settings (so it misses lots of "spots" , attempting to reduce removing "good" stuff) , you still have to do some manual correction after

    You usually have to do some form of manually correction to get it "perfect". (At least manual identification and some semi-manual correction)
    Quote Quote  
  4. Post a short sample.
    Quote Quote  
  5. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    Afternoon everyone.

    Removing speckles may not be as easy when dealing with generalized filters that work on the whole frame because the end result will be loss of detail on the whole image instead of just the speckled area, like poison said, and is not a good thing unless you compremise, which may be your only choice if it bothers that bad. But, to get rid of them would require a spailized algo that targets speckls specifically and dynamically.

    Basic theory to resolve might go something like this. . .

    1. Determine line or area it is a speckle (usually, speckles are white-est tip followed by a trailing gradient, from white-to-gray/black)

    2. Then, remove or reduce them through some matrix of pixels, probably a 3xN to 5xN where N is depending on the length of the trailing white-gray/black of pixels, and since not all speckles are alike in length then that would have to be a dynamic calculation of some sort.

    There can be more than 1 line of speckles, like 2 or even three lines, and in some cases the multi lines ones had varying gradients, too. So there are different degrees for determinging and processing them.

    A 3xN would be easiest since there is only one line to replace, but where you have two or more, the worse, it gets more smudgier looking when finished. Think of a cut on your arm. After the stitches are removed and a few months have passed, there is usually a faint though noticable scar left. That's the smudge I was trying to describe when more than several lines have to be healed.

    The other complex part has to do with the noise level in the video, such as analog or vhs then that gets harder to deal with because a lot of the noise can look like speckles. So, the cleaner the source (digital cable and satalite) the better the healing results. Hmm.. very briefly, laserdisc produces similar speckles (called laser rot) in the form of rainbow colored pixels and is usually 3 lines. Anyway.

    3. Given 1 and 2, a couple of possibilities might be: a temporal averaging or median out, or complete replacement with L1/L3 pixels on the 3xN matrix. In theory, a median type method could work but i've seen in some of my experiements that it did not, instead, only some of it was removed or reduced. The algo here has to be smart.

    4. Repeat 1-3, do this for every frame. Not every frame will have speckles nor same amount and length, etc.

    I too would be interested in a sample even a few images would be worth a look at. I like to see the different kinds of speckles people see in their videos.

    -vhelp 5406
    Quote Quote  
  6. VHS sample before and after RemoveDust() (requires RemoveGrain package):

    Click image for larger version

Name:	dust.jpg
Views:	253
Size:	65.1 KB
ID:	2916

    function RemoveDust(clip input, int _mode)
    {
    repmode = 16
    clensed = Clense(input)
    rep=Repair(clensed, input, mode=repmode)
    return RemoveGrain(rep, mode=_mode)
    }

    WhateverSource()
    RemoveDust(last, 3)
    I have seen videos where this causes a big problem. For example, a video with stars panning across a black background -- the stars may be eliminated because they look like "dust".
    Quote Quote  
  7. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by poisondeathray View Post
    In my experience , these filters - e.g. removedirt, removespots, despot etc.... also tend to blur and remove detail - this might be good enough for some purposes
    I usually do a Sharpen afterwards because of this:

    Code:
    RemoveDirt()
    Sharpen(.6)
    or your choice of more sophisticated sharpening filters.


    Even if you do 1 pass on weak settings (so it misses lots of "spots", attempting to reduce removing "good" stuff) , you still have to do some manual correction after

    I often use
    Code:
    BadFrames(959,960,965)
    Which removes the specified frames (say ones missed by RemoveDirt) and replaces them with either a blend of the surrounding ones (the default) or a copy of one.

    Often a film is more damaged near the beginning, and as that often also has the credits I can find the best frame in what should be a static credits screen and freezeframe it to cover the crappy ones:

    Code:
    FreezeFrame(428,488,460)
    -- this duplicates frame 460 and copies it over frames 428 to 488.
    Quote Quote  
  8. Member Deter's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Search Comp PM
    Thanks for these replies.

    Jagabo, yea the videos kind of look like the one u have above, that is what is needs to be removed.


    Where do u get ? RemoveDust & RemoveGrain


    Not really sure on how to use AviSynth with Virtual Dub. Never used the program and was wondering how do u set it up.


    Once it is set up: Than you just paste in those scripts?

    AlanHK,

    Everyonce in a while get really bad frames. (THIS IS A REALLY BAD ONE) Normally have to remove these by hand, basically pull out the frames than re-mix the film to blend out with little to no notice in errors. However in a long film that has lots of these types of errors it does take ages to restore or fix.
    Last edited by Deter; 2nd Aug 2010 at 22:06.
    Quote Quote  
  9. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by Deter View Post
    Where do u get ? RemoveDust & RemoveGrain


    Not really sure on how to use AviSynth with Virtual Dub. Never used the program and was wondering how do u set it up.
    Click on the links the forum puts on the names.

    More info : http://avisynth.org/mediawiki/Main_Page

    Originally Posted by Deter View Post
    Everyonce in a while get really bad frames. (THIS IS A REALLY BAD ONE) Normally have to remove these by hand, basically pull out the frames than re-mix the film to blend out with little to no notice in errors. However in a long film that has lots of these types of errors it does take ages to restore or fix.
    That's what "BadFrames" is for.

    I use the AvsP editor, move through the file and when I see a bad frame, insert the cursor into the script window and press F11 to insert the current frame number.
    Quote Quote  



Similar Threads

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