diff --git a/Dockerfile b/Dockerfile index 89f14bec..9792beb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev && \ rm -rf /var/lib/apt/lists/* -ARG OPENCV_VERSION="4.4.0" +ARG OPENCV_VERSION="4.5.0" ENV OPENCV_VERSION $OPENCV_VERSION RUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \ diff --git a/Makefile b/Makefile index 63f208d2..ffc2776b 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,10 @@ .PHONY: test deps download build clean astyle cmds docker # OpenCV version to use. -OPENCV_VERSION?=4.4.0 +OPENCV_VERSION?=4.5.0 # Go version to use when building Docker image -GOVERSION?=1.14.4 +GOVERSION?=1.15.3 # Temporary directory to put files into. TMP_DIR?=/tmp/ diff --git a/README.md b/README.md index 87b85752..c3789a92 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The GoCV package provides Go language bindings for the [OpenCV 4](http://opencv.org/) computer vision library. -The GoCV package supports the latest releases of Go and OpenCV (v4.4.0) on Linux, macOS, and Windows. We intend to make the Go language a "first-class" client compatible with the latest developments in the OpenCV ecosystem. +The GoCV package supports the latest releases of Go and OpenCV (v4.5.0) on Linux, macOS, and Windows. We intend to make the Go language a "first-class" client compatible with the latest developments in the OpenCV ecosystem. GoCV also supports [Intel OpenVINO](https://software.intel.com/en-us/openvino-toolkit). Check out the [OpenVINO README](./openvino/README.md) for more info on how to use GoCV with the Intel OpenVINO toolkit. @@ -127,17 +127,17 @@ To install GoCV, run the following command: go get -u -d gocv.io/x/gocv ``` -To run code that uses the GoCV package, you must also install OpenCV 4.4.0 on your system. Here are instructions for Ubuntu, Raspian, macOS, and Windows. +To run code that uses the GoCV package, you must also install OpenCV 4.5.0 on your system. Here are instructions for Ubuntu, Raspian, macOS, and Windows. ## Ubuntu/Linux ### Installation -You can use `make` to install OpenCV 4.4.0 with the handy `Makefile` included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the `Makefile` is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way. +You can use `make` to install OpenCV 4.5.0 with the handy `Makefile` included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the `Makefile` is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way. #### Quick Install -The following commands should do everything to download and install OpenCV 4.4.0 on Linux: +The following commands should do everything to download and install OpenCV 4.5.0 on Linux: cd $GOPATH/src/gocv.io/x/gocv make install @@ -149,7 +149,7 @@ If you need static opencv libraries If it works correctly, at the end of the entire process, the following message should be displayed: gocv version: 0.22.0 - opencv lib version: 4.4.0 + opencv lib version: 4.5.0 That's it, now you are ready to use GoCV. @@ -163,7 +163,7 @@ That's it, now you are ready to use GoCV. #### Install OpenVINO and Cuda - The following commands should do everything to download and install OpenCV 4.4.0 with Cuda and OpenVINO on Linux: + The following commands should do everything to download and install OpenCV 4.5.0 with Cuda and OpenVINO on Linux: cd $GOPATH/src/gocv.io/x/gocv make install_all @@ -175,7 +175,7 @@ If you need static opencv libraries If it works correctly, at the end of the entire process, the following message should be displayed: gocv version: 0.22.0 - opencv lib version: 4.4.0-openvino + opencv lib version: 4.5.0-openvino cuda information: Device 0: "GeForce MX150" 2003Mb, sm_61, Driver/Runtime ver.10.0/10.0 @@ -195,7 +195,7 @@ Next, you need to update the system, and install any required packages: #### Download source -Now, download the OpenCV 4.4.0 and OpenCV Contrib source code: +Now, download the OpenCV 4.5.0 and OpenCV Contrib source code: make download @@ -230,7 +230,7 @@ Now you should be able to build or run any of the examples: The version program should output the following: gocv version: 0.22.0 - opencv lib version: 4.4.0 + opencv lib version: 4.5.0 #### Cleanup extra files @@ -315,11 +315,11 @@ There is a Docker image with Alpine 3.7 that has been created by project contrib ### Installation -We have a special installation for the Raspberry Pi that includes some hardware optimizations. You use `make` to install OpenCV 4.4.0 with the handy `Makefile` included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the `Makefile` is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way. +We have a special installation for the Raspberry Pi that includes some hardware optimizations. You use `make` to install OpenCV 4.5.0 with the handy `Makefile` included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the `Makefile` is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way. #### Quick Install -The following commands should do everything to download and install OpenCV 4.4.0 on Raspbian: +The following commands should do everything to download and install OpenCV 4.5.0 on Raspbian: cd $GOPATH/src/gocv.io/x/gocv make install_raspi @@ -327,7 +327,7 @@ The following commands should do everything to download and install OpenCV 4.4.0 If it works correctly, at the end of the entire process, the following message should be displayed: gocv version: 0.22.0 - opencv lib version: 4.4.0 + opencv lib version: 4.5.0 That's it, now you are ready to use GoCV. @@ -335,13 +335,13 @@ That's it, now you are ready to use GoCV. ### Installation -You can install OpenCV 4.4.0 using Homebrew. +You can install OpenCV 4.5.0 using Homebrew. If you already have an earlier version of OpenCV (3.4.x) installed, you should probably remove it before installing the new version: brew uninstall opencv -You can then install OpenCV 4.4.0: +You can then install OpenCV 4.5.0: brew install opencv @@ -366,7 +366,7 @@ Now you should be able to build or run any of the examples: The version program should output the following: gocv version: 0.22.0 - opencv lib version: 4.4.0 + opencv lib version: 4.5.0 ### Cache builds @@ -381,8 +381,8 @@ By default, pkg-config is used to determine the correct flags for compiling and For example: export CGO_CXXFLAGS="--std=c++11" - export CGO_CPPFLAGS="-I/usr/local/Cellar/opencv/4.4.0/include" - export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/4.4.0/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core" + export CGO_CPPFLAGS="-I/usr/local/Cellar/opencv/4.5.0/include" + export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/4.5.0/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core" Please note that you will need to run these 3 lines of code one time in your current session in order to build or run the code, in order to setup the needed ENV variables. Once you have done so, you can execute code that uses GoCV with your custom environment like this: @@ -394,7 +394,7 @@ Please note that you will need to run these 3 lines of code one time in your cur The following assumes that you are running a 64-bit version of Windows 10. -In order to build and install OpenCV 4.4.0 on Windows, you must first download and install MinGW-W64 and CMake, as follows. +In order to build and install OpenCV 4.5.0 on Windows, you must first download and install MinGW-W64 and CMake, as follows. #### MinGW-W64 @@ -410,9 +410,9 @@ Add the `C:\Program Files\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev2\mingw64\bi Download and install CMake [https://cmake.org/download/](https://cmake.org/download/) to the default location. CMake installer will add CMake to your system path. -#### OpenCV 4.4.0 and OpenCV Contrib Modules +#### OpenCV 4.5.0 and OpenCV Contrib Modules -The following commands should do everything to download and install OpenCV 4.4.0 on Windows: +The following commands should do everything to download and install OpenCV 4.5.0 on Windows: chdir %GOPATH%\src\gocv.io\x\gocv win_build_opencv.cmd @@ -434,7 +434,7 @@ Now you should be able to build or run any of the command examples: The version program should output the following: gocv version: 0.22.0 - opencv lib version: 4.4.0 + opencv lib version: 4.5.0 That's it, now you are ready to use GoCV. diff --git a/appveyor_build_opencv.cmd b/appveyor_build_opencv.cmd index 4694df61..a85c29ad 100644 --- a/appveyor_build_opencv.cmd +++ b/appveyor_build_opencv.cmd @@ -3,22 +3,22 @@ if not exist "C:\opencv" mkdir "C:\opencv" if not exist "C:\opencv\build" mkdir "C:\opencv\build" if not exist "C:\opencv\testdata" mkdir "C:\opencv\testdata" -appveyor DownloadFile https://github.com/opencv/opencv/archive/4.4.0.zip -FileName c:\opencv\opencv-4.4.0.zip -7z x c:\opencv\opencv-4.4.0.zip -oc:\opencv -y -del c:\opencv\opencv-4.4.0.zip /q -appveyor DownloadFile https://github.com/opencv/opencv_contrib/archive/4.4.0.zip -FileName c:\opencv\opencv_contrib-4.4.0.zip -7z x c:\opencv\opencv_contrib-4.4.0.zip -oc:\opencv -y -del c:\opencv\opencv_contrib-4.4.0.zip /q +appveyor DownloadFile https://github.com/opencv/opencv/archive/4.5.0.zip -FileName c:\opencv\opencv-4.5.0.zip +7z x c:\opencv\opencv-4.5.0.zip -oc:\opencv -y +del c:\opencv\opencv-4.5.0.zip /q +appveyor DownloadFile https://github.com/opencv/opencv_contrib/archive/4.5.0.zip -FileName c:\opencv\opencv_contrib-4.5.0.zip +7z x c:\opencv\opencv_contrib-4.5.0.zip -oc:\opencv -y +del c:\opencv\opencv_contrib-4.5.0.zip /q cd C:\opencv\build set PATH=C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft\Web Platform Installer\;C:\Tools\PsTools;C:\Program Files (x86)\CMake\bin;C:\go\bin;C:\Tools\NuGet;C:\Program Files\LLVM\bin;C:\Tools\curl\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin;C:\Users\appveyor\AppData\Local\Yarn\bin;C:\Program Files\AppVeyor\BuildAgent\ set PATH=%PATH%;C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin dir C:\opencv -cmake C:\opencv\opencv-4.4.0 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.4.0\modules -DBUILD_SHARED_LIBS=ON -DWITH_IPP=OFF -DWITH_MSMF=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_DOCS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_saliency=OFF -DCPU_DISPATCH= -DBUILD_opencv_gapi=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -Wno-dev +cmake C:\opencv\opencv-4.5.0 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.5.0\modules -DBUILD_SHARED_LIBS=ON -DWITH_IPP=OFF -DWITH_MSMF=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_DOCS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_saliency=OFF -DCPU_DISPATCH= -DBUILD_opencv_gapi=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -Wno-dev mingw32-make -j%NUMBER_OF_PROCESSORS% mingw32-make install appveyor DownloadFile https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/bvlc_googlenet.prototxt -FileName C:\opencv\testdata\bvlc_googlenet.prototxt appveyor DownloadFile http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel -FileName C:\opencv\testdata\bvlc_googlenet.caffemodel appveyor DownloadFile https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip -FileName C:\opencv\testdata\inception5h.zip 7z x C:\opencv\testdata\inception5h.zip -oC:\opencv\testdata tensorflow_inception_graph.pb -y -rmdir c:\opencv\opencv-4.4.0 /s /q -rmdir c:\opencv\opencv_contrib-4.4.0 /s /q +rmdir c:\opencv\opencv-4.5.0 /s /q +rmdir c:\opencv\opencv_contrib-4.5.0 /s /q diff --git a/travis_build_opencv.sh b/travis_build_opencv.sh index 5c080cd7..54405057 100755 --- a/travis_build_opencv.sh +++ b/travis_build_opencv.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eux -o pipefail -OPENCV_VERSION=${OPENCV_VERSION:-4.4.0} +OPENCV_VERSION=${OPENCV_VERSION:-4.5.0} #GRAPHICAL=ON GRAPHICAL=${GRAPHICAL:-OFF} diff --git a/version_test.go b/version_test.go index eb877f0f..afe7bcbc 100644 --- a/version_test.go +++ b/version_test.go @@ -8,7 +8,7 @@ import ( func TestVersions(t *testing.T) { ocvv := OpenCVVersion() - if !strings.Contains(ocvv, "4.4") { + if !strings.Contains(ocvv, "4.5") { t.Error("Wrong version of OpenCV:", ocvv) } diff --git a/win_build_opencv.cmd b/win_build_opencv.cmd index 6ea09b62..afb411ce 100644 --- a/win_build_opencv.cmd +++ b/win_build_opencv.cmd @@ -11,18 +11,18 @@ echo. REM This is why there is no progress bar: REM https://github.com/PowerShell/PowerShell/issues/2138 -echo Downloading: opencv-4.4.0.zip [91MB] -powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/4.4.0.zip -OutFile c:\opencv\opencv-4.4.0.zip" +echo Downloading: opencv-4.5.0.zip [91MB] +powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/4.5.0.zip -OutFile c:\opencv\opencv-4.5.0.zip" echo Extracting... -powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv-4.4.0.zip -DestinationPath c:\opencv" -del c:\opencv\opencv-4.4.0.zip /q +powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv-4.5.0.zip -DestinationPath c:\opencv" +del c:\opencv\opencv-4.5.0.zip /q echo. -echo Downloading: opencv_contrib-4.4.0.zip [58MB] -powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/4.4.0.zip -OutFile c:\opencv\opencv_contrib-4.4.0.zip" +echo Downloading: opencv_contrib-4.5.0.zip [58MB] +powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/4.5.0.zip -OutFile c:\opencv\opencv_contrib-4.5.0.zip" echo Extracting... -powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv_contrib-4.4.0.zip -DestinationPath c:\opencv" -del c:\opencv\opencv_contrib-4.4.0.zip /q +powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv_contrib-4.5.0.zip -DestinationPath c:\opencv" +del c:\opencv\opencv_contrib-4.5.0.zip /q echo. echo Done with downloading and extracting sources. @@ -32,9 +32,9 @@ echo on cd /D C:\opencv\build set PATH=%PATH%;C:\Program Files (x86)\CMake\bin;C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin -cmake C:\opencv\opencv-4.4.0 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.4.0\modules -DBUILD_SHARED_LIBS=ON -DWITH_IPP=OFF -DWITH_MSMF=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_DOCS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_saliency=OFF -DCPU_DISPATCH= -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -Wno-dev +cmake C:\opencv\opencv-4.5.0 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.5.0\modules -DBUILD_SHARED_LIBS=ON -DWITH_IPP=OFF -DWITH_MSMF=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_DOCS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_saliency=OFF -DCPU_DISPATCH= -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -Wno-dev mingw32-make -j%NUMBER_OF_PROCESSORS% mingw32-make install -rmdir c:\opencv\opencv-4.4.0 /s /q -rmdir c:\opencv\opencv_contrib-4.4.0 /s /q +rmdir c:\opencv\opencv-4.5.0 /s /q +rmdir c:\opencv\opencv_contrib-4.5.0 /s /q chdir /D %GOPATH%\src\gocv.io\x\gocv