1 void test_motionDetect(TestData
* testdata
){
2 VSMotionDetectConfig mdconf
= vsMotionDetectGetDefaultConfig("test_motionDetect");
4 test_bool(vsMotionDetectInit(&md
, &mdconf
, &testdata
->fi
) == VS_OK
);
6 VSTransformConfig tdconf
= vsTransformGetDefaultConfig("test_motionDetect-trans");
9 test_bool(vsTransformDataInit(&td
, &tdconf
, &testdata
->fi
, &testdata
->fi
) == VS_OK
);
10 fprintf(stderr
,"MotionDetect:\n");
14 // for(t = 1; t <= 4; t++){
15 int start
= timeOfDayinMS();
16 // omp_set_dynamic( 0 );
17 // omp_set_num_threads( t );
19 for(i
=0; i
<numruns
; i
++){
20 LocalMotions localmotions
;
22 test_bool(vsMotionDetection(&md
, &localmotions
,&testdata
->frames
[i
])== VS_OK
);
23 /* for(k=0; k < vs_vector_size(&localmotions); k++){ */
24 /* localmotion_print(LMGet(&localmotions,k),stderr); */
26 t
= vsSimpleMotionsToTransform(td
.fiSrc
, td
.conf
.modName
, &localmotions
);
28 vs_vector_del(&localmotions
);
29 fprintf(stderr
,"%i: ",i
);
30 storeVSTransform(stderr
,&t
);
31 VSTransform orig
= mult_transform_(getTestFrameTransform(i
),-1.0);
32 VSTransform diff
= sub_transforms(&t
,&orig
);
33 int success
= fabs(diff
.x
)<2 && fabs(diff
.y
)<2 && fabs(diff
.alpha
)<0.005;
35 fprintf(stderr
,"Difference: ");
36 storeVSTransform(stderr
,&diff
);
40 int end
= timeOfDayinMS();
42 fprintf(stderr
,"\n*** elapsed time for %i runs: %i ms ****\n", numruns
, end
-start
);
44 vsMotionDetectionCleanup(&md
);