For current OpenCV-CL architecture, if the data buffer
allocated in UMat are cpu buffer(not ocl buffer) under
cpu mode, and then pass this UMat to an OpenCL kernel
as an argument, the OpenCL path will fail and fallback
to cpu mode. Take HOGDescriptor::oclSvmDetector as an example:
ocl::setUseOpenCL(false);
//data allocated in hog.oclSvmDetector will be cpu buffer
hog.setSVMDetector(HOGDescriptor::getDaimlerPeopleDetector());
ocl::setUseOpenCL(true);
//We enabled OpenCL, but hog.oclSvmDetector are cpu buffer,
//so it will fail in the function ocl_classify_hists
//when reach to this line
//idx = k.set(idx, ocl::KernelArg::PtrReadOnly(detector));
hog.detectMultiScale(img, found, hit_threshold, win_stride,
Size(0, 0), scale, gr_threshold);
Similar problems heppen on img_aux and img. So we should re-define
or re-set these UMat when do mode switch (CPU -> OpenCL) in order
to make their data be allocated by ocl and then OpenCL path will
succeed.
Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
As opencv_xfeatures2d is part of opencv-contrib and not opencv repository,
${OpenCV_SOURCE_DIR}/modules/modules/include is not a correct include
path - use ${opencv_xfeatures2d_SOURCE_DIR}/include instead
The cv::superres::createOptFlow_Simple() function along with the
simple optical flow class implementation is currently commented out
in the superres module's code, so comment it out in the example as well.
The FGD background subtraction model was part of opencv_legacy module;
as it is gone now, it makes little sense to benchmark the GPU version,
either, so the whole test is removed.
This patch removes inclusion of opencv2/contrib/contrib.hpp header,
which does not exist anymore due to removal of opencv_contrib module.
The samples including this header appear to be doing so in order to
use TickMeter class; therefore, the latter is now provided by tick_meter.hpp
header file, located in samples/gpu folder.
fixed dependency of stitching module on xfeatures2d module as optional
fixed the initModule_xfeatures2d function that was called in module stitching since it is in another namespace than the standard cv one.
- Extracted common operations to separate functions.
- Activated first parameters set.
- Some output formatting.
- Fixed loop break condition in mini_batch_gradient function.