View Single Post
Old 25th April 2012, 09:49   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Here is the Basic Test Code with XP setting turned OFF and Thresh=Default 0.0 (Best possible match)

Code:
Test=Avisource("D:\avs\avi\TESTVID.avi").ConvertToYV12()     # For LumaDifference

MCOUNT=600                      # Size of sample taken from full Test clip.
MSTART=1000                     # Start position in Full Test clip of Sample.
MSTOP =MSTART+MCOUNT            # Stop position in full test clip.
Test.Trim(MSTART,-MCOUNT)       # Last = 600 Frames from MSTART to MSTART+MSTOP-1

# Manufacture 5 frame FindClip, NOTE middle frame exact, others blurred to some degree.
Q=trim(100,-1).Blur(0.1) + trim(200,-1).Blur(1.58).Blur(1.58)  + Trim(300,-1) + trim(400,-1).Blur(0.3) + Trim(500,-1).Blur(1.0)

MatchFrames(Test,Q,start=MSTART,stop=MSTOP,XP=false)
And the Log File:

Code:
##########################################################################
#
# MatchFrames v1.04 - 25 Apr 2012 (c) StainlessS : LogFile.
#
# Thresh=0.000 : Thresh2=0.000 : XP=false : Start=1000 : Stop=1600
#
##########################################################################

0]=[1100] Diff=0.239 (BM:  ) S=1000 E =1599
1]=[1200] Diff=1.261 (BM:  ) S=1000 E =1599
2]=[1300] Diff=0.000 (T1:  ) S=1000 E =1300
3]=[1400] Diff=0.083 (BM:  ) S=1000 E =1599
4]=[1500] Diff=0.098 (BM:  ) S=1000 E =1599

##########################################################################

Total Frames Scanned = 2701
Note that it scanned all the way to the end except where the exact match was found.

Code:
MatchFrames(Test,Q,Thresh=0.5,Start=MSTART,Stop=MEND,XP=false)

##########################################################################
#
# Thresh=0.500 : Thresh2=0.000 : XP=false : Start=1000 : Stop=1600
#
##########################################################################

0]=[1100] Diff=0.239 (T1:  ) S=1000 E =1100
1]=[1200] Diff=1.261 (BM:  ) S=1000 E =1599
2]=[1300] Diff=0.000 (T1:  ) S=1000 E =1300
3]=[1400] Diff=0.083 (T1:  ) S=1000 E =1400
4]=[1500] Diff=0.098 (T1:  ) S=1000 E =1500

##########################################################################

Total Frames Scanned = 1904
A Thresh 0f 0.5 identified all but one frame which was scanned to the end.

Code:
MatchFrames(Test,Q,Thresh=0.5,Thresh2=0.6,Start=MSTART,Stop=MSTOP,XP=false)

##########################################################################
#
# Thresh=0.500 : Thresh2=0.600 : XP=false : Start=1000 : Stop=1600
#
##########################################################################

0]=[1100] Diff=0.239 (T1:  ) S=1000 E =1100
1]=[1200] Diff=1.261 (BM:  ) S=1101 E =1596
2]=[1300] Diff=0.000 (T1:  ) S=1101 E =1300
3]=[1400] Diff=0.083 (T1:  ) S=1301 E =1400
4]=[1500] Diff=0.098 (T1:  ) S=1401 E =1500

##########################################################################

Total Frames Scanned = 997
Ordered scans fewer frames.

Code:
MatchFrames(Test,Q,Thresh=1.5,Thresh2=1.6,Start=MSTART,Stop=MSTOP,XP=true)

##########################################################################
#
# Thresh=1.500 : Thresh2=1.600 : XP=true : Start=1000 : Stop=1600
#
##########################################################################

0]=[1100] Diff=0.239 (T1:XP) S=1000 E =1101 XPCNT=5
1]=[1200] Diff=1.261 (T1:  ) S=1101 E =1201
2]=[1300] Diff=0.000 (T1:  ) S=1201 E =1300
3]=[1400] Diff=0.083 (T1:XP) S=1301 E =1401 XPCNT=1
4]=[1500] Diff=0.098 (T1:XP) S=1401 E =1501 XPCNT=1

##########################################################################

Total Frames Scanned = 505
Using Ordered and XP, fewest scans of all and ALL frames correctly identified.
This test was a little contrived (1st guess) to force the Xtra Paranoia setting to work but
shows that even with a quite high threshold setting, the correct frames were
identified and number of frames scanned is reduced fairly significantly.
The XPCNT=5 line shows that the first find frame was incorrectly identified by
the Thresh setting, but the XtraParanoia setting scanned 5 further frames,
all of which were identified as giving a better match, and the eventually returned
frame was correct. Also NOTE, just before XPCNT=5, you see that the E (end frame)
scanned is one past the returned frame, ie it failed to give a better match.
__________________
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 ???

Last edited by StainlessS; 25th May 2012 at 23:23.
StainlessS is offline   Reply With Quote