int main(int argc, char *argv[]) { VSFrameInfo fi; VSMotionDetect md; VSMotionDetectConfig conf; (void)argc; (void)argv; conf.algo = 1; conf.modName = "vidstabtest"; conf.shakiness = 5; conf.accuracy = 15; conf.stepSize = 6; conf.contrastThreshold = 0.25; conf.show = 0; conf.virtualTripod = 0; vsFrameInfoInit(&fi, 320, 240, PF_YUV420P); if (vsMotionDetectInit(&md, &conf, &fi) != VS_OK) return 1; vsMotionDetectionCleanup(&md); return 0; }
void destroy_detect(StabData *data) { if (data) { vsMotionDetectionCleanup(&data->md); delete data; } }
void clear_deshake(DeshakeData *data) { if (data->initialized) { vsMotionDetectionCleanup(&data->md); vsTransformDataCleanup(&data->td); } }
void PipelineStabDetect::onLast() { if (initialized) { *verboseOutput << "closing " << stabConf->stabStateFile->fileName() << endl; fclose(f); f = NULL; vsMotionDetectionCleanup(&md); } emit last(); }
void test_checkCompareImg(const TestData* testdata){ VSMotionDetect md; VSMotionDetectConfig conf = vsMotionDetectGetDefaultConfig("test_checkCompareImg"); conf.shakiness=6; conf.accuracy=12; test_bool(vsMotionDetectInit(&md, &conf, &testdata->fi) == VS_OK); fflush(stdout); test_bool(checkCompareImg(&md,&testdata->frames[0])); vsMotionDetectionCleanup(&md); }
void destory_analyze_data( vs_analyze* analyze_data ) { if ( analyze_data ) { vsMotionDetectionCleanup( &analyze_data->md ); if( analyze_data->results ) { fclose( analyze_data->results ); analyze_data->results = NULL; } free( analyze_data ); } }