Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 20th December 2005, 15:36   #1  |  Link
actionman133
Movie buff & shine
 
Join Date: Jan 2004
Location: Logan, the only hole above ground.
Posts: 257
A new attempt at good deblending

Hi,

Of course no one would remember that a long time ago, I attempted to create a deblend function for correcting films that underwent telecine and then had the fields blurred together.

I wasn't very successful then, but just tonight I'm trying a slightly different approach but I am stuck on how to use FrameEvaluate... the help guide might as well be inverted chinese algebra, because it makes me go crosseyed (rest of the guide is good, though).

Here is the test script to set up the detection process.

Code:
Function DeBlend (clip Last) {

a = Subtract (Last, Trim (1, 0).Levels (0, 1, 255, 128, 255, False)).Levels (0, 1, 127, 0, 255, False).Trim (1, 0)
b = Subtract (Levels (0, 1, 255, 0, 127, False), Trim (1, 0)).Levels (0, 1, 127, 255, 0, False).DuplicateFrame (0)

StackVertical (Last, a, b)

}
The result of this test is the original clip displayed on top, with two deblended frames beneath them. Those two deblended frames should be identical when the first blended frame in the pattern appears in the original clip.

That's worked fine for me so far. Where FrameEvaluate () comes in and messes me up is how to have the function work out whether to deblend or not. Here is the script I more or less came up with (I know the syntax is WAAAY out)...

Code:
Function DeBlend (clip Last) {

# Perform Deblends for the comparison test
a = Subtract (Last, Trim (1, 0).Levels (0, 1, 255, 128, 255, False)).Levels (0, 1, 127, 0, 255, False).Trim (1, 0)
b = Subtract (Levels (0, 1, 255, 0, 127, False), Trim (1, 0)).Levels (0, 1, 127, 255, 0, False).DuplicateFrame (0)

# Get difference between two tests
Global Test = Subtract (a, b)

# Get difference for each pair of frames in a 5 frame set
ab = FrameEvaluate ("YPlaneMinMaxDifference (Test.SelectEvery (5, 0))")
bc = FrameEvaluate ("YPlaneMinMaxDifference (Test.SelectEvery (5, 1))")
cd = FrameEvaluate ("YPlaneMinMaxDifference (Test.SelectEvery (5, 2))")
de = FrameEvaluate ("YPlaneMinMaxDifference (Test.SelectEvery (5, 3))")
ea = FrameEvaluate ("YPlaneMinMaxDifference (Test.SelectEvery (5, 4))")

# Find the frame which had the lowest difference in the two tests
Dupe = (ab > bc) ? "bc" : "ab"
Dupe = (Eval (Dupe) > cd) ? "cd" : Dupe
Dupe = (Eval (Dupe) > de) ? "de" : Dupe
Dupe = (Eval (Dupe) > ea) ? "ea" : Dupe

# Use SelectEvery to delete Dupe... not yet implemented

}
The FrameEvaluate () section is supposed to calculate the difference between the two deblend tests (a & b). The Dupe variable tests to find out which of these frames produced the smallest difference in those tests. The SelectEvery () piece will then remove the blended frames and replace them with a single deblended frame.

Now, for those who made it this far.... ... how do I properly implement FrameEvaluate () to retrieve the comparitive differences between a and b?

Thanks.
__________________
I'm a boxer who can Bob () & Weave (). I like to Overlay () punches and Blur () his vision to ShowFiveVersions (). My KO punch will always Pulldown ().TimeStretch () and all he will hear is Tone ().
actionman133 is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.