Log in

View Full Version : idea... VHS scanline offset fixer (?)


Mug Funky
29th July 2003, 10:12
hey there...

i've noticed that when capturing VHS footage, one thing that filtering and smoothing can't really fix is the weird wobbly properties that VHS exhibits (especially old footage).

but i also noticed that a lot of the time this could be fixed with a simple plugin. the reason being that most captured frames have a black border of a few pixels width. we can assume that it's perfectly straight ideally, and if one compares the actual image, it will be wobbly (lines will be offset randomly due to deterioration in the synch signals in the overscan area). so if one compared the edge of the black region to an ideal average, one could shift the line back or forward a few pixels to line it up. obviously dark regions would have difficulty, but tolerances could be included, etc.

i'd do this myself if i knew the first thing about this coding stuff. unfortunately, i'm a multimedia student, not a computer scientist... but i figure the idea is still theoretically good, and if anyone cares enough, they are welcome to use it.

okay... enough forum spamming for now. hope someone finds this a useful idea.

cheap-red-wine
29th July 2003, 13:52
See here:

http://neuron2.net/ipw-web/bulletin/bb/viewtopic.php?p=372

MrTibs
31st July 2003, 21:23
For this filter, a good method would be to make use of a MAD calculation. The idea here is to assume that the line above and/or below are simular. The MAD calculation is used for motion detection (the lower the MAD the lower the motion).

Here is the idea: (Y - is the line we are working on...)

1. Search Y-1 until you find an edge (from black to whatever).
2. Do the same for Y.
3. Compare the X position for Y-1 and Y. If they are not the same:
a. Calculate the MAD value between Y-1 and Y.
b. Shift Y until it is aligned with Y-1 and calculate MAD2.
If MAD2 is below MAD then you've probably got it right.
(optional - Calculate the MAD value of this line with the last fame)

4. Move to the next line.

Mug Funky
2nd August 2003, 20:11
hmm. the thread you posted implied that motion compensation like tomsmocomp could be used just on the edges...

unfortunately i'm not a coder. but theoretically this problem is not intractible.

incidentally, another thing mentioned on that thread was raw capturing including overscan areas. that would be an awesome thing. i know DV streams have overscan areas (whether that extends to sync pulses remains to be seen) that don't show up on screen. this is why if macrovision content is captured, is can't be written back to tape from a DV file. it would be good for a decoder to be able to show all 625 lines of PAL... sigh

MrTibs
5th August 2003, 00:58
Unfotunatly, I don't have any video source that has the problem, but the filter sounds like it would be fun to do. If I find some source to use for development, I'll write the filter.

OUTPinged_
5th August 2003, 16:35
I can provide some test material for it.