View Single Post
Old 28th October 2021, 19:23   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Dog,
this defo dont look right to me,
Code:
    #This function returns a white clip whenever a big jump is detected; otherwise a black clip is returned
    #Each YDiff must eliminate Ydiff=0 (duplicate) from moving average
    BWMask = ScriptClip("
            YDif1 = YDifferenceFromPrevious(src8,2)
            YDif1 = YDif1 < 0.2 ? YDifferenceFromPrevious(src8,3)  : YDif1

            YDif2 = YDifferenceFromPrevious(src8,1)
            YDif2 = YDif2 < 0.2 ? YDifferenceFromPrevious(src8,2)  : YDif2

            YDif3 = YDifferenceFromPrevious(src8,-1)
            YDif3 = YDif3 < 0.2 ? YDifferenceFromPrevious(src8,-2) : YDif3

            YDif4 = YDifferenceFromPrevious(src8,-2)
            YDif4 = YDif4 < 0.2 ? YDifferenceFromPrevious(src8,-3) : YDif4

            YDiff = ((YDif1 + YDif2 + YDif3 + YDif4) / 4.0 ) / (YDifferenceFromPrevious(src8,) + 0.01) <= JumpThresh ? \
                                                                                                        source.White : \
                                                                                                        source.Black   \
            ",args="src8,JumpThresh,Black,White")
I'm gonna steal some of that, but with some changes.
what is source.White and Source.Black, Source not visible inside scriptclip, and source.White dont make a lot of sense (to me).
What is assign to YDiff supposed to do, and why do you just return Last, ie src8 of input.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote