samples: gpu: performance: BackgroundSubtractorMOG is now part of opencv_bgsegm module
This commit is contained in:
parent
fbf28bcc63
commit
db391fdfdd
@ -7,6 +7,10 @@ if(HAVE_opencv_xfeatures2d)
|
|||||||
ocv_include_directories("${opencv_xfeatures2d_SOURCE_DIR}/include")
|
ocv_include_directories("${opencv_xfeatures2d_SOURCE_DIR}/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_opencv_bgsegm)
|
||||||
|
ocv_include_directories("${opencv_bgsegm_SOURCE_DIR}/include")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(${the_target} ${sources} ${headers})
|
add_executable(${the_target} ${sources} ${headers})
|
||||||
ocv_target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_CUDA_SAMPLES_REQUIRED_DEPS})
|
ocv_target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_CUDA_SAMPLES_REQUIRED_DEPS})
|
||||||
|
|
||||||
@ -14,6 +18,10 @@ if(HAVE_opencv_xfeatures2d)
|
|||||||
ocv_target_link_libraries(${the_target} opencv_xfeatures2d)
|
ocv_target_link_libraries(${the_target} opencv_xfeatures2d)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_opencv_bgsegm)
|
||||||
|
ocv_target_link_libraries(${the_target} opencv_bgsegm)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(${the_target} PROPERTIES
|
set_target_properties(${the_target} PROPERTIES
|
||||||
OUTPUT_NAME "performance_gpu"
|
OUTPUT_NAME "performance_gpu"
|
||||||
PROJECT_LABEL "(EXAMPLE_CUDA) performance")
|
PROJECT_LABEL "(EXAMPLE_CUDA) performance")
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
#include "opencv2/xfeatures2d/nonfree.hpp"
|
#include "opencv2/xfeatures2d/nonfree.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCV_BGSEGM
|
||||||
|
#include "opencv2/bgsegm.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
@ -1266,6 +1270,8 @@ TEST(FarnebackOpticalFlow)
|
|||||||
}}}
|
}}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCV_BGSEGM
|
||||||
|
|
||||||
TEST(MOG)
|
TEST(MOG)
|
||||||
{
|
{
|
||||||
const std::string inputFile = abspath("768x576.avi");
|
const std::string inputFile = abspath("768x576.avi");
|
||||||
@ -1276,7 +1282,7 @@ TEST(MOG)
|
|||||||
cv::Mat frame;
|
cv::Mat frame;
|
||||||
cap >> frame;
|
cap >> frame;
|
||||||
|
|
||||||
cv::Ptr<cv::BackgroundSubtractor> mog = cv::createBackgroundSubtractorMOG();
|
cv::Ptr<cv::BackgroundSubtractor> mog = cv::bgsegm::createBackgroundSubtractorMOG();
|
||||||
cv::Mat foreground;
|
cv::Mat foreground;
|
||||||
|
|
||||||
mog->apply(frame, foreground, 0.01);
|
mog->apply(frame, foreground, 0.01);
|
||||||
@ -1317,6 +1323,8 @@ TEST(MOG)
|
|||||||
TestSystem::instance().gpuComplete();
|
TestSystem::instance().gpuComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST(MOG2)
|
TEST(MOG2)
|
||||||
{
|
{
|
||||||
const std::string inputFile = abspath("768x576.avi");
|
const std::string inputFile = abspath("768x576.avi");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user