Log in

View Full Version : How to remove Polavision (instant film) vertical lines


johnmeyer
22nd December 2011, 03:00
I am transferring a dozen reels of Polaroid "Polavision," which is instant movie film, sold in the late 1970s.

Here is a link to a short DV clip that illustrates the problem:

Polavision vertical line problem (http://dl.dropbox.com/u/1561578/Polavision%20Clip.avi)

If you don't have time to download the clip, here is a single frame from the capture which illustrates the obvious problem:

https://i.imgur.com/li8XnFR.png

I can use a blur filter to average out the vertical lines (which are caused by how the instant film emulsion worked), but I thought I'd ask if anyone has other, better ideas. I have tried DeFreq, but couldn't get it to do anything. Also, if a blur filter truly is my best approach, which blur filter would you suggest I try?

One note: because this is a film transfer, the film "weaves" in the gate, which means that every frame moves around. I may be able to motion-stabilize the frame to avoid this, but I think I have to assume that the lines will be in a slightly different X position in each frame.

mandarinka
22nd December 2011, 04:40
I'm not sure if it will be usable in this case, but try fft3dfilter with defined pattern. Make an image with such vertical stripes in mspaint, splice that after the video (take note of the framenumber and give it to fft3dfilter for the respective parameter.)

It needs some tweaking, but sometimes you can do a lot with this trick, if the defect is regular like this. Example from an experiment (before/after):http://screenshotcomparison.com/comparison/53026

johnmeyer
22nd December 2011, 06:58
I'm not sure if it will be usable in this case, but try fft3dfilter with defined pattern. Make an image with such vertical stripes in mspaint, splice that after the video (take note of the framenumber and give it to fft3dfilter for the respective parameter.)

It needs some tweaking, but sometimes you can do a lot with this trick, if the defect is regular like this. Example from an experiment (before/after):http://screenshotcomparison.com/comparison/53026Thanks for that. I spent some time getting the noise pattern and looking at the results. I couldn't get it to work very well.

I also tried the function that *.mp4 Guy produced:

function DeStripe (http://forum.doom9.org/showthread.php?p=1408276#post1408276)

It is promising, but it is late here and I haven't yet figured out how to tweak it.

yup
22nd December 2011, 08:27
johnmeyer!
Try http://forum.doom9.org/showthread.php?p=1541580#post1541580
Before using turn to right.
Tune thicknessline.
yup.

Bloax
22nd December 2011, 11:09
I'm stupid, I know. But these kind of seem to work.
Here's a fast one:
TurnRight()
Merge(Yadif(0,1),Yadif(0,0),0.5)
Merge(Yadif(0,1),Yadif(0,0),0.5)
TurnLeft()

And here's a slow one that 'kind of' looks the same:
PointResize(Width*2,Height*2)
TurnRight()
SangNom(0,255).SangNom(1,255)
TurnLeft()
BilinearResize(Width/2,Height/2)
The only real difference is that the slow one (30 fps) is less "tightened" than the fast one (100+? fps)

Here's what I mean: Fast (http://i.imgur.com/MmD65.png), Slow (http://i.imgur.com/alXrN.png)

Edit: There's also this, which is even faster. (And more like the slow one) - Except that it introduces new (but fortunately slight) checkerboard artifacts in some lines.
In any case, it's much less extreme than the original lines.
TurnRight()
Merge(Merge(RemoveGrain(15),RemoveGrain(16),0.5),Merge(Yadif(0,0),Yadif(0,1),0.5),0.33)
TurnLeft()

Didée
22nd December 2011, 12:58
MergeLuma(Removegrain(4,0),0.59)

Bloax
22nd December 2011, 15:14
I think it's faster if you do RemoveGrain(4,-1), and my quick and dirty tests do show that.
Not that we need chroma for luma functions anyway. ;)

Edit: Interesting.

TurnLeft()
BilinearResize(Width,Height/2).PointResize(Width,Height).RemoveGrain(15,-1)
TurnRight()
MergeLuma(last2,last)
This is quite destructive, as it pretty much discards half the height, and interpolates what was lost using (hah) RemoveGrain.

johnmeyer
22nd December 2011, 18:29
I'm battling a cold today, so I'll be a little slow in trying these suggestions. They all look very promising. Thank you all, and I'll get back to you in a little bit ...

johnmeyer
24th December 2011, 02:17
I tried three of the suggestions above, and compared them using the code below. None of them did any truly bad things to the awful Polavision film. **

I have access to all thirty minutes of film and as I looked at each of the three approaches, the simple mergeright/mergeleft with yadif seemed to remove the lines in more scenes than the other two approaches.

My workflow from here is as follows.

I captured the film twice, at different exposures, and will now merge them together, using the highlights from the darker exposure and the shadows from the lighter exposure. This is a brute force HDR technique that works very well for dense film (Polavision is denser than Kodachrome). I'll then feed the result into a version of VideoFred's film restoration script, but with the additional filter from this thread added at the beginning.

I'll post a few seconds here when I'm finished just so you can see the difference.

Thanks to everyone for their help!

#Script to remove vertical lines in Polavision captures

load_stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")

source=AVISource("e:\frameserver.avi").ConvertToYV12()
assumefps(source,16)

output1 = Fix1(source)
output2 = Fix2(source)
output3 = MergeLuma(Removegrain(4,0),0.59)

one=StackHorizontal(source,output3)
two=StackHorizontal(output1,output2)
StackVertical(one,two)


function Fix1 (clip c)
{
TurnRight(c)
Merge(Yadif(0,1),Yadif(0,0),0.5)
Merge(Yadif(0,1),Yadif(0,0),0.5)
TurnLeft()
}

function Fix2 (clip c)
{
TurnRight(c)
Merge(Merge(RemoveGrain(15),RemoveGrain(16),0.5),Merge(Yadif(0,0),Yadif(0,1),0.5),0.33)
TurnLeft()
}

**(Polavision film was developed with chemicals in the film cartridge and then projected and stored in that cartridge. As a result, unlike regular film, that chemical residue was never rinsed away. The result is film full of mold and chemical spots).