Log in

View Full Version : What is this artifacting called, and can anything be done about it?


kurish
31st May 2010, 06:37
Greetings all,

Delurking after 6+ years as there's finally an issue I can't remedy by searching alone. I'd be grateful for any assistance that anyone cares to offer.

I'm cleaning up some DVDs from a 1960s Eastern European TV show. A few episodes have a terrible "corduroy" look to them, as you can see below:

http://img683.imageshack.us/img683/4993/71855910.jpg

http://img693.imageshack.us/img693/8684/92226274.jpg

What the heck is that, and is there anything that can be done about it? Even some search terms would be helpful.

I've thrown a few denoisers at it (TemporalDegrain, Neat Video), since they were already part of my workflow. They helped a little but clearly aren't meant for this kind of thing. I've also considered an interference frequency filter (DeFreq or FanFilter) but my preliminary tests weren't fruitful.

If it makes any difference, I believe this was originally shot on (24fps) film and then somehow frameblended to (25fps) SECAM (or a PAL master). From there, it seems, some musty old master tape was used to create the PAL DVDs. (That's my guess, anyway, after spending hours and hours on various other artifacts.)

Finally, if anyone's really interested, a 2-second VOB extract is available here: http://www.megaupload.com/?d=B5O5UK3B (1.5MB)

Thanks!

Lyris
31st May 2010, 14:45
I think this is analog video noise which has been "thickened" by low-pass filtering and sharpening. The noise is probably the result of an old telecine, build-up from copying to analog tape formats... it may even be fine film grain that has again somehow taken on this "thick" look - or a combination of all of the above.

When I was faced with this problem, NeatVideo (as you say) couldn't do much for it. In the end, I found this script useful (it's slow, but worth it):



source = last
pred = source # to get stronger denoising, put denoisers here, they will change how motion vectors are predicted

backward_vec2 = pred.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)
backward_vec1 = pred.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)
forward_vec1 = pred.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)
forward_vec2 = pred.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)

maskp1 = mvmask(kind=1, vectors=forward_vec1, ysc=255).UtoY()
maskp2 = mvmask(kind=1, vectors=forward_vec2).UtoY()
maskp3 = mvmask(kind=1, vectors=backward_vec1, ysc=255).UtoY()
maskp4 = mvmask(kind=1, vectors=backward_vec2).UtoY()
maskf = average(maskp1, 0.25, maskp2, 0.25, maskp3, 0.25, maskp4, 0.25).spline36resize(source.width, source.height)

smooth = pred.fft3dfilter(bw=16, bh=16, ow=8, oh=8, bt=1, sigma=4, plane=0)
source2 = maskedmerge(source, smooth, maskf)

source3 = source2.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=2)
source3
ttempsmooth(maxr=7)
gradfun2db(1.51)

rfmmars
31st May 2010, 16:37
http://img189.imageshack.us/img189/1513/eastgerman0000.jpg (http://img189.imageshack.us/i/eastgerman0000.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

Simple one line of code,
You may want to add SeeSaw or LSF

AffineCurvatureFlow(2)

Richad
photorecall.net

Guest
31st May 2010, 16:39
How does it look on the harder first screenshot?

rfmmars
31st May 2010, 16:58
How does it look on the harder first screenshot?

http://img168.imageshack.us/img168/7425/eastgerman20000.jpg (http://img168.imageshack.us/i/eastgerman20000.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

Richard
photorecall.net

Didée
31st May 2010, 17:25
Hmmh, well ... it does dimish the artifacts. But when I do a zoom-in, it seems that it's removing more of the detail then of the artifacts. (I don't need to show that, zooming can everybody do himself.)

Short of using {a certain proprietary processing tool} ... is someone used to setting-up and using FFT3DFilter's noise pattern mode? This seems like a typical application case for that.

poisondeathray
31st May 2010, 22:05
apologies for the "proprietary tool"

After Effects, box blur, 1.5 strength, 1 iteration, horizontal only

It's a little blurry, but at least it gets rid of most of the vertical lines.

No denoising or sharpening applied (which you might want to do after)

http://i46.tinypic.com/24fzm2u.png

I looked for the equivalent function in vdub which has a box blur, but it doesn't have vertical/horizontal control, and it seems to "overdo" it (doesn't have finer gradations).

neuron2 also has the equivalent avisynth plugin from vdub, but I didn't test it. Maybe it has finer control? Or maybe one of the gurus can modify it?
http://neuron2.net/boxblur/boxblur.html

kurish
1st June 2010, 02:21
And thanks also, neuron2, for taking an interest.

Lyris: That script actually does very little to the corduroy artifact in this material. I even tried throwing in a turnright() and turnleft() at the beginning and end, respectively, in hopes that gradfun2db would respond better to horizontal lines. Doing so yielded only the tiniest improvement, however. Here's a screenshot (with even an additional denoiser added to line two [pred = source.mc_spuds(mode="very high")] because I'm a masochist):

http://img412.imageshack.us/img412/7508/lyris.jpg

rfmmars: Interesting function--thanks for making me aware of it. ("New smoothing plugin: Curvature Flow Approximation (http://forum.doom9.org/showthread.php?t=123094)" by AMSS0815, if anyone's interested.) I tried numerous settings in addition to your suggestion. Ultimately, though, I wasn't happy with its ability to only partially alleviate the corduroy, particularly at the price of significant detail loss.

Didée: Unfortunately, my experiments with FFT3DFilter's noise pattern mode were not promising. Here are the results, using fft3dfilter(pframe=44787,pfactor=1,px=26,py=16,wintype=2) [44787 is both the frame from which the noise pattern is derived and the frame in the screenshot; the black box in the screenshot shows the location + size of the noise pattern source):

http://img171.imageshack.us/img171/121/didee.jpg

poisondeathray: Looks promising--I almost forgot about After Effects! I'll try it out tonight...

tritical
1st June 2010, 03:21
kurish, can you post another video sample (maybe from around frame 44787 as shown in your last post)? In the one in your first post it is hard to tell what should be flat background (can't tell if the walls should be or if they are textured). :thanks:

kurish
1st June 2010, 03:48
Gladly!

3 second clip: http://www.megaupload.com/?d=MTV5OA3V

The frame that's being screenshotted so much here is #41 in that file.

FYI, the DVDs (and vob clips) have a (superfluous) chroma component. I'm nuking it with greyscale().

Thanks!

Didée
1st June 2010, 07:24
Big Blur Sledgehammer contest?

Using a simple Gauss/Median combination (MinBlur function) ...

http://img257.imageshack.us/img257/8788/excel1mb2a.th.png (http://img257.imageshack.us/i/excel1mb2a.png/) http://img691.imageshack.us/img691/4417/excel2mb2a.th.png (http://img691.imageshack.us/i/excel2mb2a.png/)


Using MinBlur plus Median ContraSharp

http://img535.imageshack.us/img535/179/excel1mb2b.th.png (http://img535.imageshack.us/i/excel1mb2b.png/) http://img690.imageshack.us/img690/2574/excel2mb2b.th.png (http://img690.imageshack.us/i/excel2mb2b.png/)

Terka
1st June 2010, 08:55
what about:
http://avisynth.org.ru/defreq/defreq.html
or
http://avisynth.org/vcmohan/FanFilter/FanFilter.html

tritical
1st June 2010, 18:03
dfttest results on the second clip using nfile to estimate noise spectrum with various over subtraction factors (3.0,5.0,7.0):

hotel_dfttest_3.0.avi (http://bengal.missouri.edu/~kes25c/hotel_dfttest_3.0.avi)
hotel_dfttest_5.0.avi (http://bengal.missouri.edu/~kes25c/hotel_dfttest_5.0.avi)
hotel_dfttest_7.0.avi (http://bengal.missouri.edu/~kes25c/hotel_dfttest_7.0.avi)

I used sbsize=20/sosize=16, but window size didn't make any real difference (also tried 16,24). Everything else was defaults. Would probably want to sharpen it afterward, but I didn't try any further processing (just wanted to see how dfttest's noise spectrum estimation worked in this case).

nfile was:

a=x.x
35,0,314,414
42,0,314,414
62,0,314,414
54,0,88,488
70,0,88,488
30,0,20,666
48,0,20,666
58,0,390,410
32,0,76,446

Ghitulescu
1st June 2010, 18:17
What do you intend to do with the movies?
Watching them on a PC or on a TV?

Because the processed images that were uploaded are OK for a PC (which is sharp by default) but "flat" on a CRT TV (which is a bit blurry by default). For a CRT TV I would reduce the noise a bit less. For an LCD HDready/FullHD TV I would soften more (more agressive), as they tend to emphase the edges, thus the noise.

The noise I think is the film noise which film was TCed on tape (which added some noise of its own), then "flattened" by the MPEG-2 algorithm (see the second image).

*.mp4 guy
1st June 2010, 21:00
Big Blur Sledgehammer contest?

Here's my entry.


FIR = Mt_Convolution(Horizontal=" 48 64 96 64 48 ", vertical ="1", u=-128, v=-128)
Diff = Mt_Makediff(Last, FIR)

THR=string("121")
MedianDiff = MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 2 0 -1 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)
ReconstructedMedian = mt_makediff(Diff, MedianDiff)
Mt_AddDiff(FIR, ReconstructedMedian)

Imo, its probably the most selective method posted so far. No examples though, internet is acting up.

kurish
1st June 2010, 23:24
tritical: Damn!! Love it. Thank you. [Edit: Removing a sentence here--I read the dfttest doc and figured it out. :) ]

Screenshots from your avis, for the record:

http://img526.imageshack.us/img526/4688/tritical1.th.jpg (http://img526.imageshack.us/img526/4688/tritical1.jpg) http://img31.imageshack.us/img31/7345/tritical2.th.jpg (http://img31.imageshack.us/img31/7345/tritical2.jpg) http://img9.imageshack.us/img9/8923/tritical3.th.jpg (http://img9.imageshack.us/img9/8923/tritical3.jpg)

*.mp4 guy: Awesome, as well! Thank you, too. I have some experimenting to do between your approach and tritical's--It's great to have options. Screenshots follow--first set is nothing but your script, second set appends the following:

source = last
denoised = source.minblur(2).fluxsmootht()
temporaldegrain_chromamod(source, denoised, degrain=3, chroma=false)

(lifted from Didée here (http://forum.doom9.org/showthread.php?t=136433#post1121680), thanks also to thetoof two posts down)

*.mp4 guy code: http://img375.imageshack.us/img375/715/mp4guyunaltered.th.jpg (http://img375.imageshack.us/img375/715/mp4guyunaltered.jpg) http://img20.imageshack.us/img20/4639/mp4guy2unaltered.th.jpg (http://img20.imageshack.us/img20/4639/mp4guy2unaltered.jpg) *.mp4 guy + temporaldegrain: http://img88.imageshack.us/img88/5862/mp4guydenoised.th.jpg (http://img88.imageshack.us/img88/5862/mp4guydenoised.jpg) http://img710.imageshack.us/img710/7213/mp4guy2denoised.th.jpg (http://img710.imageshack.us/img710/7213/mp4guy2denoised.jpg)

Ghitulescu: They'll be watched on an LCD HDTV. I appreciate your helpful input. I'll take it into consideration when creating the final encodes.

Didée
2nd June 2010, 01:21
@mp4guy: Very nice isolation of the target. Hat off, I like it.

kurish - MDegrain after mp4guy's cleaner script is what I would've tried, too. TemporalDegrain is same blood, just darker. Though, for my personal taste, you have it a little too strong - reducing to degrain=2 probably would make things look more natural. Surfaces' textures are rather weak in the source to start with, so I'd vote for leaving a little more in the whole thing.
But then, that's personal taste ... if you like it smooth, then make it smooth.

kurish
2nd June 2010, 03:06
I'll try it, Didée. Another set of eyes is helpful. http://s6.photobucket.com/albums/y208/mywristsbleedcourage/th_cheer.gif

*.mp4 guy
2nd June 2010, 03:30
@mp4guy: Very nice isolation of the target. Hat off, I like it.

Thanks.

However I wasn't quite satisfied. :devil: New version below should give essentially perfect separation.

FIR = Mt_Convolution(Horizontal=" 48 64 96 64 48 ", vertical ="1", u=-128, v=-128)
Diff = Mt_Makediff(Last, FIR)

THR=string("256")
MedianDiff = MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 2 0 -1 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).fft3dfilter(bw=2, bh=16, ow=1, oh=8, bt=1, sigma=16, sigma2=0.75, sigma3=16, sigma4=16, plane=4)
ReconstructedMedian = mt_makediff(Diff, MedianDiff)
Mt_AddDiff(FIR, ReconstructedMedian)

After looking at how badly standard denoisers worked, I decided to see if any of them would highly selectively do the "wrong thing". Eliminating details but keeping the pattern, it turns out that fft3d is very very good at this with the right settings, and by applying it to the mostly-isolated pattern, its possible to retain essentially all of the source detail, by removing it from the isolated pattern before subtracting the pattern from the source.

kurish
2nd June 2010, 23:38
New version below should give essentially perfect separation.

Gorgeous. Screens follow. I bumped the white point levels in Photoshop to make details easier to see (200 in first image, 225 in second):

http://img88.imageshack.us/img88/9818/mp4guynew1.th.jpg (http://img88.imageshack.us/img88/9818/mp4guynew1.jpg) http://img97.imageshack.us/img97/6765/mp4guynew2.th.jpg (http://img97.imageshack.us/img97/6765/mp4guynew2.jpg)


And with temporaldegrain per my previous post, although this time degrain=2:

http://img13.imageshack.us/img13/1844/mp4guynew1denoised.th.jpg (http://img13.imageshack.us/img13/1844/mp4guynew1denoised.jpg) http://img204.imageshack.us/img204/8166/mp4guynew2denoised.th.jpg (http://img204.imageshack.us/img204/8166/mp4guynew2denoised.jpg)

:thanks: Greatly appreciated.

Blue_MiSfit
3rd June 2010, 00:05
:o wow. Nice job guys :)

poisondeathray
3rd June 2010, 00:09
*.mp4 guy - very impressive. I can't remember a better example of targetting noise virtually perfectly

I would love to learn how you approached this and about the functions used, but they are beyond my level of knowledge of avisynth. I can read all the documentation until my face turns blue, but that doesn't tell me how to use it properly

*.mp4 guy
3rd June 2010, 03:28
I can read all the documentation until my face turns blue, but that doesn't tell me how to use it properly

The best advice I can give you is to use it improperly until you start to get an idea of what it does. Also when threads like this pop up, try to find a solution, working from what you already know, and what other people are doing.

I would love to learn how you approached this and about the functions used.

In this case I just applied two things I've already "figured out". A FIR filter to be a more optimal blur then gaussian or box, and a soft thresholded median taken from a previous script and modified to work on the correct pixels (as found working on the FIR filter). I went through a few brain dead iterations of how to design the FIR filter, but it was pretty easy. Then I pulled the MT_Luts soft-thresholded median from another script, modified it to target the pattern (just switching it to run on the same group of pixels as the FIR filter). The soft-median worked pretty well when directly applied to the source as did the FIR filter, but luckily (and predictably) they were good at different things. I went through a few square-peg-round-hole iterations of how to combine them (using them separately, then doing overly complicated stuff to combine the results) before I figured out I was being stupid and I should just run the median on the difference between the source and the FIR, allowing me to add most of the detail removed by the blur back after median filtering it.

Thinking about how badly denoisers worked on this source, I added fft3d to the mix, using it to remove detail from the noise pattern isolated by the median filter, before subtracting said pattern from the blur-difference clip. I set up fft3d with low block width (low ability to target the pattern) and normal block height, then I set it to be spatial only, and tried to find which sigmas would correspond to the pattern, in this case it was sigma2, then I found the maximum value of sigma2 that wouldn't touch the pattern, then I set all the other sigmas very high, to maximise detail removal from the pattern (detail recovery).

If that sounds complicated (IE, poorly explained), it wasn't (complicated) It was just a few random ideas of how to apply stuff I already knew well, and a bit of trial and error refinement until it worked.

Hopefully this was helpful (I doubt it) and doesn't make me look like a pompous idiot, but you did asked (unless you didn't). :p

Gavino
3rd June 2010, 09:02
Thanks for the explanation, *.mp4 guy.
I went through a few brain dead iterations of how to design the FIR filter, but it was pretty easy.
Can you expand a bit on that. How did you arrive at those numbers?

poisondeathray
3rd June 2010, 13:48
Can you expand a bit on that. How did you arrive at those numbers?

Exactly! I remember a couple of other threads where *.mp4 guy derived some coefficients out of thin air :) . I would like to know the process by which he got those

Anyways, thanks for trying to clarify, and nice job *.mp4 guy.

*.mp4 guy
4th June 2010, 02:09
Exactly! I remember a couple of other threads where *.mp4 guy derived some coefficients out of thin air :) . I would like to know the process by which he got those

1 - Guess
2 - Check
3 - Go to 1


3 4 6 4 3 Used filter (original was multiplied by 16 for easy modification)
1 4 6 4 1 gaussian
0 1 1 1 0 box radius 1
2 2 3 2 2 box radius 1.5
1 1 1 1 1 box radius 2

After a while it gets easier to think of what a filter will look like, which makes the process faster, but it really is just guessing and checking. Sometimes I will use a program to generate arbitrary lowpass filter coefficients, but that is mostly a convenience thing.

If you want to know how to make FIR filters, spend some time fiddling with mt_convolution until you start to understand what does what.

creamyhorror
5th June 2010, 09:33
And thus the age of mass targeted filter creation begins. (Ridiculous job, *.mp4 guy.)

Someone should write a GeneticConvolution program that generates FIR filters, gets the user to evaluate them for fitness, and iteratively improves them.

markanini
11th June 2010, 00:25
@mp4 guy: Any chance you can make your fix into a function? Seems killer for periodic/pattern noise!

Lorax2161
11th June 2010, 01:06
I'll second the request for a function, but I'll go out on a limb and say this was probably a specific fix for a specific problem, and thus isn't a good candidate for a function. Hope I'm wrong.

Congrats to *.mp4 guy for a job well done.

(The "corduroy" forehead in post #1 reminds me of my cable reception, hence the vote for a function. :))

pandy
11th June 2010, 11:21
Seems that his one works quite ok for "Stakes Larger Than Life" ;)

DeFreq(show=0, fx=48.0, fy=0.0, dx=1, dy=0.75, sharp=50.0, cutx=50.0, cuty=75.0)

*.mp4 guy
14th June 2010, 01:49
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))
}


Don't ask me if it works, I didn't have much information to work with. 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. Also its generic and therefore not very good.

markanini
16th June 2010, 22:23
I tested your script on the image by the original poster. Seperation is'nt as strong as your custom coefficients but still better detail and seperation than the other "contest entries" in this thread.
I'm excited about this filter cause I've been looking for an avisynth filter for periodic noise like in scans of magazine prints and photos with honeycomb textures. I love how avisynth gurus on this board find clever solutions that work with well with compressed 8-bit sources where professional photo software ends up emphasizing the limits of the original.

A bug: Seems to cut off the image after 320 horizontal pixels.

EDIT: Cutting off was related to something else, please ignore my bug report.