VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 43
Thread
  1. I have a source that looks wierd and Ive only come across this once before.

    Can anyone suggest something to try in order to lessen or remove thes line across the picture?

    Quote Quote  
  2. A general approach might be to try a vertical blur

    But what is the temporal relationship? Do the lines move? are they static ? Do they change in size or color ?
    Quote Quote  
  3. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Are you referring to the curved vertical lines in the left of the image? You've seen that many times, not just once. It's called banding. It's caused by over filtering, careless re-encoding, insufficient bitrate, etc.
    Color Banding And Noise Removal thread for gradient cleanup and dithering plugins.
    - My sister Ann's brother
    Quote Quote  
  4. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    You could try a mild high to mid frequency luminance noise suppression, like this:

    Click image for larger version

Name:	remove lines X.png
Views:	816
Size:	1,023.8 KB
ID:	28489
    Quote Quote  
  5. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    I think you tried that earlier. The banding will return during re-encode -- for the same reasons given in an earlier thread about a similar problem.
    - My sister Ann's brother
    Quote Quote  
  6. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Originally Posted by LMotlow View Post
    I think you tried that earlier. The banding will return during re-encode -- for the same reasons given in an earlier thread about a similar problem.
    Are we talking about the banding or the horizontal stripes? I am talking about the horizontal stripes.
    Quote Quote  
  7. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    I think the OP meant "line[s] across the picture?".

    I may be imagining things, but I can still sort of see them in the processed PNG.
    Quote Quote  
  8. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Originally Posted by ndjamena View Post
    I think the OP meant "line[s] across the picture?".

    I may be imagining things, but I can still sort of see them in the processed PNG.
    And your point is?

    They are reduced, using noise suppression is always a tradeoff, you reduce too much and you influence other parts of the image.

    But I am sure that with all your criticism you have a much better idea!

    Before and After:
    Click image for larger version

Name:	before after.png
Views:	209
Size:	194.5 KB
ID:	28490
    Last edited by newpball; 11th Nov 2014 at 23:31.
    Quote Quote  
  9. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by newpball View Post
    Originally Posted by LMotlow View Post
    I think you tried that earlier. The banding will return during re-encode -- for the same reasons given in an earlier thread about a similar problem.
    Are we talking about the banding or the horizontal stripes? I am talking about the horizontal stripes.
    I'm talking about the banding. Likely the O.P. didn't notice something that obvious.
    - My sister Ann's brother
    Quote Quote  
  10. I wasnt talking about the banding just incase anyones confused or wondering. I was talking about the ones in the hair.
    Quote Quote  
  11. Originally Posted by newpball View Post
    You could try a mild high to mid frequency luminance noise suppression, like this:

    Image
    [Attachment 28489 - Click to enlarge]

    looks better

    How is that used in a script?
    Quote Quote  
  12. You could probably filter Y, and U, V to get treat the other colored lines in the background. Maybe use a masktools cartoon line mask to protect the lines

    You still haven't answered the question about the temporal pattern - static ? moving ? all frames ? etc.... That affects how you filter it
    Quote Quote  
  13. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    It may not be banding, but it's sure as hell related.
    Quote Quote  
  14. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Not the final solution, just a half arse attempt really, but this seems to get rid of them:

    Code:
    ffvideosource("D:\Ins\Digimon Fusion Preview-002\Digimon Fusion Preview-002.mkv")
    deen("a2d")
    flash3kyuu_deband()
    deen("a2d")
    flash3kyuu_deband()
    deen("a2d")
    flash3kyuu_deband()
    deen("a2d")
    flash3kyuu_deband()
    Quote Quote  
  15. Thats alot of deens, that will destroy alot of detail I would think.
    Quote Quote  
  16. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Far too much of the detail IS banding of one sort or another. Removing it while keeping the actual lines intact will be incredibly difficult.
    Quote Quote  
  17. I wish I knew what newpball used on his.
    Quote Quote  
  18. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    mild high to mid frequency luminance noise suppression

    FFT3DFilter on the Luma plain?

    The worst of the problems do seem to be on the luma plain and somehow the problems are more horizontal in nature. How many filters are bias towards the vertical?
    Quote Quote  
  19. Originally Posted by ndjamena View Post
    Far too much of the detail IS banding of one sort or another. Removing it while keeping the actual lines intact will be incredibly difficult.



    Actually it's not too difficult in avisynth masktools to generate a cartoon line mask to protect the actual cartoon lines .

    eg. the base mask is just this
    o=last
    mt_hysteresis(o.mt_edge ("cartoon",thy1=8, thy2=10),o.mt_edge ("hprewitt")).mt_expand_multi(sw=6, sh=6).mt_inpand_multi(sw=6, sh=6)

    Here is the binarized version of it so you can visualize what is going on
    Click image for larger version

Name:	msk.jpg
Views:	239
Size:	301.8 KB
ID:	28611

    You can combine it with other types of mask, refine it with various masktool operators etc..

    I did this a few days ago when I was patiently waiting for a reply to the question . It's heavily filtered with the line protection mask, and moderately dithered in preparation for encoding (you won't retain the dither unless you use dither retention settings or very high bitrates).

    Click image for larger version

Name:	masktools.png
Views:	205
Size:	2.21 MB
ID:	28610




    BUT the actual problem is refining the mask so it works for the actual video across different scenes and scenarios . Often you'll have holes in the mask, or need other masks for coverage in different scenes. You want to do as less work and scripting as possible, but that involves some tradeoffs. The temporal characteristics of the artifacts and whether or not you are limited to spatial processing. Many things are not conveyed by a static screenshot, or a short description. I'll have a look at your video sample if I have time later, but I suspect you need to combine it with a shadow/luma mask to protect shadow detail in some of the other shots (or just set a generic threshold for the shadow mask across all scenes)
    Quote Quote  
  20. Well thanks for taking a look at it poison, I look forward to your answer and script.

    I think the picture looks great!
    Last edited by killerteengohan; 17th Nov 2014 at 20:44.
    Quote Quote  
  21. I won't have time to look at it this week in detail.

    But a quick look tells me you're going to have problems with using a cartoon based edge mask alone. Because you're going to be using strong filters in Y, U and V to get rid of the horizontal lines , there are a lot of shadow areas which will get destroyed unless you protect them with a shadow/luma mask (e.g. even in the first few frames) . In the other section with smoke, that will get killed and since it's neither dark, nor lines, (it's "grey") it's difficult to isolate with masks in avisynth, maybe a saturation mask. If you want a great job, you're going to have to use different masks / different settings on different sections . If you want an OK job, you're going to have to make tradeoffs
    Quote Quote  
  22. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Code:
    a = ffvideosource("D:\Ins\Digimon Fusion Preview-002\Digimon Fusion Preview-002.mkv").addborders(0,0,0,8)
    a
    LSFMOD()
    spline36resize(a.width * 3, a.height)
    deen("a2d")
    flash3kyuu_deband()
    deen("a2d")
    flash3kyuu_deband()
    deen("a2d")
    flash3kyuu_deband()
    fft3dfilter(bt = 1, bw = 32, bh = 64, ow = 16, oh = 32, sigma=2)
    spline36resize(a.width, a.height)
    LSFMOD()
    flash3kyuu_deband()
    That kind of works, although I'm not sure it's any better than newballs and I'm not sure all of those lines are necessary. Some of the lines are rather indistinct and they're the first to go. The black lines around the center animal's watch in the first frame and his mouth are prime examples, they're more blurs than actual lines and are vulnerable to denoisers. Even PDR's script misses them entirely.

    Hopefully it will give someone more sensible some ideas.
    Quote Quote  
  23. Originally Posted by ndjamena View Post
    Some of the lines are rather indistinct and they're the first to go. The black lines around the center animal's watch in the first frame and his mouth are prime examples, they're more blurs than actual lines and are vulnerable to denoisers. Even PDR's script misses them entirely.

    That "base mask" was intended for that 1st screenshot. I didn't have access to the video at the time

    Obviously you have adjust the mask to fit the video. As you alluded to, especially with cartoons, one of most common problem scenarios are "dark scenes." The problem is lines are "dark" , and shadows are "dark" as well - therefore you get no separation. And commonly used denoisers usually destroy shadow detail, thus the lines there as well. So the usual techniques use are some combination of:


    a) either adjust the thresholds lower (detect more lines)

    b) create separation by prefiltering (e.g. brighten the scene and boost and increase shadow contrast, just for the mask creation)

    c) combine masks using masktools operators , use different types of masks , not just edgemasks e.g. combine a luma mask with the cartoon line mask; or use a saturation mask (lines are often low saturation, compared to flat colored areas) . You can use operators like "OR" or "AND" or "ANDN" to refine and include or exclude regions with mt_logic


    Here is an example of prefiltering for the mask by using (b), brightening shadows . This will cover the dude in the middle. This works ok on the other scene with the girl too. You have to examine the other scenes to see if it's appropriate, or make adjustments . I don't have time to fiddle with this right now. Trying to do everything with 1 mask will invariably be worse, but it's less work than making a mask per scene

    Code:
    o=last
    
    pre=o.hdragc(coef_gain=2).blur(0,1.5).deen(mode="c2d", rad=1, thry=2)
    
    m1=mt_hysteresis (pre.mt_edge("cartoon", thy1=6, thy2=10),pre.mt_edge ("hprewitt", thy1=8, thy2=10)).mt_expand_multi(sw=2, sh=4).mt_inpand_multi(sw=2, sh=2)
    
    m1
    There are stray pixels , and you miss some (e.g. green guy's nostrils in the corner are difficult to separate because of the blur in the original), but this is typical for avisynth type masks - they aren't perfect

    Click image for larger version

Name:	m1.jpg
Views:	193
Size:	508.9 KB
ID:	28631
    Quote Quote  
  24. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Code:
    o = ffvideosource("D:\Ins\Digimon Fusion Preview-002\Digimon Fusion Preview-002.mkv")
    o
    pointresize(o.width * 2, o.height)
    deen("a2d")
    flash3kyuu_deband()
    deen("a2d")
    flash3kyuu_deband()
    deen("a2d")
    flash3kyuu_deband()
    fft3dfilter(bt = 1, bw = 32, bh = 64, ow = 16, oh = 32, sigma=2)
    spline36resize(o.width, o.height)
    flash3kyuu_deband()
    
    filtered=last
    
    pre=o.hdragc(coef_gain=2).blur(0,1.5).deen(mode="c2d", rad=1, thry=2).addborders(0,0,0,8)
    
    m1=mt_hysteresis (pre.mt_edge("cartoon", thy1=6, thy2=10),pre.mt_edge ("hprewitt", thy1=8, thy2=10)).crop(0,0,0,-8).mt_expand_multi(sw=2, sh=4).mt_inpand_multi(sw=2, sh=2)
    
    mt_merge(filtered, o, m1, luma=true)
    flash3kyuu_deband()
    I'm getting less than 1 frame a second, but it seems to come out rather nice. I think most of my lines are redundant at this point anyway and can be safely removed.
    Last edited by ndjamena; 19th Nov 2014 at 11:40.
    Quote Quote  
  25. You'll get a slight speedup if you use mt_merge() instead of overlay() . Overlay() is slower, but has more options like blending modes, other colorspace support, opacity adjustments within

    mt_merge(filtered, a, m1, luma=true)

    You might want to apply some type of dithering after the overlay operation, to "blend in" the composite
    Quote Quote  
  26. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Could you upload a 10-15 second lossless capture?
    Quote Quote  
  27. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Filtering's really not my thing, I discovered it was the flash3kyuu_deband filters that were doing most of the slow down, I didn't really think they were doing anything and wasn't sure why I added them so I removed them and it messed everything up. Now I'm afraid to touch it again. There's still the occasional remnant of some of the more virile "bands" but it's head and shoulders above the original. It's definitely banding, you just have to look at the shot of the thing standing up to see that. Maybe another round of Deen/flash will finish off the last of the problems.

    I'll update the post above with the modified script.
    Quote Quote  
  28. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by newpball View Post
    Could you upload a 10-15 second lossless capture?
    ???

    (me??? doesn't everyone here have avisynth? 10 seconds is 250mb worth in ut codec)
    Quote Quote  
  29. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Here is the video after a slight surface (edge aware) blur.

    DigimonX.mp4

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