From 3b2c5d301a4fde28c1cb7ce7a81f292942f28028 Mon Sep 17 00:00:00 2001 From: Thor Watanabe Date: Thu, 7 Feb 2019 20:46:22 +0900 Subject: [PATCH] Modified for OpenCV 4.0.1. --- 020_build_vc4c.sh | 16 +-- 030_build_vc4cl.sh | 17 +-- 040_install_clinfo.sh | 6 ++ README.md | 6 ++ test/opencv/Makefile | 9 +- test/opencv/cvconfig.h | 229 +++++++++++++++++++++++++++++++++++++++++ test/opencv/setup.sh | 2 +- 7 files changed, 263 insertions(+), 22 deletions(-) create mode 100644 040_install_clinfo.sh create mode 100644 test/opencv/cvconfig.h diff --git a/020_build_vc4c.sh b/020_build_vc4c.sh index a8a5c41..d9ef156 100755 --- a/020_build_vc4c.sh +++ b/020_build_vc4c.sh @@ -2,11 +2,11 @@ # # Compiler for the VC4CL OpenCL implementation # -cd VC4C -cmake . -make -sudo checkinstall -D \ - --install=yes \ - --pkgname=vc4c \ - --pkgversion=0.4 \ - --provides=vc4c +(cd VC4C && \ + cmake . && \ + make && \ + sudo checkinstall -D \ + --install=yes \ + --pkgname=vc4c \ + --pkgversion=0.4 \ + --provides=vc4c) diff --git a/030_build_vc4cl.sh b/030_build_vc4cl.sh index 2443501..b9e3ea4 100755 --- a/030_build_vc4cl.sh +++ b/030_build_vc4cl.sh @@ -1,11 +1,12 @@ #!/bin/sh -x +sudo apt-get install libncurses5-dev +(cd VC4CL && \ + cmake . && \ + make && \ + sudo checkinstall -D \ + --install=yes \ + --pkgname=vc4cl \ + --pkgversion=0.4 \ + --provides=vc4cl) -cd VC4CL -cmake . -make -sudo checkinstall -D \ - --install=yes \ - --pkgname=vc4cl \ - --pkgversion=0.4 \ - --provides=vc4cl diff --git a/040_install_clinfo.sh b/040_install_clinfo.sh new file mode 100644 index 0000000..fdc45eb --- /dev/null +++ b/040_install_clinfo.sh @@ -0,0 +1,6 @@ +#!/bin/sh -x + +git clone https://github.com/Oblomov/clinfo +cd clinfo +make +sudo cp clinfo /usr/local/bin diff --git a/README.md b/README.md index c065404..9294bae 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,12 @@ cd rpi3-vc4cl ./030_build_vc4cl.sh ``` +### clinfo + +``` +040_install_clinfo.sh +``` + ## How to Test ### OpenCV diff --git a/test/opencv/Makefile b/test/opencv/Makefile index 73fd94b..ca6f81f 100644 --- a/test/opencv/Makefile +++ b/test/opencv/Makefile @@ -6,7 +6,7 @@ TEST_STITCHING=yes TEST_PHOTO=yes TEST_VIDEO=yes TEST_FEATURE2D=yes -RPI3=no +RPI3=yes all: $(TARGET) @@ -14,19 +14,18 @@ VPATH=./modules/imgproc/test/ocl \ ./modules/ts/src \ ./modules/core/test/ocl \ ./modules/stitching/test/ocl \ - ./modules/core/test/ocl \ ./modules/photo/test/ocl \ ./modules/video/test/ocl \ ./modules/features2d/test/ocl -CXX=g++ +CXX=g++-6 CXXFLAGS=-g \ -D__OPENCV_BUILD \ - -std=gnu++11 \ + -std=gnu++14 \ -O0 \ -I/usr/include/eigen3 \ - -I/usr/local/include/opencv2 \ + -I/usr/local/include/opencv4 \ -I. \ -I./modules \ -I./modules/ts/include \ diff --git a/test/opencv/cvconfig.h b/test/opencv/cvconfig.h new file mode 100644 index 0000000..7e4f109 --- /dev/null +++ b/test/opencv/cvconfig.h @@ -0,0 +1,229 @@ +#ifndef OPENCV_CVCONFIG_H_INCLUDED +#define OPENCV_CVCONFIG_H_INCLUDED + +/* OpenCV compiled as static or dynamic libs */ +#define BUILD_SHARED_LIBS + +/* OpenCV intrinsics optimized code */ +#define CV_ENABLE_INTRINSICS + +/* OpenCV additional optimized code */ +/* #undef CV_DISABLE_OPTIMIZATION */ + +/* Compile for 'real' NVIDIA GPU architectures */ +#define CUDA_ARCH_BIN "" + +/* Create PTX or BIN for 1.0 compute capability */ +/* #undef CUDA_ARCH_BIN_OR_PTX_10 */ + +/* NVIDIA GPU features are used */ +#define CUDA_ARCH_FEATURES "" + +/* Compile for 'virtual' NVIDIA PTX architectures */ +#define CUDA_ARCH_PTX "" + +/* AVFoundation video libraries */ +/* #undef HAVE_AVFOUNDATION */ + +/* V4L2 capturing support */ +#define HAVE_CAMV4L2 + +/* AMD's Basic Linear Algebra Subprograms Library*/ +/* #undef HAVE_CLAMDBLAS */ + +/* AMD's OpenCL Fast Fourier Transform Library*/ +/* #undef HAVE_CLAMDFFT */ + +/* Clp support */ +/* #undef HAVE_CLP */ + +/* Cocoa API */ +/* #undef HAVE_COCOA */ + +/* NVIDIA CUDA Basic Linear Algebra Subprograms (BLAS) API*/ +/* #undef HAVE_CUBLAS */ + +/* NVIDIA CUDA Runtime API*/ +/* #undef HAVE_CUDA */ + +/* NVIDIA CUDA Fast Fourier Transform (FFT) API*/ +/* #undef HAVE_CUFFT */ + +/* IEEE1394 capturing support */ +/* #undef HAVE_DC1394 */ + +/* IEEE1394 capturing support - libdc1394 v2.x */ +#define HAVE_DC1394_2 + +/* DirectX */ +/* #undef HAVE_DIRECTX */ +/* #undef HAVE_DIRECTX_NV12 */ +/* #undef HAVE_D3D11 */ +/* #undef HAVE_D3D10 */ +/* #undef HAVE_D3D9 */ + +/* DirectShow Video Capture library */ +/* #undef HAVE_DSHOW */ + +/* Eigen Matrix & Linear Algebra Library */ +#define HAVE_EIGEN + +/* FFMpeg video library */ +#define HAVE_FFMPEG + +/* Geospatial Data Abstraction Library */ +/* #undef HAVE_GDAL */ + +/* GStreamer multimedia framework */ +#define HAVE_GSTREAMER + +/* GTK+ 2.0 Thread support */ +/* #undef HAVE_GTHREAD */ + +/* GTK+ 2.x toolkit */ +/* #undef HAVE_GTK */ + +/* Halide support */ +/* #undef HAVE_HALIDE */ + +/* Vulkan support */ +/* #undef HAVE_VULKAN */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Intel Perceptual Computing SDK library */ +/* #undef HAVE_INTELPERC */ + +/* Intel Integrated Performance Primitives */ +/* #undef HAVE_IPP */ +/* #undef HAVE_IPP_ICV */ +/* #undef HAVE_IPP_IW */ +/* #undef HAVE_IPP_IW_LL */ + +/* JPEG-2000 codec */ +#define HAVE_JASPER + +/* IJG JPEG codec */ +#define HAVE_JPEG + +/* libpng/png.h needs to be included */ +#define HAVE_LIBPNG_PNG_H + +/* GDCM DICOM codec */ +/* #undef HAVE_GDCM */ + +/* Microsoft Media Foundation Capture library */ +/* #undef HAVE_MSMF */ + +/* NVIDIA Video Decoding API*/ +/* #undef HAVE_NVCUVID */ + +/* NVIDIA Video Encoding API*/ +/* #undef HAVE_NVCUVENC */ + +/* OpenCL Support */ +#define HAVE_OPENCL +/* #undef HAVE_OPENCL_STATIC */ +/* #undef HAVE_OPENCL_SVM */ + +/* OpenEXR codec */ +#define HAVE_OPENEXR + +/* OpenGL support*/ +/* #undef HAVE_OPENGL */ + +/* OpenNI library */ +/* #undef HAVE_OPENNI */ + +/* OpenNI library */ +/* #undef HAVE_OPENNI2 */ + +/* librealsense library */ +/* #undef HAVE_LIBREALSENSE */ + +/* PNG codec */ +#define HAVE_PNG + +/* Posix threads (pthreads) */ +#define HAVE_PTHREAD + +/* parallel_for with pthreads */ +/* #undef HAVE_PTHREADS_PF */ + +/* Qt support */ +#define HAVE_QT + +/* Qt OpenGL support */ +/* #undef HAVE_QT_OPENGL */ + +/* Intel Threading Building Blocks */ +#define HAVE_TBB + +/* Ste||ar Group High Performance ParallelX */ +/* #undef HAVE_HPX */ + +/* TIFF codec */ +#define HAVE_TIFF + +/* V4L2 capturing support in videoio.h */ +/* #undef HAVE_VIDEOIO */ + +/* Win32 UI */ +/* #undef HAVE_WIN32UI */ + +/* XIMEA camera support */ +/* #undef HAVE_XIMEA */ + +/* Xine video library */ +/* #undef HAVE_XINE */ + +/* Define if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* gPhoto2 library */ +#define HAVE_GPHOTO2 + +/* VA library (libva) */ +/* #undef HAVE_VA */ + +/* Intel VA-API/OpenCL */ +/* #undef HAVE_VA_INTEL */ + +/* Intel Media SDK */ +/* #undef HAVE_MFX */ + +/* Lapack */ +#define HAVE_LAPACK + +/* Library was compiled with functions instrumentation */ +/* #undef ENABLE_INSTRUMENTATION */ + +/* OpenVX */ +/* #undef HAVE_OPENVX */ + +#if defined(HAVE_XINE) || \ + defined(HAVE_GSTREAMER) || \ + defined(HAVE_AVFOUNDATION) || \ + /*defined(HAVE_OPENNI) || too specialized */ \ + defined(HAVE_FFMPEG) || \ + defined(HAVE_MSMF) +#define HAVE_VIDEO_INPUT +#endif + +#if /*defined(HAVE_XINE) || */\ + defined(HAVE_GSTREAMER) || \ + defined(HAVE_AVFOUNDATION) || \ + defined(HAVE_FFMPEG) || \ + defined(HAVE_MSMF) +#define HAVE_VIDEO_OUTPUT +#endif + +/* OpenCV trace utilities */ +#define OPENCV_TRACE + +/* Library QR-code decoding */ +#define HAVE_QUIRC + +#endif // OPENCV_CVCONFIG_H_INCLUDED diff --git a/test/opencv/setup.sh b/test/opencv/setup.sh index 8ae82c3..1648d13 100755 --- a/test/opencv/setup.sh +++ b/test/opencv/setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -x -OPENCV_VER=3.4.2 +OPENCV_VER=4.0.1 sudo apt-get install googletest libgtest-dev