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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th November 2002, 02:06   #1  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
Guava Comb

Here is Guava Comb, a software comb filter. It is meant to get rid of rainbows and dot crawl in stationary parts of an image.

This filter is dedicated to my dad, the guava hunter.

http://students.washington.edu/ldubb...Comb_v0_9a.zip

The Guava works through the efforts of a tiny demon, who watches to see which pixels are changing back and forth. When it spots one, it thwaps the pixel so it will learn to stop being so fickle. The demon’s efforts are quite inexpensive, as he has been unemployed ever since the passage of the second law of thermodynamics.

Oddly enough, that’s actually a moderately accurate description of this filter!

This is a version 0.9 release because I am not all that familiar with the right way to handle interlaced material in a script. That’s something of a handicap when designing a filter meant for interlaced clips. Please tell me if the way it’s handling clips (interlaced or otherwise) is messed up.


Dot crawl and rainbows are an artifact of mistakes in conversion of a composite signal into its individual color components. So if your video was never encoded as a composite signal, this filter will probably be useless. On the other hand, it’s possible that this filter might coincidentally help remove some other kinds of periodic artifacts. To test out that possibility, there is an extra Mode setting called “Progressive” which will force the filter to look for every other frame patterns.

If your video has been encoded as a composite signal — as an over the air broadcast, or over a composite cable — then comb filtering is likely to be very useful. Crosstalk can cause subtle picture problems even in video where it is not obvious.

The down side is that the settings are not easy to choose, and that this isn’t an especially sophisticated filter. As a result, it can cause artifacts. Take a look at the docs for ways to set the options to minimize problems.
__________________
9:) Lindsey Dubb

Last edited by High Speed Dubb; 7th November 2002 at 03:17.
High Speed Dubb is offline   Reply With Quote
Old 7th November 2002, 02:18   #2  |  Link
soulfx
The Digital Soul
 
soulfx's Avatar
 
Join Date: Jun 2002
Location: Nebraska, USA
Posts: 114
Sweet! Thank you very, very much for this filter. I'll test it out after I get Bernie Mac captured.
soulfx is offline   Reply With Quote
Old 7th November 2002, 04:50   #3  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Hmmm... it didn't even make a dent in a rainbow torture clip I have
Zarxrax is offline   Reply With Quote
Old 7th November 2002, 04:58   #4  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
Hmm... could you try it at really permissive settings? i.e., something like

return AviSource("C:\CAPTUREcombExample.AVI").ConvertToYUY2().GuavaComb(mode="ntsc", MaxVariation=70, activation = 10, recall = 70)

That’ll cause too many artifacts to be useful, but should confirm whether the problem qualifies as crosstalk — or whether there’s something messed up with the phase [PS: that should have read frequency] of the filter.

Also, what is the resolution and duration of the clip? And is there any motion in the area of the crosstalk?
__________________
9:) Lindsey Dubb

Last edited by High Speed Dubb; 7th November 2002 at 06:16.
High Speed Dubb is offline   Reply With Quote
Old 7th November 2002, 05:51   #5  |  Link
soulfx
The Digital Soul
 
soulfx's Avatar
 
Join Date: Jun 2002
Location: Nebraska, USA
Posts: 114
From the testing I've just started it does sucessfully get rid of comb crawl, but I have to put it before the IVTC filter. If I put it after it seems like the filter somewhat fades in and out of what its supposed to do.

So it handles interlaced streams better then progressive it seems.

I've got some more testing to do, but so far it looks good.
soulfx is offline   Reply With Quote
Old 7th November 2002, 05:56   #6  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
Yep, it should definitely be run before deinterlacing or inverse telecine.
__________________
9:) Lindsey Dubb
High Speed Dubb is offline   Reply With Quote
Old 7th November 2002, 06:02   #7  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
... though now that I think about it, it would be possible to allow a mode for material which has already been deinterlaced. That should work reasonably well for NTSC, but will still leave some residual artifacts on PAL stuff. Still, you’d always get better results running the comb filter before line doubling.
__________________
9:) Lindsey Dubb
High Speed Dubb is offline   Reply With Quote
Old 7th November 2002, 06:04   #8  |  Link
Xenoproctologist
Registered User
 
Join Date: Apr 2002
Posts: 66
*JOYGASM!*
I've been hoping someone would port this thing to avisynth for eons.


@soulfx:
It's not that it handles progressive better than interlaced. It's just that it depends on the shimmering having a certain regular period, and IVTC disturbs that period.
Xenoproctologist is offline   Reply With Quote
Old 7th November 2002, 06:36   #9  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
Yep — Just how badly it will be disrupted depends on the kind of IVTC/deinterlacing.

NTSC deinterlacing will usually result in crosstalk regions being detected as motion, and bobbed. As coincidence has it, simple bobbing is an NTSC comb filter, so this could be dealt with by just checking every other line for crosstalk. (More sophisticated bobbing algorithms could cause trouble, though.)

PAL deinterlacing would probably be messy, with some crosstalk detected as motion, other crosstalk not. So that’s a case where comb filtering needs to go first.

2:2 pulldown material should be handled okay before or after comb filtering. But it would still be better to run the comb filter before, since correcting crosstalk makes things easier for the pattern detector.

Handling 3:2 pulldown material would depend on knowing the pattern which was applied. And besides, 3:2 pattern detection is badly mislead by crosstalk. (It causes an inflated difference between matching frames.) So that’s another case where comb filtering really needs to go first.
__________________
9:) Lindsey Dubb
High Speed Dubb is offline   Reply With Quote
Old 7th November 2002, 07:06   #10  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,717
Thanks Lindsey, I've been waiting for a good rainbow removal filter. I'll give it a go with my latest analog capture and see if it works
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 7th November 2002, 07:21   #11  |  Link
soulfx
The Digital Soul
 
soulfx's Avatar
 
Join Date: Jun 2002
Location: Nebraska, USA
Posts: 114
I understand, I guess I just mis-read the inital post of "Please tell me if the way it’s handling clips (interlaced or otherwise) is messed up." Putting it on pure interlaced material works fine for me; that's all I have.

The default settings work great for me and I am just taken back at how still all my captures are now. The little crawly dots, chroma rainbows, -- it's all gone now.

I have noticed on scene changes it does leave little bits of color from what it was smoothing out on the previous scene, but compared to some temporal smoother's I've messed with in the past I can deal with it.

This filter is speedy too.
soulfx is offline   Reply With Quote
Old 7th November 2002, 07:37   #12  |  Link
Xenoproctologist
Registered User
 
Join Date: Apr 2002
Posts: 66
@High Speed Dubb:
What's the likelyhood of getting scene-change detection implemented?
Xenoproctologist is offline   Reply With Quote
Old 7th November 2002, 07:52   #13  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
Quote:
Originally posted by soulfx
I understand, I guess I just mis-read the inital post of "Please tell me if the way it’s handling clips (interlaced or otherwise) is messed up." Putting it on pure interlaced material works fine for me; that's all I have.
Sorry about that — I was thinking of 30 FPS 480x640ish captures as “progressive,” which isn’t really right.

As it’s written, the filter checks vi.field_based, and assumes each “frame” is really two weaved (woven?) fields if field_based is false. (That’s probably meaningless to you, but it might let some of the programmers catch any mistakes. I’ll put up the code reasonably soon to make this a little clearer.)

I’m mostly looking right now for
- Whether it works
- Whether the syntax is sensible, and follows the conventions for interlaced clips
- Reasonable parameters for PAL use

About the flashes after scene changes — A scene change detector seems like a bit of a kludge. It would work, but a better solution would be to look a couple frames ahead of the video, to confirm that crosstalk is continuing. That would also help get rid of scattered motion spots.

Then again, a scene detector would be faster and easier.
__________________
9:) Lindsey Dubb
High Speed Dubb is offline   Reply With Quote
Old 7th November 2002, 08:18   #14  |  Link
Xenoproctologist
Registered User
 
Join Date: Apr 2002
Posts: 66
Quote:
Originally posted by High Speed Dubb
About the flashes after scene changes — A scene change detector seems like a bit of a kludge. It would work, but a better solution would be to look a couple frames ahead of the video, to confirm that crosstalk is continuing. That would also help get rid of scattered motion spots.

Then again, a scene detector would be faster and easier.
Reading ahead might be more elegant, but it wouldn't be more correct. A scene-change — when it occurs — should instantaneously kill all blending.

Now, the elegant and correct solution would be to read ahead and detect scene-changes. That way, all blending is killed at the moment of scenechange and crosstalk is blended anew on the first frame of the new scene.
Xenoproctologist is offline   Reply With Quote
Old 7th November 2002, 08:40   #15  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
Hmm... No, I don’t agree. Logos and graphics will sometimes stay on screen through a scene change, and those should be smoothed.

A scene change can be thought of as motion which occurs throughout the screen. (Well, it gets to be different if you’re going to track motion vectors, but that’s much more sophisticated than I want to mess with for this.) So I’d prefer to just improve the motion detection. Besides, that needs improvement, regardless.
__________________
9:) Lindsey Dubb
High Speed Dubb is offline   Reply With Quote
Old 7th November 2002, 15:04   #16  |  Link
jarthel
plebian
 
Join Date: Nov 2001
Posts: 775
will test later

jayel
jarthel is offline   Reply With Quote
Old 7th November 2002, 18:25   #17  |  Link
lamer_de
Member
 
lamer_de's Avatar
 
Join Date: Dec 2001
Location: somewhere far beyond
Posts: 270
First, let me thank you for your filter.

Unfortunately, it doesn't seem to have any effect on my Simpsons TV Cap in SVCD. Maybe i overlooked something, but i proceeded as stated in the readme, even tried the "insane" settings, but the only effect it had were strange artifacts and ghosting (with the extreme settings). Maybe the crawling is too little, or the source format is wrong (i tried NTSC (it's NTSC), PAL and Progressive, each with no visible changes)

I used this AVS:
Code:
LoadPlugin("c:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
LoadPlugin("c:\PROGRA~1\GORDIA~1\GuavaComb.dll")
LoadPlugin("c:\PROGRA~1\GORDIA~1\DeComb.dll")
mpeg2source("C:\the.simpsons.14x01.svcd.d2v")
ConvertToYUY2()  
# ConvertoYUV shouldn't be needed here, right?
GuavaComb(mode="ntsc", MaxVariation=70, activation = 10, recall = 70) 
Telecide(chroma=true,threshold=8)
Decimate(cycle=5)
Note that the MaxVar,activation and recall values shown in this avs are too strong, but it was simpy to see the effect( which didn't show up
I upped the corresponding scene here. I would be very happy if somebody could have a look on it or tell me what i did wrong. The crawling is most visible at Maggie's chair (see attached image [may take some time till approved by a moderator] EDIT: I guess i was too dumb to attach the image, so simply dl the rar )

TIA,
lamer_de

Last edited by lamer_de; 8th November 2002 at 15:15.
lamer_de is offline   Reply With Quote
Old 7th November 2002, 21:29   #18  |  Link
soulfx
The Digital Soul
 
soulfx's Avatar
 
Join Date: Jun 2002
Location: Nebraska, USA
Posts: 114
lamer_de,

Have you made sure you have ample amount of time up to the points you are looking at? Make sure if you want to look at specific frames to go back about 40 frames or so then play the video forward to the frame you want to look at.

I've had tremendous results with the filter, but you have to make sure you are running it on interlaced material. If it's not interlaced then it can't properly figure out what or where the comb problems exist.

But from the script and everything you've mentioned it should be working. Maybe you can cut out a little snippet of the video and put it up and see if someone here can trouble shoot it further.

I would be able to duplicate exactly the same clip (I captured the Halloween Special this last Sunday too), but I've allready processed it, deleted it and moved on.
soulfx is offline   Reply With Quote
Old 7th November 2002, 21:47   #19  |  Link
High Speed Dubb
Registered User
 
Join Date: Jan 2002
Posts: 283
lamer_de,

It could be that the problem lies here
mpeg2source("C:\the.simpsons.14x01.svcd.d2v")

The compression may have disrupted the crosstalk artifacts enough to throw off the filter. I’ll take a look at the clip this afternoon to check.
__________________
9:) Lindsey Dubb
High Speed Dubb is offline   Reply With Quote
Old 8th November 2002, 00:08   #20  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
@High Speed Dub:

Nope, those settings didn't have any visible effect on the clip.
I'm sending you a private message so you can see whats wrong with it.
Zarxrax is offline   Reply With Quote
Reply

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 07:33.


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