VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 42 of 42
  1. Have you used any of the dirt removal or spot removal filters before? There are dozens of variations and they will all work fairly well on spots/dirt/hair that remain in 1 single frame. Ones that linger over 2 frames (or if you ahve dupe frames) will not be detected

    You would IVTC the DVD (e.g. use force film in dgindex) . You also stay in YV12 this way (For the example below, I used converttoYV12(), but that's because the sample you gave was uncomcompressed RGB, not the original)

    RemoveDirtMC() is a simple, effective one to start with, and it's more selective than many of the other variants. The value is the strength of the filter, the higher, the stronger, and more likelhood of removing things (wanted things as well) . You need RemoveGrain, MVTools as dependencies


    A non masked version that catches all the spots would be too damaging (think Dorothy's missing shoes) . In this shot , ice chips will go missing (because there are frames where they are in one shot, and the next frame gone - so they are identifed as unwanted spots) . But a weak setting version will miss some spots.

    So as described earlier, the approach around this is either to use masks, and/or use different techniques like layers and different filtered versions with a video editor or compositor . You're combining the best of everything for the "perfect" repair. If you recall , there was something similar in the Wizard of Oz restoration piece - they just circled defects and they disappear. This is very selective, because you don't cause damage to other parts, you only fix *exactly* what is intended. There is more manual work, but your eye is way more discerning than some algorithm. You can do basically the same thing (But you don't have 3 separate masters, instead you have a heavy filtered version, and a less or non filtered version, wherever you circle is a layer mask) . In more complex shots , you can animate masks or add rotoscoping . Eitherway these "automatic" dirt/spot removal filters will cut days/weeks of your work.





    Here is a simple example of a "strong" filtered version that gets rid of all the spots (but ice chips as well) . I can post an example of how to use a masked version in avisynth too, but I'm assuming you know how to use masks and layers in photoshop or other editing programs NLE's, and it's easier IMO to combine them in those programs

    Code:
    #Mpeg2Source()  #force film in dgindex or use IVTC with some other method
    AVISource() #only because of the AVI in your example
    ConvertToYV12() #you wouldn't need this if you were in YV12 already (only because you provided RGB sample)
    RemoveDirtMC(50,false)
    
    
    
    function RemoveDirt(clip input, int limit, bool _grey)
    {
      clensed=input.Clense(grey=_grey, cache=4)
      alt=input.RemoveGrain(2)
      return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,              dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)
    
      # Alternative settings
      # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=true)
      # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=false)
    }
    
    function RemoveDirtMC(clip,int limit, bool "_grey")
    {
      _grey=default(_grey, false)
      limit = default(limit,6)
      i=MSuper(clip,pel=2)
      bvec = MAnalyse(i,isb=false, blksize=8, delta=1, truemotion=true)
      fvec = MAnalyse(i,isb=true, blksize=8, delta=1, truemotion=true)
      backw = MFlow(clip,i,bvec)
      forw  = MFlow(clip,i,fvec)
      clp=interleave(backw,clip,forw)
      clp=clp.RemoveDirt(limit,_grey)
      clp=clp.SelectEvery(3,1)
      return clp
    }
    Quote Quote  
  2. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Have you used any of the dirt removal or spot removal filters before? There are dozens of variations and they will all work fairly well on spots/dirt/hair that remain in 1 single frame. Ones that linger over 2 frames (or if you ahve dupe frames) will not be detected

    You would IVTC the DVD (e.g. use force film in dgindex) . You also stay in YV12 this way (For the example below, I used converttoYV12(), but that's because the sample you gave was uncomcompressed RGB, not the original)

    RemoveDirtMC() is a simple, effective one to start with, and it's more selective than many of the other variants. The value is the strength of the filter, the higher, the stronger, and more likelhood of removing things (wanted things as well) . You need RemoveGrain, MVTools as dependencies


    A non masked version that catches all the spots would be too damaging (think Dorothy's missing shoes) . In this shot , ice chips will go missing (because there are frames where they are in one shot, and the next frame gone - so they are identifed as unwanted spots) . But a weak setting version will miss some spots.

    So as described earlier, the approach around this is either to use masks, and/or use different techniques like layers and different filtered versions with a video editor or compositor . You're combining the best of everything for the "perfect" repair. If you recall , there was something similar in the Wizard of Oz restoration piece - they just circled defects and they disappear. This is very selective, because you don't cause damage to other parts, you only fix *exactly* what is intended. There is more manual work, but your eye is way more discerning than some algorithm. You can do basically the same thing (But you don't have 3 separate masters, instead you have a heavy filtered version, and a less or non filtered version, wherever you circle is a layer mask) . In more complex shots , you can animate masks or add rotoscoping . Eitherway these "automatic" dirt/spot removal filters will cut days/weeks of your work.





    Here is a simple example of a "strong" filtered version that gets rid of all the spots (but ice chips as well) . I can post an example of how to use a masked version in avisynth too, but I'm assuming you know how to use masks and layers in photoshop or other editing programs NLE's, and it's easier IMO to combine them in those programs

    Code:
    #Mpeg2Source()  #force film in dgindex or use IVTC with some other method
    AVISource() #only because of the AVI in your example
    ConvertToYV12() #you wouldn't need this if you were in YV12 already (only because you provided RGB sample)
    RemoveDirtMC(50,false)
    
    
    
    function RemoveDirt(clip input, int limit, bool _grey)
    {
      clensed=input.Clense(grey=_grey, cache=4)
      alt=input.RemoveGrain(2)
      return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,              dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)
    
      # Alternative settings
      # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=true)
      # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=false)
    }
    
    function RemoveDirtMC(clip,int limit, bool "_grey")
    {
      _grey=default(_grey, false)
      limit = default(limit,6)
      i=MSuper(clip,pel=2)
      bvec = MAnalyse(i,isb=false, blksize=8, delta=1, truemotion=true)
      fvec = MAnalyse(i,isb=true, blksize=8, delta=1, truemotion=true)
      backw = MFlow(clip,i,bvec)
      forw  = MFlow(clip,i,fvec)
      clp=interleave(backw,clip,forw)
      clp=clp.RemoveDirt(limit,_grey)
      clp=clp.SelectEvery(3,1)
      return clp
    }
    I still wouldn't mind you posting an image/images if you're up to it.
    I found this filter to work surprisingly well. I did notice eliminations that, as you said, were much easier than manual removal.
    Not to jump the gun, but is there a way to blow this up to 1080 and not have it look ridiculous, despite as much work as one could imagine putting into the restoration? This is of course the desire to upconvert to BD quality, or as close as possible with the source I have.
    Quote Quote  
  3. Sorry I'm not clear on what you're asking for in terms of "images ?" Can you clarify

    And, no 1080p will look like a joke and a waste of bandwidth. Leave dimensions as is
    Quote Quote  
  4. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    I had a feeling your reply would be brief and basically exactly what you responded with... just a shot in the dark.
    As for the "images" question: "I can post an example of how to use a masked version in avisynth too, but I'm assuming you know how to use masks and layers in photoshop or other editing programs"
    Quote Quote  
  5. Basically what you're trying to do is combine a non or low filtered version (one that retains all the ice chips like the original), but keeps the dirt removal ability of a "stronger" filtered version. One way to do this by using a mask. Areas of white are "see through", areas of black are opaque, and in between are variable transparency

    There is a mini tutorial on how to use masks and overlay() to combine 2 layers in avisynth here, you can download the zip file and play with them as well
    https://forum.videohelp.com/threads/331626-Logo-removal-by-using-2-sources

    There are other ways using masktools and mtmerge, but it's the same idea

    But then I had a closer look at your clip and it's actually not an good clip illustrating effective use of masks in avisynth - the reason is some of the spots are in the motion path of the area you want to mask out ie. they overlap. A static mask would prevent those spots from being filtered (but protect the ice chips from "disappearing") . Normally you could get around this easily by animating the mask - but it's difficult to animate masks or generate precise masks in avisynth alone (it's very clunky compared to using other programs like after effects) . You could still do it - you would create the mask (black in the center over the fridge and the path of falling ice, white around it) , or invert the mask and change the order of the overlay (switch the "base" clip with the "overlay" clip)

    It might be a bit confusing if you haven't used masks in other programs - if this doesn't make sense, just say so and I'll try to explain it a little better with examples
    Quote Quote  
  6. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Basically what you're trying to do is combine a non or low filtered version (one that retains all the ice chips like the original), but keeps the dirt removal ability of a "stronger" filtered version. One way to do this by using a mask. Areas of white are "see through", areas of black are opaque, and in between are variable transparency

    There is a mini tutorial on how to use masks and overlay() to combine 2 layers in avisynth here, you can download the zip file and play with them as well
    https://forum.videohelp.com/threads/331626-Logo-removal-by-using-2-sources

    There are other ways using masktools and mtmerge, but it's the same idea

    But then I had a closer look at your clip and it's actually not an good clip illustrating effective use of masks in avisynth - the reason is some of the spots are in the motion path of the area you want to mask out ie. they overlap. A static mask would prevent those spots from being filtered (but protect the ice chips from "disappearing") . Normally you could get around this easily by animating the mask - but it's difficult to animate masks or generate precise masks in avisynth alone (it's very clunky compared to using other programs like after effects) . You could still do it - you would create the mask (black in the center over the fridge and the path of falling ice, white around it) , or invert the mask and change the order of the overlay (switch the "base" clip with the "overlay" clip)

    It might be a bit confusing if you haven't used masks in other programs - if this doesn't make sense, just say so and I'll try to explain it a little better with examples
    I actually have used masks in PS but that was YEARS (MANY!) ago. I'll be honest and admit that I could use a fresher
    Quote Quote  
  7. You probably recall this much, but just in case... The basic concept of using alpha masks:

    Given two videos (I'm using two different colors to make what's happening very obvious):

    Name:  blue.png
Views: 415
Size:  618 Bytes + Name:  red.png
Views: 424
Size:  618 Bytes

    and a mask:

    Name:  mask.png
Views: 425
Size:  225.7 KB

    Merge them with mt_merge(blue, red, mask, true):

    Name:  result.png
Views: 439
Size:  3.0 KB

    Where the mask was black (the background) the first video (blue) showed through. Where the mask was white (left square) the second video showed through. Where the mask was a medium grey (center square) the two images were mixed 50:50. Where the mask was other shades of grey (right square) the two images where mixed with different weights. The true argument was used so that mt_merge() only used the greyscale channel of the mask to determine transparency.
    Quote Quote  
  8. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    I'm really sorry but I had the urge to try, despite your warning that it'll look awful.
    Attached is a m2ts, indeed, 1080p. I used your script, as well as Neat Video. Never mind the hack-job Stereo attempt. Personally, I don't think it looks as terrible as you claimed it'd be... and, honestly, as bad as even I assumed it'd be. I will admit that there are some "blocking-ish" moments that occur. The cause of that, I have no idea. I also used VDub's "Levels" preset to light up the picture a bit.
    Even though you didn't recommend it, would you mind suggesting what might be causing the occasional "blocky" parts? Is it Neat Video, the level adjustment, both or what?
    Thanks

    UPDATE - I just checked and the blocky thing for the most part occurs with TotalMedia Theatre. However, VLC makes those blocky moments virtually nonexistent.
    Last edited by takearushfan; 22nd Jul 2012 at 08:46.
    Quote Quote  
  9. Enlarging the frame to 1080p isn't going to look especially bad. It's just that most TVs or players perform fairly good upscaling so there's no point in doing it yourself. You aren't going to recreate the detail that was in the original film (neither will the TV or player), you're just going to make a fuzzy bigger picture. The only issue is how much fuzzier and what artifacts you introduce -- vs. what the TV or DVD player can produce. The best software upscalers (nnedi3, for example) produce slightly better results than the average TV but the difference isn't huge. So all you're doing by upscaling is creating a bigger file that takes longer to encoded and requires more decoding power when played, and locking in whatever artifacts your upscaling produces.
    Quote Quote  
  10. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by jagabo View Post
    Enlarging the frame to 1080p isn't going to look especially bad. It's just that most TVs or players perform fairly good upscaling so there's no point in doing it yourself. You aren't going to recreate the detail that was in the original film (neither will the TV or player), you're just going to make a fuzzy bigger picture. The only issue is how much fuzzier and what artifacts you introduce -- vs. what the TV or DVD player can produce. The best software upscalers (nnedi3, for example) produce slightly better results than the average TV but the difference isn't huge. So all you're doing by upscaling is creating a bigger file that takes longer to encoded and requires more decoding power when played, and locking in whatever artifacts your upscaling produces.
    Way to rain on my parade
    No, really. I understand what you're saying. Upscaling is never going to be as good as if a studio went and did the true proper treatment necessary for a BD release.
    All I was trying to show is that with the use of some simple concepts, such as slight level adjustments and Neat Video, as I used, it doesn't look as horrific as I thought it would. IMHO, it looks better than it did without the use of those adjustments.
    I was thinking that if it looks decent enough merely upscaling with some simple filters, then there might really be the potential for an impressive picture, if they ever go through with it *fingers crossed for such to occur within this decade*
    The artifact issue was one of my main points. Since I went through the work of reducing some of what was there (less is more), then upscaling artifacts won't be even more of a distraction when blown up.
    Quote Quote  
  11. Originally Posted by takearushfan View Post
    All I was trying to show is that with the use of some simple concepts, such as slight level adjustments and Neat Video, as I used, it doesn't look as horrific as I thought it would. IMHO, it looks better than it did without the use of those adjustments. I was thinking that if it looks decent enough merely upscaling with some simple filters, then there might really be the potential for an impressive picture, if they ever go through with it *fingers crossed for such to occur within this decade*
    The artifact issue was one of my main points. Since I went through the work of reducing some of what was there (less is more), then upscaling artifacts won't be even more of a distraction when blown up.
    Of course it looks better with adjustments - are you comparing filtered vs. unfiltered?

    You would apply the same adjustments except the last enlargement step then compare the filtered SD version vs. the filtered HD version. Unless you have an exceptionally poor hardware upscaler, the quality will be similar. The point was it's usually a waste of bandwidth (you need much larger filesize for similar quality , and if you don't allocate approriate bitrate, it will actually look worse)

    When you test something, you should elimate all the other confounding variables, so it's the only remaining variable is the actual thing that is being tested (in this case , upscaling vs. no upscaling)
    Quote Quote  
  12. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by takearushfan View Post
    All I was trying to show is that with the use of some simple concepts, such as slight level adjustments and Neat Video, as I used, it doesn't look as horrific as I thought it would. IMHO, it looks better than it did without the use of those adjustments. I was thinking that if it looks decent enough merely upscaling with some simple filters, then there might really be the potential for an impressive picture, if they ever go through with it *fingers crossed for such to occur within this decade*
    The artifact issue was one of my main points. Since I went through the work of reducing some of what was there (less is more), then upscaling artifacts won't be even more of a distraction when blown up.
    Of course it looks better with adjustments - are you comparing filtered vs. unfiltered?

    You would apply the same adjustments except the last enlargement step then compare the filtered SD version vs. the filtered HD version. Unless you have an exceptionally poor hardware upscaler, the quality will be similar. The point was it's usually a waste of bandwidth (you need much larger filesize for similar quality , and if you don't allocate approriate bitrate, it will actually look worse)

    When you test something, you should elimate all the other confounding variables, so it's the only remaining variable is the actual thing that is being tested (in this case , upscaling vs. no upscaling)
    Even though it's your last sentence, good point. I wasn't just comparing filtered to unfiltered. I was simultaneously comparing standard to pseudo-HD.
    Quote Quote  



Similar Threads

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