Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th October 2013, 10:58   #1  |  Link
PaulD
Registered User
 
Join Date: Sep 2013
Posts: 6
Chroma Noise Filter

First post - please be kind

I have the colour bands problem which is illustrated in section 12.4 (top picture) of the capture guide in doom9.net see http://www.doom9.org/capture/chroma_artefacts.html . At the end of this section it states that “at the time of writing this page there are no filters who can correct this”. Since the page was last edited in 2004, can anyone tell me if there is now a filter which can clear this problem?
PaulD is offline   Reply With Quote
Old 9th October 2013, 00:22   #2  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,801
Are you sure you don't have simple interlacing? That image looks a lot like normal interlacing but it isn't.

There still isn't anything that can fix that error, as far as I know. However, interlacing is a very well researched problem and there are lots of ways to fix it. I like QTGMC for deinterlacing.

Last edited by Asmodian; 9th October 2013 at 00:35.
Asmodian is offline   Reply With Quote
Old 9th October 2013, 09:39   #3  |  Link
PaulD
Registered User
 
Join Date: Sep 2013
Posts: 6
Thanks for your reply. I've used the de-interlacer in VirtualDub, and that didn't shift it. I'll try QTGMC.
PaulD is offline   Reply With Quote
Old 10th October 2013, 19:26   #4  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,801
If you post a small unmodified sample we can take a look and offer advice.
Asmodian is offline   Reply With Quote
Old 12th October 2013, 16:46   #5  |  Link
PaulD
Registered User
 
Join Date: Sep 2013
Posts: 6
Thanks, very good of you. I don't think I can send a sequence via the forum but attached is a jpeg frame extracted from it which illustrates the problem. The bands are in the sky.
Attached Images
 
PaulD is offline   Reply With Quote
Old 13th October 2013, 14:30   #6  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,376
I dunno, looks like skew (tape tension) error maybe. Here's an experimental script that might help.
Code:
## requires MaskTools2
LoadPlugin(pathBase + "MaskTools2\mt_masktools-26.dll")

## <<YV12 source>>

ChromaDestripe()
#return Last

## optional color correction
ConvertToRGB()
return MergeRGB(
\    ShowRed.Levels(0, 1.10, 255, 0, 255), 
\    ShowGreen.Levels(0, 1.0, 255, 0, 255), 
\    ShowBlue.Levels(0, 0.75, 200, 0, 255)
\  ).Levels(15, 1.2, 235, 0, 255) 

#######################################
## remove horizontal chroma stripes
##
## @ top - number of pixels (from top) to process (default 160)
## @ blur - vertical chroma blur radius (default 12)
## @ thresh - ignore smaller chroma changes (default 6)
##
function ChromaDestripe(clip C, int "top", int "blur", int "thresh")
{
    top    = Max(0, Default(top, 160))
    blur   = Min(Max(2, Default(blur,  12)), 16)
    thresh = Min(Max(0, Default(thresh, 6)), 32)

    U = C.UToY8
    V = C.VToY8
    Y = C.ConvertToY8
#return Y

    tw = V.Width
    th = V.Height

    ## X = (highpass blurred anti-signal)

    xh = Max(1, Round(th / 4))
    XU=U.BilinearResize(tw, xh, src_top=1, src_height=(th-2))
    \   .BilinearResize(tw, th) 
    XV=V.BilinearResize(tw, xh, src_top=1, src_height=(th-2))
    \   .BilinearResize(tw, th)
#return XU

    ## H = highpass - find bold horizontal U & V edges

    HU=U.Subtract(XU).Invert.ColorYUV(cont_y=98)
    HV=V.Subtract(XV).Invert.ColorYUV(cont_y=98)
#return HU.Histogram

    ## M = mask - pass only areas with bold hor. U & V edges

    MU=HU.mt_lut("x 128 - abs " + String(thresh) + " - 512 * ")
    MV=HV.mt_lut("x 128 - abs " + String(thresh) + " - 512 * ")
#return MU

    MU=MU.mt_expand
    \    .BilinearResize(tw/4, th/4)
    \    .mt_expand.mt_expand
    \    .BilinearResize(tw, th) 
    MV=MV.mt_expand 
    \    .BilinearResize(tw/4, th/4)
    \    .mt_expand.mt_expand
    \    .BilinearResize(tw, th) 
#return MU

    ## restrict mask to "top" pixels

    top = top / 2
    MU = (top<=0 || top>=th) 
    \       ? MU 
    \       : MU.Crop(0, 0, -0, top).AddBorders(0, 0, 0, (th-top))  
    MV = (top<=0 || top>=th) 
    \       ? MV 
    \       : MV.Crop(0, 0, -0, top).AddBorders(0, 0, 0, (th-top))
#return MU

    ## B = chroma blur

    nh = Max(1, Round(th / blur))
    BU=U.BilinearResize(tw, nh, src_top=1, src_height=(th-2))
    \   .BilinearResize(tw, th) 
    BV=V.BilinearResize(tw, nh, src_top=1, src_height=(th-2))
    \   .BilinearResize(tw, th)
#return BU

    ## use blurred chroma in areas of high variation

    U=U.Overlay(BU, mode="blend", opacity=1.0, mask=MU)
#return U
    V=V.Overlay(BV, mode="blend", opacity=1.0, mask=MV)

    return YToUV(U, V, Y)
}
I don't have any video around with this type of error, but the script helps the sample image and doesn't seem to hurt normal footage. With one exception: color bars get smeared.

Here's the progress of the U channel (most of the error in this example is in the U channel, but both channels are processed in the script)

Last edited by raffriff42; 18th March 2017 at 00:21. Reason: (fixed image links)
raffriff42 is offline   Reply With Quote
Old 14th October 2013, 23:16   #7  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 718
Can you provide a video sample PaulD ?
Mounir is offline   Reply With Quote
Old 22nd October 2013, 15:29   #8  |  Link
PaulD
Registered User
 
Join Date: Sep 2013
Posts: 6
Thanks for your script raffriff42. However I'm afraid I'm a complete novice at this and when I run Avisynth with the script I get the error message UVtoY: YUV data only!. Do you know what I'm doing wrong?
PaulD is offline   Reply With Quote
Old 22nd October 2013, 15:32   #9  |  Link
PaulD
Registered User
 
Join Date: Sep 2013
Posts: 6
I've loaded an example on YouTube at: http://youtu.be/EK2x3zMKVdg

Quote:
Originally Posted by Mounir View Post
Can you provide a video sample PaulD ?
PaulD is offline   Reply With Quote
Old 22nd October 2013, 17:33   #10  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,376
Quote:
Originally Posted by PaulD View Post
Thanks for your script raffriff42. However I'm afraid I'm a complete novice at this and when I run Avisynth with the script I get the error message UVtoY: YUV data only!. Do you know what I'm doing wrong?
You need a statement in the script to replace the placeholder
Code:
## <<YV12 source>>
First see this page: Your first Avisynth script. Work at the example script on that page (you may need a different "source" plugin as explained in the link) until you can successfully "play" your script with Windows Media Player, VirtualDub etc. Then check if your source is YV12 or not:
Code:
<<source>>
Info
...which will put a text overlay on the screen. Look for "ColorSpace: YV12" - if ColorSpace is something else, add a new line:
Code:
<<source>>
ConvertToYV12
OK, now that's done, go back to the script I posted and replace the placeholder source statement.

The next issue is downloading & installing the required plugin, MaskTools2. If mt_masktools-26.dll is copied to the Avisynth plugins folder you can delete the "LoadPlugin" line, otherwise edit the "LoadPlugin" line to load mt_masktools-26.dll from wherever you have it.

If all this is done correctly the script should run...
raffriff42 is offline   Reply With Quote
Old 22nd October 2013, 18:28   #11  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,195
virtualdub's camcorder color denoise is the one you're looking for
lansing is offline   Reply With Quote
Old 23rd October 2013, 12:32   #12  |  Link
PaulD
Registered User
 
Join Date: Sep 2013
Posts: 6
Thanks raffriff42. It was the convert line I was missing. It now works, and the output is much improved.
PaulD is offline   Reply With Quote
Reply

Tags
chroma, color bands, filters, virtualdub

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.