Revert "Revert "Merge pull request #836 from jet47:gpu-modules""
This commit is contained in:
@@ -16,8 +16,17 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/include")#for opencv.hpp
|
||||
ocv_include_modules(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
|
||||
|
||||
if(HAVE_opencv_gpu)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/include")
|
||||
if(HAVE_opencv_gpuoptflow)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpuoptflow/include")
|
||||
endif()
|
||||
if(HAVE_opencv_gpuimgproc)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpuimgproc/include")
|
||||
endif()
|
||||
if(HAVE_opencv_gpuarithm)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpuarithm/include")
|
||||
endif()
|
||||
if(HAVE_opencv_gpufilters)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpufilters/include")
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
|
||||
@@ -43,8 +52,8 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
add_executable(${the_target} ${srcs})
|
||||
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
|
||||
|
||||
if(HAVE_opencv_gpu)
|
||||
target_link_libraries(${the_target} opencv_gpu)
|
||||
if("${srcs}" MATCHES "gpu/")
|
||||
target_link_libraries(${the_target} opencv_gpuarithm opencv_gpufilters)
|
||||
endif()
|
||||
|
||||
set_target_properties(${the_target} PROPERTIES
|
||||
@@ -70,7 +79,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
ocv_list_filterout(cpp_samples Qt_sample)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_opencv_gpu)
|
||||
if(NOT HAVE_opencv_gpuarithm OR NOT HAVE_opencv_gpufilters)
|
||||
ocv_list_filterout(cpp_samples "/gpu/")
|
||||
endif()
|
||||
|
||||
|
@@ -356,7 +356,7 @@ int main(int argc, char* argv[])
|
||||
Ptr<FeaturesFinder> finder;
|
||||
if (features_type == "surf")
|
||||
{
|
||||
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
|
||||
finder = new SurfFeaturesFinderGpu();
|
||||
else
|
||||
@@ -544,7 +544,7 @@ int main(int argc, char* argv[])
|
||||
// Warp images and their masks
|
||||
|
||||
Ptr<WarperCreator> warper_creator;
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPUWARPING
|
||||
if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
|
||||
{
|
||||
if (warp_type == "plane") warper_creator = new cv::PlaneWarperGpu();
|
||||
|
@@ -5,7 +5,10 @@
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/imgproc.hpp>// Image processing methods for the CPU
|
||||
#include <opencv2/highgui.hpp>// Read images
|
||||
#include <opencv2/gpu.hpp> // GPU structures and methods
|
||||
|
||||
// GPU structures and methods
|
||||
#include <opencv2/gpuarithm.hpp>
|
||||
#include <opencv2/gpufilters.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@@ -216,7 +216,7 @@ public:
|
||||
outlierRejector = tblor;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#if defined(HAVE_OPENCV_GPUIMGPROC) && defined(HAVE_OPENCV_GPU) && defined(HAVE_OPENCV_GPUOPTFLOW)
|
||||
if (gpu)
|
||||
{
|
||||
KeypointBasedMotionEstimatorGpu *kbest = new KeypointBasedMotionEstimatorGpu(est);
|
||||
@@ -257,7 +257,7 @@ public:
|
||||
outlierRejector = tblor;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#if defined(HAVE_OPENCV_GPUIMGPROC) && defined(HAVE_OPENCV_GPU) && defined(HAVE_OPENCV_GPUOPTFLOW)
|
||||
if (gpu)
|
||||
{
|
||||
KeypointBasedMotionEstimatorGpu *kbest = new KeypointBasedMotionEstimatorGpu(est);
|
||||
|
@@ -1,7 +1,10 @@
|
||||
SET(OPENCV_GPU_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc opencv_highgui
|
||||
opencv_ml opencv_video opencv_objdetect opencv_features2d
|
||||
opencv_calib3d opencv_legacy opencv_contrib opencv_gpu
|
||||
opencv_nonfree opencv_softcascade opencv_superres)
|
||||
opencv_nonfree opencv_softcascade opencv_superres
|
||||
opencv_gpuarithm opencv_gpufilters opencv_gpuwarping opencv_gpuimgproc
|
||||
opencv_gpufeatures2d opencv_gpuoptflow opencv_gpubgsegm
|
||||
opencv_gpustereo opencv_gpulegacy)
|
||||
|
||||
ocv_check_dependencies(${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
|
||||
|
||||
@@ -21,6 +24,10 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/nonfree/include")
|
||||
endif()
|
||||
|
||||
if(HAVE_opencv_gpucodec)
|
||||
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpucodec/include")
|
||||
endif()
|
||||
|
||||
if(HAVE_CUDA)
|
||||
ocv_include_directories(${CUDA_INCLUDE_DIRS})
|
||||
endif()
|
||||
@@ -40,6 +47,9 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
if(HAVE_opencv_nonfree)
|
||||
target_link_libraries(${the_target} opencv_nonfree)
|
||||
endif()
|
||||
if(HAVE_opencv_gpucodec)
|
||||
target_link_libraries(${the_target} opencv_gpucodec)
|
||||
endif()
|
||||
|
||||
set_target_properties(${the_target} PROPERTIES
|
||||
OUTPUT_NAME "${project}-example-${name}"
|
||||
|
@@ -6,6 +6,12 @@
|
||||
#include "opencv2/gpu.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
# include "opencv2/nonfree/gpu.hpp"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
|
@@ -8,10 +8,11 @@
|
||||
#include <cstdio>
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
#include "opencv2/objdetect/objdetect_c.h"
|
||||
|
||||
#ifdef HAVE_CUDA
|
||||
#include "NCVHaarObjectDetection.hpp"
|
||||
#include "opencv2/gpulegacy.hpp"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/gpu.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/objdetect.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@@ -16,8 +16,7 @@
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
|
||||
#ifdef HAVE_CUDA
|
||||
#include "NPP_staging/NPP_staging.hpp"
|
||||
#include "NCVBroxOpticalFlow.hpp"
|
||||
#include "opencv2/gpulegacy.hpp"
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_CUDA)
|
||||
|
@@ -1,14 +1,19 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
||||
#if defined(HAVE_OPENCV_GPUCODEC)
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/opengl.hpp>
|
||||
#include <opencv2/gpu/gpu.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/contrib/contrib.hpp>
|
||||
#include <opencv2/gpucodec.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/contrib.hpp>
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
@@ -69,3 +74,13 @@ int main(int argc, const char* argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "OpenCV was built without GPU Video decoding support\n" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1,11 +1,16 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
||||
#if defined(HAVE_OPENCV_GPUCODEC) && defined(WIN32)
|
||||
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/gpucodec.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
@@ -94,3 +99,13 @@ int main(int argc, const char* argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "OpenCV was built without GPU Video encoding support\n" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user