View Full Version : Ghosting... some analysis
mg262
21st July 2004, 21:39
(Before I start, this thread is an analysis of a capturing phenomenon so I have put it in this forum, but if it turns into a discussion of solutions, please move it somewhere more appropriate.)
I been capturing from an commercial PAL VHS tape (old but in very good quality) and I have the following ghosting effect:
http://testtesttesttest.50megs.com/images/ghost.jpg
At least some shadowing is apparent on a TV, so I don't think this is anything to do with my card (a MSI TV@nywhere Master). This is a purely luma phenomenon, at least in my case, so I've presented gray scale screenshots. All the shots are of fields, not frames.
I have heard some explanations for this (e.g. that the signal was bounced off something and interference occurred), but I wasn't particularly convinced, so I have looked at the distortion of the waveform. Taking something that should have been a sharp transition (ie a step function), namely a segment of a scanline inside the pink box in the logo below and another scanline slightly further down:
http://testtesttesttest.50megs.com/images/bbc.jpg
I plotted the luma values (extracted with the useful Vdub filter ShowPixelValues) and came up with this:
http://testtesttesttest.50megs.com/images/lowpass2.jpg
This is clearly a frequency domain phenomenon -- in particular, it looks like the effect of some kind of lowpass filter on a step function. It follows that simply adding a translated and inverted copy of the image (as certain AVISynth and VirtualDub filters do) is not the optimal solution.
You can see the effect in these links (sorry I can't find a better one)...
http://www.math.ucla.edu/~cratsch/151b.2.04s/Lectures/Fourier/fourier.html
http://cnx.rice.edu/content/m0041/latest/
Long enough for one post... I'd be interested to hear if other people encounter the same phenomenon.
Arachnotron
21st July 2004, 21:58
I don't know if something like it is possible with videotapes and the way the magnetic data is stored on it, but could this not be caused by the magnetic field of a certain stretch of tape being altered by the field of the tapeloop under or above it on the reel? If so, you would expect it to be most noticable on high frequency high intensity signals on tape that has been stored a long time without playing.
I do know that you can have something like it on audio tape. Sounds a bit like a faint echo.
mg262
21st July 2004, 22:48
Interesting idea, but my gut feeling is that the period of that effect would be far too low to account for this... I should have made it clear that the horizontal stretch is a approx 25 pixel span (I plotted a smooth curve through the points), so the peak-to-peak span of the waveform is around the 5 pixel range -- and there's no way the tape wraps that fast. I suppose it could be an interference from adjacent frames... no that wouldn't work because there's no reason why it would lineup so nearly with the present frame.
As part of the VHS specification, the signal is actually put through a lowpass filter before being stored, but if that was the source of the effect, I would expect to see it on all tapes.
tedkunich
21st July 2004, 22:52
Hmmm... looks familiar.... I have the same ghosting effect with my Leadtek caps off of LD... I would not rule out the card so fast, it might be worth looking into that end a little more. :)
t
mg262
21st July 2004, 23:34
It could well be exacerbated by the card, but I'm sure it's on the tape... it was the first thing I noted when playing it back to TV.
Actually, can anyone verify that they've seen a VHS tape which they're *positive* doesn't have any ghosting at all?
Edit:
Just found this:
http://groups.google.com/groups?q=Laserdisc+low-pass&hl=en&lr=&ie=UTF-8&selm=31EEE660.4A2A%40ix.netcom.com&rnum=1
Basically says that laserdisc is lowpass filtered as well (at 4.2 MHz).
Edit again:
Also notes that VHS is lowpass filtered at 2.2MHz (I have read other figures elsewhere, I think). Since I'm capping at 768 by 576 by 25fps, that's 10,905,600 pixels per second, which means that a 2.2MHz sinewave would have peaks occurring every 4.96 pixels (compare the 5-pixel range noted above).
Surely that's got to be it? ... but it does imply that this effect is present in all tapes...
I'm too sleepy to figure this out... if it is just a case of lowpass filtering at that frequency, we can definitely reverse it to some degree, but it could be something completely different. Anyway, talk to you guys in the morning...
trevlac
22nd July 2004, 03:25
An interesting post.
You seem to be talking about ringing. I assume your point is the waves after the sharp peak. Not the 2 different lines. BTW, 1 line had the waves and 1 did not. Right?
Ringing is an effect of using a truncated sinc function for a filter. This can be reduced by smoothing out the truncation with a window (aka 'slower' filter).
Are you trying to really prove a general hypothesis? Instead, maybe state it and try to disprove it.
If it is ringing due to filtering, what does the filtering? In the original source or is it the VCR? Probably just the source. Or VHS in general? I doubt it. If it's in the source, then do other sources show this? Not if they are agressively filtered.
Yadda, yadda, ...
Just a few comments to keep the thread going ... :)
rfmmars
22nd July 2004, 04:15
What you are seeing is called video overshoot or ringing. This done to make the image look sharper and still is done in DVD production but correctly.
Also bad or no video terminaton can produce this. A low pass will help, but with some lost of detail.
richard
www.photorecall.net
Arachnotron
22nd July 2004, 09:09
@rfmars
Also bad or no video terminaton can produce this
Could having both a TV conected to scart and a capcard connected to a composite output cause this? On many VCR's, these two are actually in parallel, so having two devices connected would put the input impedances in parallel too, halving them.
A second option is a sharpening filter in the VCR. My VCR has one, but I don't know if you can get this effect since I always have it turned off.
mg262
22nd July 2004, 09:27
trevlac - I was too sleepy to prove anything at that point! Just confused that the effect matched up so well with an effect predictable from the specification. Both lines had waves - it's just that the period was higher in one of them. Ringing it is - thankyou.
The effect is precisely that produced by a sinc convolution filter, since this corresponds to a multiplication by a box filter in the frequency domain, i.e. a lowpass filter. The fact that the sinc filter may or may not have been truncated isn't causing the effect, although it will affect the shape of the waveform.
I only have four VHS tapes here (and no TV or TV signal) so it's hard to test in general. It is the case that at the few points in my tapes where one would expect a sharp transition (notably the credits), this effect definitely occurs to some degree. (Often together and with a general shadow to the right of the bright credits.) I am very curious as to whether other people experience this.
This can be reduced by smoothing out the truncation with a window (aka 'slower' filter).
You mean, convolving with a box? That's true, but I'd rather do something targeted specifically at the effect in the frequency domain.
At some point later today I'll take the response function of a lowpass filter and F. transform it and then convolve it with the step function to see what the expected shape of the waveform would be -- if it matches up, then it's very probably the cause of the effect *in my case*.
rfmmars -
Also bad or no video terminaton can produce this.
I'm sorry, I don't follow what you mean...
mg262
22nd July 2004, 10:08
@arach,
I don't own a TV! Sharpness could very possibly be it... I have a CX23881 MSI TV@nywhere, + keep the sharpness set to 4. Will keep testing...
Arachnotron
22nd July 2004, 10:19
I don't own a TV! Sharpness could very possibly be it... I have a CX23881 MSI TV@nywhere, + keep the sharpness set to 4. Will keep testing...
The TV was just an example of how you can screw up the termination by connecting more than one device to a composite output.
As for the sharpness: I was actually referring to the digital sharpness filter in my VCR. Many VCR's have one.
But having the sharpness of a CX23881 set to 4 is extremely high! That corresponds to an amplification of +6 dB at Fsc (3.58 for NTSC, 4.43 MHz for PAL).
See page 2-101 of the CX23881 datasheet for the details of the peaking filter. Personally, I'd set it to 0 and do any sharpening only when needed in post.
(you can find that one here (http://forum.doom9.org/showthread.php?s=&threadid=59013)
mg262
22nd July 2004, 11:51
You actually found the spec sheet! I was never sure what the sharpness control actually did... from other post on this forum I thought low sharpness actually invoked a hardware blur, so I kept at the default. It's very clear from the sheet that using high sharpness with VHS isn't a great idea, since most of the frequencies you're amplifying have been reduced into oblivion before being dumped on the tape.
On the other hand there is a perceptible difference in sharpness in the result, and there may be advantages to doing it in hardware since no one has built any frequency domain tools (correct me if I'm wrong) and also since the inbuilt filter operates before the ADC... I don't know. I might have to play around with sharpening filters and see how the result compares.
To get back to the point... unfortunately this doesn't remove the ringing... although in some places it does make it less obvious. Thanks for the thoughts though.
Oh, and my video has a 3-D 'DNR' (digital noise reduction) function which I keep off, and a TBC which I keep on. There may well be filters you can't switch off as well, though.
I don't suppose anyone knows of any good tools for image manipulation in the frequency domain?
Arachnotron
22nd July 2004, 11:58
On the other hand there is a perceptible difference in sharpness in the result, and there may be advantages to doing it in hardware since no one has built any frequency domain tools (correct me if I'm wrong) and also since the inbuilt filter operates before the ADC... I don't know. I might have to play around with sharpening filters and see how the result compares.
Any filtering has to be (and is) done after the ADC apart from an external analogue anti-aliassing filter. My card (hauppauge) has that one on a cut-off of 6.75 MHz. But the advatage of doing it in-chip may be that at that point you are still dealing with 10 bit samples.
I may be wrong, but I thought any sharpening filter almost by definition operates in the frequency domain.
Oh, and my video has a 3-D 'DNR' (digital noise reduction) function which I keep off, and a TBC which I keep on. There may well be filters you can't switch off as well, though. That sounds like a JVC. Mine does have a filter. BEST I think. It should be set to EDIT., not soft or sharp.
trevlac
22nd July 2004, 13:34
Originally posted by mg262
The effect is precisely that produced by a sinc convolution filter, since this corresponds to a multiplication by a box filter in the frequency domain, i.e. a lowpass filter. The fact that the sinc filter may or may not have been truncated isn't causing the effect, although it will affect the shape of the waveform.
Don't get me wrong. I like your comments and thoughts. I'm just hard pressed to think it is a general case (yet!). :)
The little I may know:
To process a digital signal in a linear fashion, one must recreate the analog (or at least the points you don't currently have). A resize (aka a resample) is a perfect example of this. To find the points on the analog wave you do not currently have, you must calculate them. The way to calculate them is to low pass filter the sampled signal (aka the pixels). BTW: This is not a low pass filter of the original wave, be a LPF to remove the effect of sampling. The pixels and the analog are not the same. We never 'see' the pixels. We see the recreated analog.
The sinc {sin(x)/x} is the perfect LPF for recreating the analog. It contains all frequencies from 0 to .5 of a given rate, and no more.
Unfortunately, a sinc convolution filter is not usable because it has an infinite length (you'd need an infinite amount of pixels to calculate the value of 1 new pixel). To use a sinc you must either truncate it (use a reasonable number of pixels like 20 :) ), or smooth it so it does not run forever. Lanczos is an example of a smoothed sinc.
The fewer pixels and less you smooth, the more ringing. The more you smooth, the more you kill high frequencies you want to keep. The more pixels (length) you use, the longer it takes to calculate and the more you guess on the edges.
Sorry about all of that ..... :)
So ....
If what you see is ringing ... it was most likely created in digital. An analog filter can not be a truncated sinc. Therefore, is it unlikely that this is due to your Tape? Maybe look back at the card?
I don't suppose anyone knows of any good tools for image manipulation in the frequency domain?
Avisynth and VirtualDub. Frequency domain == Spatial domain. They are 2 representations of the same thing.
If you mean giving frequency domain parameters like cutoff frequency ... I don't know, but there are convolution filters out there. Therefore you can apply your own filter if you want.
Again ... sorry about the ramble. I've been learning this stuff on the side a bit so I like the topic.
tedkunich
22nd July 2004, 16:26
Originally posted by mg262
I don't own a TV! Sharpness could very possibly be it... I have a CX23881 MSI TV@nywhere
@mg262
Did you not state in your very first post that this ghosting was visible on your TV? Were you incorrect in that first statement, and what you have been observing is what your capture card has been displaying? The reason I ask is because this sounds like a function of the card (be it the on board filtering or the CX2388x chip itself) rather than your VCR. As I noted earlier, I see this same phenomena in my Winfast card which has the same decoder chip. It is really evident when there is a dark area adjacent to a light area.
I really wish I had some place to post some pics so that we can compare....
Originally posted by Arachnotron
See page 2-101 of the CX23881 datasheet for the details of the peaking filter.
Digging to the data sheet has revealed that Leadtek's driver has got a few things backwards - Setting Gamma to 1 from the default 0 is not enabling Gamma correction in the chip, but rather selecting full Luma range. It would be interesting to see if this is purely a Leadtek screwup or some generic driver screwup. Check out bit 3 of the 2H Comb Control register @ 0x310164.
T
mg262
22nd July 2004, 17:40
Thanks for the thoughts; partial replies... more later:
Any filtering has to be (and is) done after the ADC
Oh, okay. Do you know why that is?
Frequency domain == Spatial domain. They are 2 representations of the same thing. [And similar comments]
Well, any convolution corresponds (essentially 1-1) to multiplication in the frequency domain, so in that sense working in the two domains is equivalent, but actually seeing spectrograms makes it much easier to detect certain effects. (If you look at the frequency domain view in the audio editing program Cool Edit that comment will make more sense.) In particular, if you know what the waveform should look like and suspect that it has been passed through one of the filter standard in electronics (lowpass, etc.) then figuring out exactly what filter has been used is much easier in the frequency domain. If you want to apply a particular frequency filter, you can certainly do it with a convolution; in this case we'll would want to use a 1D convolution along each scanline, but with quite a large window, and I don't know any AS/VD filters that let you do that -- which is not to say that they don't exist!
If what you see is ringing ... it was most likely created in digital.
I think you're quite probably right.
An analog filter can not be a truncated sinc.
... but I don't think this is true.
I don't own a TV here, where I'm capturing and writing this mail, but after I got the tape I went and a hassled someone to play back on a TV to make sure it was okay. My VCRs actually a Panasonic SVHS (latest model has a TBC)... I've tried the corresponding JVC and the noise level (as measured on one of the flat-collour-block VCR menus as well as on a broadcast) was much much higher.
I'm a bit confused as to where the resampling is coming in, unless the output of the ADC is being sampled at different resolution to the one presented to me by the capture card.
One possibility is that this ringing exist as a very subtle phenomenon in all VHS recordings but that something being done by this particular capture card is making it much more visible.
Arachnotron
22nd July 2004, 17:46
Digging to the data sheet has revealed that Leadtek's driver has got a few things backwards - Setting Gamma to 1 from the default 0 is not enabling Gamma correction in the chip, but rather selecting full Luma range. It would be interesting to see if this is purely a Leadtek screwup or some generic driver screwup. Check out bit 3 of the 2H Comb Control register @ 0x310164.
For Hauppauge in PAL mode, RANGE is set to 0 by default and stays that way irrespective of the gamma slider setting.
Setting the gamma slider from 0 to 1 however changes Color Format/Control bit 12 from 0 (enable gamma correction removal) to 1 (disable). So when set to 0, the gamma correction factor of 2.2 / 2.8 is reversed.
So I think this is a Leadtek screwup :)
Arachnotron
22nd July 2004, 17:58
@mg262
Sorry for the double post, I missed your reply.
Any filtering has to be (and is) done after the ADC
Oh, okay. Do you know why that is?
Simply because a capture chip is a digital device and all the filters (including the Y/C separation) are digital too. To be able to do enything with the analogue signal, the first step is to digitize it at a high sample rate. Look at some of the block diagrams in the datasheet.
My VCRs actually a Panasonic SVHS (latest model has a TBC)... I've tried the corresponding JVC and the noise level (as measured on one of the flat-collour-block VCR menus as well as on a broadcast) was much much higher.
Be aware that (VCR) TBC's are digital devices too. So the signal is digitized, processed (and sometimes filtered/sharpened) in digital, and converted back to analogue again. This may give rise to some artefacts you don't see with purely analogue recorders. There is something to be said for integrating the TBC in the capture device, so only one ADDA cycle is neccesary.
If such a VCR does any sharpening (and most do or are capable of doing so) it might lead to ringing too. Though it would have to be a very poorly designed filter to do it to the extend as in your pics.
trevlac
22nd July 2004, 18:48
Originally posted by mg262
... actually seeing spectrograms makes it much easier to detect certain effects.
I agree. I was asking about this in the avs forum a little while ago. Much more knowledge on this topic there. Does not appear to be a FFT for viewing the magnitude. The phase is not really useful. Of course video is 2d so a little more complex.
In particular, if you know what the waveform should look like and suspect that it has been passed through one of the filter standard in electronics (lowpass, etc.) then figuring out exactly what filter has been used is much easier in the frequency domain.
I don't fully agree with this. Video is 2d images you can stare at, so knowing what it should look like in spatial is much easier than in a spatial representation of the frequencies. I do however, believe there is value in the 2 views.
If you want to apply a particular frequency filter, you can certainly do it with a convolution; in this case we'll would want to use a 1D convolution along each scanline, but with quite a large window, and I don't know any AS/VD filters that let you do that -- which is not to say that they don't exist!
There is a large kernal convolution as part of mask tools (I think), and I wrote one recently (with the help of arachno ) for VD. Never really finished. It was mainly for polyphase resizing. Problem with a large kernal FIR (besides the cpu time) is that it needs to hang off the edges of the image. To deal with this, you can either make up the samples (grey, black, copies of the last/first pixel in the line) or produce a 'smaller' output. (Smaller by the length of the filter).
So, for example, convolving a 720 pixel image with a 500 coefficient filter would force you to fake 500 of the output pixels or produce a 220 pixel output.
An analog filter can not be a truncated sinc because the the cutoff is too steap. I of course do not know this for a fact, but I am fairly sure the cost, size, heat issue, etc. for such a piece of electronics would be prohibitive. This is why filter is done in digital.
tedkunich
22nd July 2004, 19:24
Thanks,
I thought as much.... will have to play/investigate a bit more... ;) Kinda scary what a little knowlege, aka datasheet, will do to your free time!!
T
Originally posted by Arachnotron
For Hauppauge in PAL mode, RANGE is set to 0 by default and stays that way irrespective of the gamma slider setting.
Setting the gamma slider from 0 to 1 however changes Color Format/Control bit 12 from 0 (enable gamma correction removal) to 1 (disable). So when set to 0, the gamma correction factor of 2.2 / 2.8 is reversed.
So I think this is a Leadtek screwup :)
FlimsyFeet
22nd July 2004, 21:04
Sorry if I'm not as up on the technical side of things as the rest of you, but I thought this might be useful: I have noticed the same thing in my captures. ATI TV Wonder VE (BT8?8 chip) through composite input:
http://img48.exs.cx/img48/2430/ghost1.png
Now, I think the next image proves that the effect is present on the tape:
http://img48.exs.cx/img48/1788/ghost2.png
The text above is the OSD generated by the VCR - no ghosting - and the text below is the image stored on the tape.
Arachnotron
22nd July 2004, 23:17
@TedI thought as much.... will have to play/investigate a bit more... Kinda scary what a little knowlege, aka datasheet, will do to your free time!!
(This is a bit off topic, but ok...)
Noticed how the CX2388x datasheets are full of double and triple negatives? enabling the disable bit for thisfunction disables the disabling of the thatfunction reversal.. Gaaah :eek: :eek: :eek: :confused:
No wonder nobody can write decent drivers for the thing.
:devil:
tedkunich
23rd July 2004, 01:11
Yea... that is what we get for working off of a preliminary datasheet!!! When I get some time next week, I'll see if I can get an updated DS from Conexant... they'll probably be like Broadcom and require an NDA and a developer agreement to get it though..... :(
T
Originally posted by Arachnotron
@Ted
(This is a bit off topic, but ok...)
Noticed how the CX2388x datasheets are full of double and triple negatives? enabling the disable bit for thisfunction disables the disabling of the thatfunction reversal.. Gaaah :eek: :eek: :eek: :confused:
No wonder nobody can write decent drivers for the thing.
:devil:
mg262
23rd July 2004, 09:06
so knowing what it should look like in spatial is much easier than in a spatial representation of the frequencies.
Well I'm certainly not going to argue with that! But wouldn't be nice to have a tool where you could enter waveforms in either domain and push them back and forth?
Problem with a large kernal FIR (besides the cpu time) is that it needs to hang off the edges of the image. To deal with this, you can either make up the samples (grey, black, copies of the last/first pixel in the line) or produce a 'smaller' output. (Smaller by the length of the filter).
I was thinking about this before I started the thread, and I think I have a better solution. Remove the parts of the kernel that fall off the edge of the screen and scale up the others so they sum to one. So for example
.25 .5 .25
(1/4 2/4 1/4)
On the lefthand most pixel becomes
.667 .333
(2/3 1/3)
It may look ad hoc, but I'm pretty sure it corresponds to having a flat Bayesian prior on the pixels off the edge of the screen...
(In order to implement without wasting even more CPU time this you will of course want to have three loops/scanline, one for the left edge of the screen, one that does most of the pixels, and one that does the right edge of the screen.)
@Flimsyfeet - thank you for the shots! It looks to me as if there is ringing/ghosting on the VCR generated image, although *much* more faintly -
http://testtesttesttest.50megs.com/images/sp.jpg
Note the lighter pixels to the right of the black lines - especially visible about four pixels to the right of the base of the P. (Some kinds of compression can cause this effect, but IIRC PNG is a lossless format?) Could you tell me whether it's NTSC/PAL and what res.? Anyway, this definitely proves that it's possible to have ringing just on the tape, which is good to know!
Incidentally, for whoever else said they wanted to post up screenshots (@tedkunich?), I got hold of a free site at http://www.50megs.com/ and I dumped my pictures on there. Some of the ones on old threads have been destroyed (for external linking), but it's better than nothing... although someone here probably has a better suggestion.
FlimsyFeet
23rd July 2004, 12:29
At first your image said hotlinking not allowed, but I can see it now.
Here's the host I used for my screenshots: http://www.imageshack.us/
Anyway, the effect you're seeing with the lighter pixels could be due to the fact that the OSD text has a black border around each character (so it's still legible against a light background).
The capture was PAL at 720x576.
scharfis_brain
23rd July 2004, 12:45
the P becomes combed, because VHS has a very poor sync, and the VCR's OSD is synced to the VHS sync...
so the OSD is jittering horizontally.
no ringing here.
Arachnotron
23rd July 2004, 13:31
Note the lighter pixels to the right of the black lines - especially visible about four pixels to the right of the base of the P. A white line generated by a digital generator will have some ringing too, and a capture of it will result in grey pixels at the side too as a result of the rise time of the analogue signal. It takes time for the voltage to go from black to white, and if a sample happens to fall in that period it will be gray.
There is a pic in chapter 10.4 of the capture guide that illustrates what I mean. That pic shows the analogue signal resulting from a single white pixel on a DVD, and what the pixels in a capture look like if you cap the DVD signal with a BT878. Notice both the width of the signal (wider than 1/6.75 MHz) and the ringing caused by the imperfect reconstruction filter.
[edit] that curve was taken by hooking up my DVD player to an oscilloscope. A build in character generator is bound to have a simpler reconstruction filter than a DVD player
Note that the whole truncated SINC story applies to reconstruction too.
trevlac
23rd July 2004, 14:20
Here is a further discussion of this issue (with proposed filters to fix).
http://virtualdub.everwicked.com/index.php?act=ST&f=6&t=7433
@mg262
Yeah, I was working on different loops to deal with the start/middle/end when I gave up due to lack of interest and summer weather.
Would you like the code to the polyphase convolution? I'll post a link to the filter and code over the weekend. VDub filters are really not to bad to make, especially once you get going. I'd love it if someone made some step by step instructions on compiling one with the free MS compiler.
mg262
23rd July 2004, 14:55
@trevlac,
Thanks for the offer, but everything you see me write is sent through a speech recognition program... I haven't really been able to code or type much for three years due to a RSI-variant, and you have no idea how frustrating it is! Believe it or not, I am actually using a mouse with my feet... it took a few months to learn to do fluidly, but it's worth it. AviSynth scripts are short enough that I can spell them or cut and paste large chunks, so I can just about manage...
I've read Ivo's post - hi Ivo if you're reading this - and I'll register on that forearm after I've tested those solutions. Everyone seems to have got the idea that I think this is on all VHS tapes, which I never meant to imply... hence:
As part of the VHS specification, the signal is actually put through a lowpass filter before being stored, but if that was the source of the effect, I would expect to see it on all tapes.
Apologies if the other e-mail (the 'sleepy' one) made people think I was claiming a universal effect... I'm not crazy enough to think this effect occurs to this degree on every VHS tape, but I think it *might* be due to the interaction of the VHS filter with something else. I am certainly open to better suggestions.
Edit:
I've tried FixVHSOversharp, which doesn't help at all. (+ before starting this thread I tried GhostBuster/exorcist and fxvhs, which were the filters turned up by a few searches.) Searchghost looks interesting, but none of the following work:
SearchGhost("y", 0, 0,287, 0,384, 28,16, "SearchGhost.txt")
SearchGhost("y")
SearchGhost()
all tell me that I'm sending invalid arguments to the function SearchGhost.
I have in the past, with different tape + different VCR (and briefly in this case as well) tried to deal with this kind of multiple ghosting (or whatever you want to call it) by adding/subtracting multiple images, and I found that the result was generally quite unpleasant. Still, I'll play around with EraseGhost + see what comes out...
(Ivo, or whoever it was, if you're reading this, the registration post for the other forum hasn't appeared in my inbox for some reason. I apologise if the first post seemed "uber-geeky"... I wouldn't claim to be anywhere near as good at processing video as any of you, but I do like to understand why things happen. I also wanted to say something more constructive than "HELP I get lots of SHADOWS on my CAP and someone tell me what to DO" because there are enough of those posts floating round... )
Arachnotron
23rd July 2004, 16:40
Ivo, or whoever it was, if you're reading this, the registration post for the other forum hasn't appeared in my inbox for some reason. I apologise if the first post seemed "uber-geeky" I wouldn't worry to much about that. It just means he likes you ;)
mg262
23rd July 2004, 16:49
Brilliant :) I thought I'd managed to annoy everyone. I really do want to emphasise that I don't claim to know anything about anything... I'm just guessing my way through.
____________________
I've been searching for the Gibbs phenomenon (aka ringing, haloing), and it looks like there's a lot of work on reducing it out there. For example,
http://www.scottsarra.org/math/papers/signal.pdf
(looking through the pictures give you an idea of what it's doing)
And the source code for the software implementing this is available. (On the main page, http://www.scottsarra.org/signal/signal.html)
Edit:
the source code is pretty simple... so it would be nice to try it out. You just basically need to pass in the array of luma values (as doubles) to one function that does edge detection, and then pass both this array and the output of the edge detection function to the reconstruction function. (Both functions have parameters which should be parameters of the enveloping filter.)
If anyone has a Java compiler sitting round (I don't) and is feeling helpful, you may be able to make a cross language call to it, which would be the easiest option. Otherwise I can port the thing to C++ -- it is painstakingly slow through this speech wreck, but it doesn't involve writing new stuff, so I should be able to get it done in a couple of days.
Edit two:
using the speech wreck with Vc was much less awkward than I expected ... I have ported the code to c++, though it still needs a filter around it . Will probably write that tomorrow.
Edit three:
finished it but no luck... the edge detection worked very well (though slowly), but the subsequent smoothing produced junk. This may well be because I didn't hit on the right parameters for this part; it's apparently very sensitive to them. Unfortunately the paper says there is no general method for picking them...
Anyway, the general idea -- finding Edges and then applying a filter just the right of them -- seems like a good one?
FlimsyFeet
24th July 2004, 22:12
Doesn't solve the problem, but the effect can be reduced with the VirtualDub filter Exorcist by Krzysztof Wojdon.
http://img16.exs.cx/img16/629/exorcist.png
(top source, bottom filtered 6 pixels to right with 25% darken)
trevlac
25th July 2004, 03:24
mg262,
Sounds like you are well on your way at writing filters. However, I promised to provide some info. Better late than never.
Here is a basic guide to vdub filters. Not really done, but maybe helpful (along with the sdk).
http://trevlac.us/vdubGuide/Overview.htm
Here is the convolution filter I was toying with. The intention was for resizing. But if you resize to 1:1 you could use it as general convolution. Right now, everything is hard coded. It does a 2x horizontal resize using a 23 tap truncated sinc. I've also included the coefficients for Lanczos, Gausian, and Bilinear. All the work is done in the 'main part of line' loop in the filter01RunProc function. I did add a loop for the left edge, but didn't finish the right edge.
Bottom line, change INTERP_UP from 2 to 1, and change COEFS to the coefficients you want to use. The current case(truncated sinc) should create ringing.
http://trevlac.us/VdubGuide/BasicFilter01.rar
This is throwing a bit of junky source code at you ... but I would be happy to get you to the point I am at (which is implementing convolution). You're on your own when it comes to coefficients that remove ringing. Beats me. :)
mg262
26th July 2004, 22:40
Briefly... also see:
http://neuron2.net/ipw-web/bulletin/bb/viewtopic.php?p=4038#4038
@Flimsyfeet... Thanks for the pointer. I did try Exorcist (and GhostBuster and fxVHS and plain old Layer(op = "subtract", x = ...)) before starting this thread, but I wasn't really happy with any of the results. That may well be because I wasn't sufficiently good at choosing parameters (although I did try for quite a while), but I think it's partly because the distance between the main object and the shadow isn't always the same... you can see that from the fact that in the graphs in the very first post on the peak-to-peak distance varies. I should probably have mentioned all this in my first post...
@trevlac... will get back to you a bit. Apologies for the delay.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.