Log in

View Full Version : split screen to compare filters


steptoe
28th March 2008, 18:21
I know this has been convered before, but I can't find a simple script to basically compare the original source with the filtered output in one screen

Basically I'm looking to have the unfiltered video on the left, and the filtered video on the right, in the same screen so I can directly compare what filters actually achieve without having to try and run two instances of a video player and manually sync the video to see what the differences are


Thanks

2Bdecided
28th March 2008, 18:28
http://avisynth.org/mediawiki/StackVertical

Soulhunter
28th March 2008, 18:39
http://mf.creations.nl/avs/functions/soulhunter/SSC.avs

steptoe
28th March 2008, 21:08
Cheers, I'd prefer to use the function if possible but my next question, I use DVD-RB. So ho wdo I do that in DVD-RB

I have managed to get a couple of denoise functions and filters to work via DVD-RB, but thats purely one source


Now I need to work out how to get that split function to work with my noise removal function or filters

Soulhunter
28th March 2008, 22:40
Usage example:

Original = AviSource("C:\Path\to\Source.avi")
Filtered = Original.FFT3DFilter(Sigma=1)
SSC(Original,Filtered)

Sorta self explaining imo... The "Original" points to the unprocessed source, the "Filtered" takes what you specified as "Original" [so the unprocessed source] and adds filtering [FFT3DFilter in this example]. Then you call the SSC function with "Original" and "Filtered" as params... This will display one half of the image unprocessed [original] and the other half filtered [FFT3DFilter]. You can replace the naming, the source and the filtering as you like... Questions left? :]


Bye

Blue_MiSfit
28th March 2008, 23:10
I tend to like Interleave(a,b). It lets you compare the whole frame, and switch back and forth quickly in VirtualDub.

Admitely, it doesn't give you a good sense of motion. For areas where that's important, I like to use StackVertical, but a split screen would be nice.

A good adjustable on the fly split screen system in avsP would be very nice ;)

~MiSfit

Comatose
28th March 2008, 23:50
I don't really like things like SSC since you don't see the same frame twice, but two halves of it. It makes comparing small detail much harder.

I like this:
<source filter>
orig=bilinearresize(width/4,height/4)
filtered=bilinearresize(width/4,height/4).filter
stackhorizontal(orig.subtitle("Original"),filtered.subtitle("Filtered"))

This is good for watching both simultaneously, when doing things like Levels conversions (to find lost detail and change the contrast/brightness to regain it).

For comparing very small detail changes, Blue_MiSfit's Interleave idea would be much better.
I didn't think of using Interleave for this before now... I used to just save screens with AvsP and switch between them. :x

TheRyuu
29th March 2008, 02:50
I know this isn't a "split screen" solution, but I really like using avsp and having two tabs open and just using my mouse wheel to just go between the tabs to see the difference.

I like zooming in a bit sometimes too since my eyes aren't always the best :p

Blue_MiSfit
29th March 2008, 04:12
Yeah I typically do SD material at 200% zoom in VirtualDub with nearest neighbor scaling. It gives an accurate representation of how pixels are actually changing.

Interleave is nice for frame by frame comparison - which is really useful for stuff like detecting IVTC combing artifacts, or generally evaluating the performance of a denoiser / sharpener - but to really get a sense of these things, as well as more motion specific things like frame rate conversions or temporal filters (especially those involving motion compensation) it's very useful to split screen (or loop two clips)

~MiSfit

Malcolm
29th March 2008, 13:12
I wrote myself a function that makes it easy to compare clips. Save it as .avsi and simply add diff2clips(orig, last) to your script.


function diff2clips(clip "clipA", clip "clipB", int "diffRate", bool "bw", bool "showDiff", bool "stackHalfs", int "left", int "top", int "width", int "height")
{
diffRate = default(diffRate , 16)
bw = default(bw , false)
showDiff = default(showDiff , true)
stackHalfs = default(stackHalfs, false)
left = default(left , 0)
top = default(top , 0)
width = default(width , 560) #432
height = default(height , clipA.height)

width = min(clipA.width - left, width)
width = min(clipB.width - left, width)

height = min(clipA.height - top, height)
height = min(clipB.height - top, height)

clipA = clipA.crop(left, top, width, height)
clipB = clipB.crop(left, top, width, height)

clipA = (stackHalfs) ? clipA.crop(0, 0, width/2, -0) : clipA
clipB = (stackHalfs) ? clipB.crop(width/2, 0, width/2, -0) : clipB

diff = subtract(clipA, clipB).levels(127-diffRate,1,128+diffRate,0,255)
diff = (bw) ? MergeChroma(diff, Blackness(diff)) : diff
(showDiff) ? stackhorizontal(clipB, diff) : clipB

stackhorizontal(clipA, last)
}

halsboss
29th March 2008, 13:47
yet another for you - brute force functions - call like
dcwbox2(LAST,"LAST",originalClip,"original")
or
dcwbox4(LAST,"LAST",originalClip,"original")
or
dcwbox8(LAST,"LAST",originalClip,"original")



#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Function dcwBox2(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/2,0*hClip/2,-1*wClip/2,-1*hClip/2).subtitle(aSub,size=20), \
b.crop(1*wClip/2,0*hClip/2,-0*wClip/2,-1*hClip/2).subtitle(bSub,size=20)), \
stackhorizontal(b.crop(0*wClip/2,1*hClip/2,-1*wClip/2,-0*hClip/2).subtitle(bSub,size=20), \
a.crop(1*wClip/2,1*hClip/2,-0*wClip/2,-0*hClip/2).subtitle(aSub,size=20)))
}
Function dcwBox4(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/4,0*hClip/4,-3*wClip/4,-3*hClip/4).subtitle(aSub,size=15), \
b.crop(1*wClip/4,0*hClip/4,-2*wClip/4,-3*hClip/4).subtitle(bSub,size=15), \
a.crop(2*wClip/4,0*hClip/4,-1*wClip/4,-3*hClip/4).subtitle(aSub,size=15), \
b.crop(3*wClip/4,0*hClip/4,-0*wClip/4,-3*hClip/4).subtitle(bSub,size=15)), \
stackhorizontal(b.crop(0*wClip/4,1*hClip/4,-3*wClip/4,-2*hClip/4).subtitle(bSub,size=15), \
a.crop(1*wClip/4,1*hClip/4,-2*wClip/4,-2*hClip/4).subtitle(aSub,size=15), \
b.crop(2*wClip/4,1*hClip/4,-1*wClip/4,-2*hClip/4).subtitle(bSub,size=15), \
a.crop(3*wClip/4,1*hClip/4,-0*wClip/4,-2*hClip/4).subtitle(aSub,size=15)), \
stackhorizontal(a.crop(0*wClip/4,2*hClip/4,-3*wClip/4,-1*hClip/4).subtitle(aSub,size=15), \
b.crop(1*wClip/4,2*hClip/4,-2*wClip/4,-1*hClip/4).subtitle(bSub,size=15), \
a.crop(2*wClip/4,2*hClip/4,-1*wClip/4,-1*hClip/4).subtitle(aSub,size=15), \
b.crop(3*wClip/4,2*hClip/4,-0*wClip/4,-1*hClip/4).subtitle(bSub,size=15)), \
stackhorizontal(b.crop(0*wClip/4,3*hClip/4,-3*wClip/4,-0*hClip/4).subtitle(bSub,size=15), \
a.crop(1*wClip/4,3*hClip/4,-2*wClip/4,-0*hClip/4).subtitle(aSub,size=15), \
b.crop(2*wClip/4,3*hClip/4,-1*wClip/4,-0*hClip/4).subtitle(bSub,size=15), \
a.crop(3*wClip/4,3*hClip/4,-0*wClip/4,-0*hClip/4).subtitle(aSub,size=15)))
}
Function dcwBox8(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/8,0*hClip/8,-7*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,0*hClip/8,-6*wClip/8,-7*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,0*hClip/8,-5*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,0*hClip/8,-4*wClip/8,-7*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,0*hClip/8,-3*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,0*hClip/8,-2*wClip/8,-7*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,0*hClip/8,-1*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,0*hClip/8,-0*wClip/8,-7*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,1*hClip/8,-7*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,1*hClip/8,-6*wClip/8,-6*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,1*hClip/8,-5*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,1*hClip/8,-4*wClip/8,-6*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,1*hClip/8,-3*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,1*hClip/8,-2*wClip/8,-6*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,1*hClip/8,-1*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,1*hClip/8,-0*wClip/8,-6*hClip/8).subtitle(aSub,size=10)), \
stackhorizontal(a.crop(0*wClip/8,2*hClip/8,-7*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,2*hClip/8,-6*wClip/8,-5*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,2*hClip/8,-5*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,2*hClip/8,-4*wClip/8,-5*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,2*hClip/8,-3*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,2*hClip/8,-2*wClip/8,-5*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,2*hClip/8,-1*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,2*hClip/8,-0*wClip/8,-5*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,3*hClip/8,-7*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,3*hClip/8,-6*wClip/8,-4*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,3*hClip/8,-5*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,3*hClip/8,-4*wClip/8,-4*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,3*hClip/8,-3*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,3*hClip/8,-2*wClip/8,-4*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,3*hClip/8,-1*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,3*hClip/8,-0*wClip/8,-4*hClip/8).subtitle(aSub,size=10)), \
stackhorizontal(a.crop(0*wClip/8,4*hClip/8,-7*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,4*hClip/8,-6*wClip/8,-3*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,4*hClip/8,-5*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,4*hClip/8,-4*wClip/8,-3*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,4*hClip/8,-3*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,4*hClip/8,-2*wClip/8,-3*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,4*hClip/8,-1*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,4*hClip/8,-0*wClip/8,-3*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,5*hClip/8,-7*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,5*hClip/8,-6*wClip/8,-2*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,5*hClip/8,-5*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,5*hClip/8,-4*wClip/8,-2*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,5*hClip/8,-3*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,5*hClip/8,-2*wClip/8,-2*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,5*hClip/8,-1*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,5*hClip/8,-0*wClip/8,-2*hClip/8).subtitle(aSub,size=10)), \
stackhorizontal(a.crop(0*wClip/8,6*hClip/8,-7*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,6*hClip/8,-6*wClip/8,-1*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,6*hClip/8,-5*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,6*hClip/8,-4*wClip/8,-1*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,6*hClip/8,-3*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,6*hClip/8,-2*wClip/8,-1*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,6*hClip/8,-1*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,6*hClip/8,-0*wClip/8,-1*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,7*hClip/8,-7*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,7*hClip/8,-6*wClip/8,-0*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,7*hClip/8,-5*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,7*hClip/8,-4*wClip/8,-0*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,7*hClip/8,-3*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,7*hClip/8,-2*wClip/8,-0*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,7*hClip/8,-1*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,7*hClip/8,-0*wClip/8,-0*hClip/8).subtitle(aSub,size=10)))
}