Log in

View Full Version : Reducing Kinescope Moire


MattW
8th October 2010, 16:27
I have a film-to-video transfer of a kinescope recording which features Sam Cooke. Unfortunately, it suffers from unsightly moire patterning (see images). Do Doom9 forum members have advice as to what Avisynth tools or plugins to resolve the transfer defects? I've found that a vertical fast or Gaussian blur helps to reduce the moire patterning; however, it obviously noticeably blurs the picture. Is it possible to reduce moire without largely sacrificing video quality?

Edit: A small excerpt (6 seconds; 7.5 MB) of the footage (.m2v format) is available here (https://www.yousendit.com/download/WTNLRGw0QTZLVlUwTVE9PQ). The segment is excerpted from a DVD, "Sam Cooke: Legend."

http://i298.photobucket.com/albums/mm258/MattW0224/more1.png

http://i298.photobucket.com/albums/mm258/MattW0224/moire2.png

StainlessS
8th October 2010, 23:02
Dont know what it is but, I would hesitate, to call it moire.

Sample clip would very definitely help those that can help U.

MattW
8th October 2010, 23:29
Dont know what it is but, I would hesitate, to call it moire.

Sample clip would very definitely help those that can help U.

StainlessS,

In response to you reinforcing what I suspected, I have included a hyperlink to a 15-second excerpt of the footage (http://www.yousendit.com/download/WTNKK2Vqb0JCSWV4dnc9PQ) (DV-AVI format) in my original post.

StainlessS
8th October 2010, 23:45
Still downloading, but might I suggest a smaller sample.
54 MB for 15 seconds is a lot, perhaps compression might help.

I'm on mobile broadband, and right now, after 7 mins I'm
65% though the download, not to mention cost of such.
would not normally have to wait this long but not good
connection today.

If you dont have a AVI lossless codec, suggest HuffYUV.

EDIT: also, can scrub the 1.5 Mb/s audio, aint useful.

MattW
9th October 2010, 01:46
Still downloading, but might I suggest a smaller sample. perhaps compression might help. If you dont have a AVI lossless codec, suggest HuffYUV.

I indeed attempted to compress the video with HuffYUV 2.1.1 via VirtualDub 1.9.9 after your suggestion of providing a video excerpt. However, the resulting file (15 seconds) was in excess of 100 MB. A shorter excerpt (3 seconds) was 38.5 MB.

StainlessS
9th October 2010, 18:47
OK, perhaps HuffYUV was not a good choice, (was suffering from mild
alcohol poisoning last night). Loading original "Internal DV Decoder"
codec clip into VD, select "No Audio", "Direct Stream Copy", to
another file. Compressing as results: ZIP=39MB, RAR=37MB,
7ZIP=36MB, suggest about 5 seconds should be ample and result
about 12-13MB.

Had a look at BMP in paint, pattern seems to repeat every 8 lines.
Dont really know what I would do with this, If it were my problem.
This thread:
http://forum.doom9.org/showthread.php?t=121197 mentions something
called Vertical Cleaner, have just downloaded and will have a play with it.

EDIT: Yes absolutely correct, some kind of moire I think.

2Bdecided
9th October 2010, 19:49
If it came from a DVD, you just use DGindex to snip a portion of the original MPEG and upload that. Much smaller.

If it came from somewhere else, letting us know where and how might help with the restoration.

EDIT: 2-2-2-4 pulldown?!

The moire / aliasing is horrible. I wonder if fft3dfilt can lock onto the pattern in creates? NeatVideo can, but it leaves some strange things at the edges of objects.

It should be re-scanned from the film - preferably at higher resolution, and then downscaled appropriately, avoiding moire! I'm guessing this isn't an option. :( Shame - sounds like a great performance.

Cheers,
David.

MattW
9th October 2010, 20:09
If it came from a DVD, you just use DGindex to snip a portion of the original MPEG and upload that. Much smaller.

Thanks for the suggestion, David. Helping a novice (to say the least) is always appreciated. I excerpted a small segment (six seconds, 7.5 MB) with DGindex (download link (https://www.yousendit.com/download/WTNLRGw0QTZLVlUwTVE9PQ)). I have amended my original post to provide a link to the new excerpt. The segment is from excerpted from a DVD (Sam Cooke: Legend).

poisondeathray
10th October 2010, 01:34
One approach might be to use mp4guy's Destripe function on 90 degree rotated fields (the function was intended for vertical bands). Here is the original thread
http://forum.doom9.org/showthread.php?t=154863

It would be better to PM him and ask for his expert advice, but here is my hack attempt. There are still some residual "bands", so maybe you can play with the settings to improve it.

You might want to use other filters to denoise a little bit better and address the dirt & scratches (maybe use descratch() , removedirtmc() and/or related functions ) , maybe fix the flickering as well

These screenshots have been deinterlaced for display purposes, but the script leaves it interlaced (presumably for DVD)


video sample
http://www.mediafire.com/?ng56lqo5pl8t1jn


Original
http://i52.tinypic.com/2ithq15.png

Script
http://i54.tinypic.com/2yxiux3.png



mpeg2source("Doom9 Excerpt (2nd Version).d2v")
assumetff()
separatefields
greyscale()
turnleft
DeStripe(3,0,100)
DeStripe(2,0,800)
DeStripe(1,1,800)
DeStripe(2,0,400)
DeStripe(1,1,400)
turnright
a=last

f1=a.SelectEven().MCTemporalDenoise(settings="medium",strength=200).LSFMod(strength=60)
f2=a.SelectOdd().MCTemporalDenoise(settings="medium",strength=200).LSFMod(strength=60)
Interleave(f1,f2)
Weave()
SmoothLevels(18,1.1,235,0,255,chroma=100)



#thr is strength, rad is "how big are the (whatevers)" offset is "how far apart are they" rad goes from 1 to 5, offset from 1 to 4, thr from 1 to bignumber
function DeStripe(Clip C, int "rad", int "offset", int "thr")
{

rad = Default(rad, 2)
offset = Default(offset, 0)
thr_ = Default(thr, 256)


Blurred = Rad == 1 ? C.Mt_Convolution(Horizontal=" 1 1 1 ", vertical = " 1 ", u=1, v=1) : C
Blurred = Rad == 2 ? offset == 0 ? C.Mt_Convolution(Horizontal=" 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 1 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
Blurred = Rad == 3 ? offset == 0 ? C.Mt_Convolution(Horizontal=" 1 1 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) : offset == 1 ? C.Mt_Convolution(Horizontal=" 1 1 0 1 0 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 0 1 0 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
Blurred = Rad == 4 ? offset == 0 ? C.Mt_Convolution(Horizontal=" 1 1 1 1 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) : offset == 1 ? C.Mt_Convolution(Horizontal=" 1 1 1 0 1 0 1 1 1 ", vertical = " 1 ", u=1, v=1) : offset == 2 ? C.Mt_Convolution(Horizontal=" 1 1 0 0 1 0 0 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 0 0 1 0 0 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
Blurred = Rad == 5 ? offset == 0 ? C.Mt_Convolution(Horizontal=" 1 1 1 1 1 1 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) : offset == 1 ? C.Mt_Convolution(Horizontal=" 1 1 1 1 0 1 0 1 1 1 1 ", vertical = " 1 ", u=1, v=1) : offset == 2 ? C.Mt_Convolution(Horizontal=" 1 1 1 0 0 1 0 0 1 1 1 ", vertical = " 1 ", u=1, v=1) : offset == 3 ? C.Mt_Convolution(Horizontal=" 1 1 0 0 0 1 0 0 0 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 0 0 0 1 0 0 0 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
Diff = Mt_Makediff(C, Blurred)

THR=string(thr_)
MedianDiff = Rad == 1 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : Diff
MedianDiff = Rad == 2 ? offset == 0 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
MedianDiff = Rad == 3 ? offset == 0 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 3 0 -3 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 1 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 3 0 -3 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 3 0 -3 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
MedianDiff = Rad == 4 ? offset == 0 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 1 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 2 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 3 0 -3 0 4 0 -4 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 4 0 -4 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
MedianDiff = Rad == 5 ? offset == 0 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 5 0 -5 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 1 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 5 0 -5 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 2 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 3 0 -3 0 4 0 -4 0 5 0 -5 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 3 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 4 0 -4 0 5 0 -5 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 5 0 -5 0 " , expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
ReconstructedMedian = mt_makediff(Diff, MedianDiff)
Mt_AddDiff(Blurred, ReconstructedMedian)

Return(Mergechroma(Last, C, 1))
}

StainlessS
10th October 2010, 05:17
Hi MattW,

Find below a rough & ready plugin, it lightens up the dark lines and darkens down the
light lines, far from brilliant and a bit basic but does improve a little. Perhaps it might
prove useful before using the DeStripe script. Anyway, cant do any harm to take
a gander. I only spend about an hour or two on it, so it is not anything special.

Name Test.dll

Test(range=6,lighten=true,darken=true)
#range 1 and above

Anyway, it does remove some of the lining without blurring but does not
seem to touch it in other places.

get here:
EDIT:- Link Removed.

Let me know when/if you download, I dont want to leave it for general consumption.

EDIT: Dont expect anything anywhere near as good as the DeStripe script.

MattW
10th October 2010, 05:58
Let me know when/if you download, I dont want to leave it for general consumption.

I have downloaded the plug-in and will test it tomorrow morning. Thanks!

The Scientist
10th October 2010, 15:13
@poisondeathray
Wow, screenshot differences are very impressive.

StainlessS
10th October 2010, 19:17
MattW,

Was in a hurry to get some shuteye last night, was still working on it about 5:00am.
Looking at it today, maybe not terribly good, does reduce lining in some places but
introduces some lining were there was none originally. I shall have a little more
play with this, am reluctant to just give up on it.
If I get anything better, Ill let you know.

Usedocne
10th October 2010, 20:19
@poisondeathray

David Copperfield just called, said something about a magic wand going missing?

Floatingshed
11th October 2010, 14:20
Isn't this simply a single field kinescope? If so it is not an interference pattern of any kind it is the 240 lines that make up the original picture. It is most certainly not Moire.

2Bdecided
11th October 2010, 14:48
Isn't this simply a single field kinescope? If so it is not an interference pattern of any kind it is the 240 lines that make up the original picture. It is most certainly not Moire.I think it is a single field kinescope (we call them drop-field telerecordings over here!) - but if you look at it (especially the video) I think the result does have what I'd call moire - i.e. the 240-lines on film "beat" with the 480-lines on the DVD in a way which creates some artefacts at a new frequency. Those bands aren't 240-lines - more like 1/4 that. MPEG encoding doesn't help either.

poisondeathray's result does look like magic - Corel Photopaint's Remove Moire filter does something similar (if you downscale vertically 4x first!). Sadly not much detail left!

Cheers,
David.

*.mp4 guy
19th October 2010, 06:51
I really can't do much better then what poisondeathray already achieved, if any better at all. poisondeathray already put to good use the best solution I can currently think of for this class of problems. It is possible to get more complete removal with fewer obvious artifacts, but blurring goes way up, which I doubt is acceptable. Usually I wouldn't contribute to a thread with such an unhelpful reply, but I was asked and I don't want to leave the impression that there is any better solution that I am aware of.

If anyone is wondering why the results here are not directly comparable to the other thread; it is because the artifacts are far far larger, and of much greater magnitude. To such an extent that I am surprised some of the tricks used in the DeStripe function continue to work at all.

pandy
19th October 2010, 10:52
defreq () or any similar tool that works in frequency not spatial domain.