@@ -614,10 +614,10 @@ PERF_TEST_P(Video_Cn_LearningRate, Video_MOG,
614614 }
615615 else
616616 {
617- cv::BackgroundSubtractorMOG mog;
617+ cv::Ptr<cv::BackgroundSubtractor> mog = cv::createBackgroundSubtractorMOG () ;
618618 cv::Mat foreground;
619619
620- mog (frame, foreground, learningRate);
620+ mog-> apply (frame, foreground, learningRate);
621621
622622 for (int i = 0 ; i < 10 ; ++i)
623623 {
@@ -635,7 +635,7 @@ PERF_TEST_P(Video_Cn_LearningRate, Video_MOG,
635635 }
636636
637637 startTimer (); next ();
638- mog (frame, foreground, learningRate);
638+ mog-> apply (frame, foreground, learningRate);
639639 stopTimer ();
640640 }
641641
@@ -709,12 +709,12 @@ PERF_TEST_P(Video_Cn, Video_MOG2,
709709 }
710710 else
711711 {
712- cv::BackgroundSubtractorMOG2 mog2;
713- mog2. set (" detectShadows" , false );
712+ cv::Ptr<cv::BackgroundSubtractor> mog2 = cv::createBackgroundSubtractorMOG2 () ;
713+ mog2-> set (" detectShadows" , false );
714714
715715 cv::Mat foreground;
716716
717- mog2 (frame, foreground);
717+ mog2-> apply (frame, foreground);
718718
719719 for (int i = 0 ; i < 10 ; ++i)
720720 {
@@ -732,7 +732,7 @@ PERF_TEST_P(Video_Cn, Video_MOG2,
732732 }
733733
734734 startTimer (); next ();
735- mog2 (frame, foreground);
735+ mog2-> apply (frame, foreground);
736736 stopTimer ();
737737 }
738738
@@ -789,7 +789,7 @@ PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
789789 }
790790 else
791791 {
792- cv::BackgroundSubtractorMOG2 mog2;
792+ cv::Ptr<cv::BackgroundSubtractor> mog2 = cv::createBackgroundSubtractorMOG2 () ;
793793 cv::Mat foreground;
794794
795795 for (int i = 0 ; i < 10 ; ++i)
@@ -807,12 +807,12 @@ PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
807807 cv::swap (temp, frame);
808808 }
809809
810- mog2 (frame, foreground);
810+ mog2-> apply (frame, foreground);
811811 }
812812
813813 cv::Mat background;
814814
815- TEST_CYCLE () mog2. getBackgroundImage (background);
815+ TEST_CYCLE () mog2-> getBackgroundImage (background);
816816
817817 CPU_SANITY_CHECK (background);
818818 }
@@ -958,11 +958,11 @@ PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG,
958958 cv::Mat foreground;
959959 cv::Mat zeros (frame.size (), CV_8UC1 , cv::Scalar::all (0 ));
960960
961- cv::BackgroundSubtractorGMG gmg;
962- gmg. set (" maxFeatures" , maxFeatures);
963- gmg.initialize (frame.size (), 0.0 , 255.0 );
961+ cv::Ptr<cv::BackgroundSubtractor> gmg = cv::createBackgroundSubtractorGMG () ;
962+ gmg-> set (" maxFeatures" , maxFeatures);
963+ // gmg.initialize(frame.size(), 0.0, 255.0);
964964
965- gmg (frame, foreground);
965+ gmg-> apply (frame, foreground);
966966
967967 for (int i = 0 ; i < 150 ; ++i)
968968 {
@@ -985,7 +985,7 @@ PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG,
985985 }
986986
987987 startTimer (); next ();
988- gmg (frame, foreground);
988+ gmg-> apply (frame, foreground);
989989 stopTimer ();
990990 }
991991
0 commit comments