1

Topic: OpenCV and OpenCL

I try to collect opencv 3.4.1 with ocl unit. It is impossible. At the assembly opencv in  I specify WITH_OPENCL, WITH_OPENCLAMBLAS, WITH_OPENCLAMDEFT. Generation and the assembly transit without errors. I install in the project, this piece if (! cv:: ocl:: haveOpenCL ()) {std:: cout <<"OpenCL is not available..." <<std:: endl; system ("Pause"); return 1;} transits without errors. But the main classes, type, cv:: ocl:: oclMat, there are not present. In old docks on opencv 2.4 it is underlined that in sources/modules there should be directory OCL. At me it is not present. Quits to me opencl SDK most it is necessary to install? If so it is necessary to palm off what libraries that ocl earned?

2

Re: OpenCV and OpenCL

Hello, Vicul, you wrote: V> transits without errors. But the main classes, type, cv:: ocl:: oclMat, there are not present. In old docks on opencv 2.4 it is underlined that in sources/modules there should be directory OCL. At me it is not present. Quits to me opencl SDK most it is necessary to install? If so it is necessary to palm off what libraries that ocl earned? 1. What writes CMake about OpenCL when you fulfill configure? 2. The directory opencl is also it should be. 3. On what device and under what system you want to launch opencl? If to speak about immediate operation then iron and the driver to it is necessary only.

3

Re: OpenCV and OpenCL

N> 1. What writes CMake about OpenCL when you fulfill configure? Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.7") Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.6") Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.4") Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.2") found Intel IPP (ICV version): 2017.0.3 [2017.0.3] at: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/build/3rdparty/ippicv/ippicv_win found Intel IPP IW sources: 2017.0.3 at: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/build/3rdparty/ippicv/ippiw_win Could not find OpenBLAS include. Turning OpenBLAS_FOUND off Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off A library with BLAS API not found. Please specify library location. LAPACK requires BLAS A library with LAPACK API not found. Please specify library location. Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) VTK is not found. Please set-DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file Caffe: NO Protobuf: NO Glog: NO Looking for tiny_dnn.h Looking for tiny_dnn.h - found Found tiny-dnn in: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/build/3rdparty/tinydnn/tiny-dnn-1.0.0a3 The protocol buffer compiler is not found (PROTOBUF_PROTOC_EXECUTABLE = ") freetype2: NO harfbuzz: NO Module opencv_ovis disabled because OGRE3D was not found No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake. Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components. Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags Excluding from source files list: modules/core/src/convert.avx2.cpp Excluding from source files list: modules/imgproc/src/filter.avx2.cpp Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp Excluding from source files list: modules/imgproc/src/resize.avx2.cpp Excluding from source files list: modules/imgproc/src/undistort.avx2.cpp Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp Excluding from source files list: modules/features2d/src/fast.avx2.cpp Tesseract: NO General configuration for OpenCV 3.4.1 ===================================== Version control: unknown Extra modules: Location (extra): C:/Users/KVY/Downloads/opencv_contrib-3.4.1/opencv_contrib-3.4.1/modules Version control (extra): unknown Platform: Timestamp: 2018-04-12T03:17:02Z Host: Windows 10.0.16299 AMD64 CMake: 3.10.0-rc2 CMake generator: A Visual Studio 15 2017 CMake build tool: C:\Program Files (x86) \Microsoft Visual Studio\2017\Professional/MSBuild/15.0/Bin/MSBuild.exe MSVC: 1913 CPU/HW features: Baseline: SSE SSE2 requested: SSE2 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX requested: SSE4_1 SSE4_2 AVX FP16 SSE4_1 (3 files): + SSE3 SSSE3 SSE4_1 SSE4_2 (1 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (2 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (5 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX A C/C ++: Built as dynamic libs?: YES A C ++ 11: YES A C ++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x86/cl.exe (ver 19.13.26131.1) A C ++ flags (Release): /DWIN32/D_WINDOWS/W4/GR/D _CRT_SECURE_NO_DEPRECATE/D _CRT_NONSTDC_NO_DEPRECATE/D _SCL_SECURE_NO_WARNINGS/Gy/bigobj/Oi/fp:fast/arch:SSE/arch:SSE2/EHa/wd4127/wd4251/wd4324/wd4275/wd4512/wd4589/MP8/MD/O2/Ob2/DNDEBUG A C ++ flags (Debug):/DWIN32/D_WINDOWS/W4/GR/D _CRT_SECURE_NO_DEPRECATE/D _CRT_NONSTDC_NO_DEPRECATE/D _SCL_SECURE_NO_WARNINGS/Gy/bigobj/Oi/fp:fast/arch:SSE/arch:SSE2/EHa/wd4127/wd4251/wd4324/wd4275/wd4512/wd4589/MP8/MDd/Zi/Ob0/Od/RTC1 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x86/cl.exe A C flags (Release):/DWIN32/D_WINDOWS/W3/D _CRT_SECURE_NO_DEPRECATE/D _CRT_NONSTDC_NO_DEPRECATE/D _SCL_SECURE_NO_WARNINGS/Gy/bigobj/Oi/fp:fast/arch:SSE/arch:SSE2/MP8/MD/O2/Ob2/DNDEBUG A C flags (Debug):/DWIN32/D_WINDOWS/W3/D _CRT_SECURE_NO_DEPRECATE/D _CRT_NONSTDC_NO_DEPRECATE/D _SCL_SECURE_NO_WARNINGS/Gy/bigobj/Oi/fp:fast/arch:SSE/arch:SSE2/MP8/MDd/Zi/Ob0/Od/RTC1 Linker flags (Release): /machine:X86/INCREMENTAL:NO Linker flags (Debug):/machine:X86/debug/INCREMENTAL ccache: NO Precompiled headers: YES Extra dependencies: 3rdparty dependencies: OpenCV modules: To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann fuzzy hfs highgui img_hash imgcodecs imgproc java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo plot python_bindings_generator reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto Disabled: js world Disabled by dependency: - Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv dnn_modern freetype hdf java matlab ovis python2 python3 sfm viz Applications: tests perf_tests apps Documentation: NO Non-free algorithms: NO Windows RT support: NO GUI: Win32 UI: YES VTK support: NO Media I/O: ZLib: build (ver 1.2.11) JPEG: build (ver 90) WEBP: build (ver encoder: 0x020e) PNG: build (ver 1.6.34) TIFF: build (ver 42 - 4.0.9) JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1) Video I/O: Video for Windows: YES DC1394: NO FFMPEG: YES (prebuilt binaries) avcodec: YES (ver 57.107.100) avformat: YES (ver 57.83.100) avutil: YES (ver 55.78.100) swscale: YES (ver 4.8.100) avresample: YES (ver 3.7.0) GStreamer: NO DirectShow: YES Parallel framework: Concurrency Trace: YES (with INTEL ITT) Other third-party libraries: INTEL IPP: 2017.0.3 [2017.0.3] at: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/build/3rdparty/ippicv/ippicv_win INTEL IPP IW: sources (2017.0.3) at: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/build/3rdparty/ippicv/ippiw_win Lapack: NO Eigen: NO Custom HAL: NO Protobuf: build (3.5.1) OpenCL: YES (no extra features) Include path: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/3rdparty/include/opencl/1.2 Link libraries: Dynamic load Python (for build): NO Java: ant: NO JNI: NO Java wrappers: NO Java tests: NO Matlab: NO Install to: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/build/install----------------------------------------------------------------- Configuring done N> 2. The directory opencl is also it should be. Is,  N> 3. On what device and under what system you want to launch opencl? If to speak about immediate operation then iron and the driver to it is necessary only. While I plan to use GPU video of the cards supporting opencl (Further, cuda) under Windows 7-10. While operation CV of function  on GPU interests. The project gathers under VS2017

4

Re: OpenCV and OpenCL

Hello, Vicul, you wrote: N>> 1. What writes CMake about OpenCL when you fulfill configure? Was it enough: OpenCL: YES (no extra features) Include path: C:/Users/KVY/Downloads/opencv-3.4.1/opencv-3.4.1/3rdparty/include/opencl/1.2 Link libraries: Dynamic load That is it is own and is included. And explicitly gathers normally. For usage in practice you should store images not in cv:: Mat, and in cv:: UMat is is called TAPI (transparent API). In the code add two lines: cv:: ocl:: setUseOpenCL (true); std:: cout <<(cv:: ocl:: useOpenCL ()? "OpenCL is enabled":" OpenCL not used ") <<std:: endl; What deduces? N>> 3. On what device and under what system you want to launch opencl? If to speak about immediate operation then iron and the driver to it is necessary only. V> While I plan to use GPU video of the cards supporting opencl (Further, cuda) under Windows 7-10. While operation CV of function  on GPU interests. The project gathers under VS2017 Look, at you then should support the driver OpenCL. And, I think, it indeed. Now about on what device at you it will be fulfilled. Most likely you CPU or iGPU from Intel also is able OpenCL. To specify OpenCV what device to select for OpenCL it is necessary to specify explicitly in its variable environments.

5

Re: OpenCV and OpenCL

N> In the code add two lines: N> N> cv:: ocl:: setUseOpenCL (true); N> std:: cout <<(cv:: ocl:: useOpenCL ()? "OpenCL is enabled": "OpenCL not used") <<std:: endl; N> N> That deduces? [INFO:0] Initialize OpenCL runtime... OpenCL is enabled N> now about on what device at you it will be fulfilled. Most likely you CPU or iGPU from Intel also is able OpenCL. On a computer two cards - Intelovsky and Dzhefors 650. On other computers is and  cards

6

Re: OpenCV and OpenCL

Hello, Vicul, you wrote: V> V> [INFO:0] Initialize OpenCL runtime... V> OpenCL is enabled Then all is normal. N>> now about on what device at you it will be fulfilled. Most likely you CPU or iGPU from Intel also is able OpenCL. V> On a computer two cards - Intelovsky and Dzhefors 650. On other computers is and  cards Then it is necessary standard OpenCL API to receive the list of devices and to write down in the variable environments that is necessary. If there is a card from Nvidia or AMD to select it. Or to allow to the user most to select.

7

Re: OpenCV and OpenCL

N> Then all is normal. Then why there is no function ocl:: resize ()? N> Or to allow to the user most to select. It is clear. Now a question - to check up, how functions CV work on GPU

8

Re: OpenCV and OpenCL

Hello, Vicul, you wrote: N>> Then all is normal. V> then why there is no function V> ocl:: resize ()? I wrote above: N>> For usage in practice you should store images not in cv:: Mat, and in cv:: UMat is is called TAPI (transparent API). It is More than anything.

9

Re: OpenCV and OpenCL

N> I wrote above: N>>> For usage in practice you should store images not in cv:: Mat, and in cv:: UMat is is called TAPI (transparent API). N> it is More than anything. I will specify. I push all in cv:: UMat and I cause cv:: resize (), and opencv already the automatic machine to redirect on resize () in GPU?

10

Re: OpenCV and OpenCL

Hello, Vicul, you wrote: V> I Will specify. I push all in cv:: UMat and I cause cv:: resize (), and opencv already the automatic machine to redirect on resize () in GPU? Yes, so. Source codes are opened: here. If at you isUMat and the size more than 10 on 10 implementation is caused OpenCL.

11

Re: OpenCV and OpenCL

N> Yes, so. Source codes are opened: here. If at you isUMat and the size more than 10 on 10 implementation is caused OpenCL. Thanks, earned!! Saw on Process to the Explorer loading on GPU