diff --git a/go.mod b/go.mod index fdf7d20..56339e5 100644 --- a/go.mod +++ b/go.mod @@ -8,5 +8,5 @@ require ( github.com/eclipse/paho.mqtt.golang v1.2.0 github.com/golang/protobuf v1.3.4 github.com/sirupsen/logrus v1.4.2 - gocv.io/x/gocv v0.21.0 + gocv.io/x/gocv v0.22.0 ) diff --git a/go.sum b/go.sum index b5fa33a..ca97d3b 100644 --- a/go.sum +++ b/go.sum @@ -98,24 +98,17 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/testcontainers/testcontainers-go v0.3.0/go.mod h1:br7bkzIukhPSIjy07Ma3OuXjjFvl2jm7CDU0LQNsqLw= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -gocv.io/x/gocv v0.21.0 h1:dVjagrupZrfCRY0qPEaYWgoNMRpBel6GYDH4mvQOK8Y= -gocv.io/x/gocv v0.21.0/go.mod h1:Rar2PS6DV+T4FL+PM535EImD/h13hGVaHhnCu1xarBs= +gocv.io/x/gocv v0.22.0/go.mod h1:7Ju5KbPo+R85evmlhhKPVMwXtgDRNX/PtfVfbToSrLU= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/gocv.io/x/gocv/.gitignore b/vendor/gocv.io/x/gocv/.gitignore index 9e3a6e0..7549fff 100644 --- a/vendor/gocv.io/x/gocv/.gitignore +++ b/vendor/gocv.io/x/gocv/.gitignore @@ -8,3 +8,4 @@ count.out .vscode/ /build .idea/ +contrib/data.yaml diff --git a/vendor/gocv.io/x/gocv/CHANGELOG.md b/vendor/gocv.io/x/gocv/CHANGELOG.md index 439b6d0..bf90513 100644 --- a/vendor/gocv.io/x/gocv/CHANGELOG.md +++ b/vendor/gocv.io/x/gocv/CHANGELOG.md @@ -1,3 +1,44 @@ +0.22.0 +--- +* **bgsegm** + * Add BackgroundSubtractorCNT +* **calib3d** + * Added undistort function (#520) +* **core** + * add functions (singular value decomposition, multiply between matrices, transpose matrix) (#559) + * Add new funcs (#578) + * add setIdentity() method to Mat + * add String method (#552) + * MatType: add missing constants +* **dnn** + * Adding GetLayerNames() + * respect the bit depth of the input image to set the expected output when converting an image to a blob +* **doc** + * change opencv version 3.x to 4.x +* **docker** + * use Go1.13.5 for image +* **imgcodecs** + * Fix webp image decode error (#523) +imgcodecs: optimize copy of data used for IMDecode method +* **imgproc** + * Add GetRectSubPix + * Added ClipLine + * Added InvertAffineTransform + * Added LinearPolar function (#524) + * correct ksize param used for MedianBlur unit test + * Feature/put text with line type (#527) + * FitEllipse + * In FillPoly and DrawContours functions, remove func() wrap to avoid memory freed before calling opencv functions. (#543) +* **objdetect** + * Add support QR codes +* **opencv** + * update to OpenCV 4.2.0 release +* **openvino** + * Add openvino async +* **test** + * Tolerate imprecise result in SolvePoly + * Tolerate imprecision in TestHoughLines + 0.21.0 --- * **build** diff --git a/vendor/gocv.io/x/gocv/Dockerfile b/vendor/gocv.io/x/gocv/Dockerfile index f51e9f2..36851b0 100644 --- a/vendor/gocv.io/x/gocv/Dockerfile +++ b/vendor/gocv.io/x/gocv/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.0.1" +ARG OPENCV_VERSION="4.2.0" ENV OPENCV_VERSION $OPENCV_VERSION RUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \ @@ -41,7 +41,7 @@ RUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSIO FROM opencv AS gocv LABEL maintainer="hybridgroup" -ARG GOVERSION="1.11.2" +ARG GOVERSION="1.13.5" ENV GOVERSION $GOVERSION RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/vendor/gocv.io/x/gocv/Makefile b/vendor/gocv.io/x/gocv/Makefile index 865e8c7..33a6140 100644 --- a/vendor/gocv.io/x/gocv/Makefile +++ b/vendor/gocv.io/x/gocv/Makefile @@ -2,7 +2,7 @@ .PHONY: test deps download build clean astyle cmds docker # OpenCV version to use. -OPENCV_VERSION?=4.1.2 +OPENCV_VERSION?=4.2.0 # Go version to use when building Docker image GOVERSION?=1.13.1 diff --git a/vendor/gocv.io/x/gocv/README.md b/vendor/gocv.io/x/gocv/README.md index be63e22..19ff531 100644 --- a/vendor/gocv.io/x/gocv/README.md +++ b/vendor/gocv.io/x/gocv/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.1.2) 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.2.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,25 +127,25 @@ 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.0.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.2.0 on your system. Here are instructions for Ubuntu, Raspian, macOS, and Windows. ## Ubuntu/Linux ### Installation -You can use `make` to install OpenCV 4.1.2 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.2.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.1.2 on Linux: +The following commands should do everything to download and install OpenCV 4.2.0 on Linux: cd $GOPATH/src/gocv.io/x/gocv make install If it works correctly, at the end of the entire process, the following message should be displayed: - gocv version: 0.21.0 - opencv lib version: 4.1.2 + gocv version: 0.22.0 + opencv lib version: 4.2.0 That's it, now you are ready to use GoCV. @@ -165,7 +165,7 @@ Next, you need to update the system, and install any required packages: #### Download source -Now, download the OpenCV 4.1.2 and OpenCV Contrib source code: +Now, download the OpenCV 4.2.0 and OpenCV Contrib source code: make download @@ -195,8 +195,8 @@ Now you should be able to build or run any of the examples: The version program should output the following: - gocv version: 0.21.0 - opencv lib version: 4.1.2 + gocv version: 0.22.0 + opencv lib version: 4.2.0 #### Cleanup extra files @@ -231,10 +231,10 @@ The project now provides `Dockerfile` which lets you build [GoCV](https://gocv.i make docker ``` -By default Docker image built by running the command above ships [Go](https://golang.org/) version `1.11.2`, but if you would like to build an image which uses different version of `Go` you can override the default value when running the target command: +By default Docker image built by running the command above ships [Go](https://golang.org/) version `1.13.5`, but if you would like to build an image which uses different version of `Go` you can override the default value when running the target command: ``` -make docker GOVERSION='1.11.1' +make docker GOVERSION='1.13.5' ``` #### Running GUI programs in Docker on macOS @@ -281,19 +281,19 @@ 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.1.2 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.2.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.1.2 on Raspbian: +The following commands should do everything to download and install OpenCV 4.2.0 on Raspbian: cd $GOPATH/src/gocv.io/x/gocv make install_raspi If it works correctly, at the end of the entire process, the following message should be displayed: - gocv version: 0.21.0 - opencv lib version: 4.1.2 + gocv version: 0.22.0 + opencv lib version: 4.2.0 That's it, now you are ready to use GoCV. @@ -301,22 +301,16 @@ That's it, now you are ready to use GoCV. ### Installation -You can install OpenCV 4.1.2 using Homebrew. +You can install OpenCV 4.2.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.1.2: +You can then install OpenCV 4.2.0: brew install opencv -If you prefer, there is also an alternative Homebrew recipe will install only OpenCV 4.1.2 without all of the Python dependencies: - - brew install hybridgroup/tools/opencv - -NOTE: Do not install both of these. Choose one. - ### pkgconfig Installation pkg-config is used to determine the correct flags for compiling and linking OpenCV. You can install it by using Homebrew: @@ -337,8 +331,8 @@ Now you should be able to build or run any of the examples: The version program should output the following: - gocv version: 0.21.0 - opencv lib version: 4.1.2 + gocv version: 0.22.0 + opencv lib version: 4.2.0 ### Cache builds @@ -353,8 +347,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.1.2/include" - export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/4.1.2/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.2.0/include" + export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/4.2.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: @@ -366,7 +360,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.1.2 on Windows, you must first download and install MinGW-W64 and CMake, as follows. +In order to build and install OpenCV 4.2.0 on Windows, you must first download and install MinGW-W64 and CMake, as follows. #### MinGW-W64 @@ -382,9 +376,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.1.2 and OpenCV Contrib Modules +#### OpenCV 4.2.0 and OpenCV Contrib Modules -The following commands should do everything to download and install OpenCV 4.1.2 on Windows: +The following commands should do everything to download and install OpenCV 4.2.0 on Windows: chdir %GOPATH%\src\gocv.io\x\gocv win_build_opencv.cmd @@ -405,8 +399,8 @@ Now you should be able to build or run any of the command examples: The version program should output the following: - gocv version: 0.21.0 - opencv lib version: 4.1.2 + gocv version: 0.22.0 + opencv lib version: 4.2.0 That's it, now you are ready to use GoCV. diff --git a/vendor/gocv.io/x/gocv/ROADMAP.md b/vendor/gocv.io/x/gocv/ROADMAP.md index 4a8a6a4..b917a34 100644 --- a/vendor/gocv.io/x/gocv/ROADMAP.md +++ b/vendor/gocv.io/x/gocv/ROADMAP.md @@ -25,8 +25,7 @@ Your pull requests will be greatly appreciated! - [ ] [randn](https://docs.opencv.org/master/d2/de8/group__core__array.html#gaeff1f61e972d133a04ce3a5f81cf6808) - [ ] [randShuffle](https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6a789c8a5cb56c6dd62506179808f763) - [ ] [randu](https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1ba1026dca0807b27057ba6a49d258c0) - - [ ] [scaleAdd](https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9e0845db4135f55dcf20227402f00d98) - - [ ] [setIdentity](https://docs.opencv.org/master/d2/de8/group__core__array.html#ga388d7575224a4a277ceb98ccaa327c99) + - [x] [setIdentity](https://docs.opencv.org/master/d2/de8/group__core__array.html#ga388d7575224a4a277ceb98ccaa327c99) - [ ] [setRNGSeed](https://docs.opencv.org/master/d2/de8/group__core__array.html#ga757e657c037410d9e19e819569e7de0f) - [ ] [SVBackSubst](https://docs.opencv.org/master/d2/de8/group__core__array.html#gab4e620e6fc6c8a27bb2be3d50a840c0b) - [ ] [SVDecomp](https://docs.opencv.org/master/d2/de8/group__core__array.html#gab477b5b7b39b370bb03e75b19d2d5109) @@ -54,11 +53,9 @@ Your pull requests will be greatly appreciated! - [ ] [convertMaps](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga9156732fa8f01be9ebd1a194f2728b7f) - [ ] [getAffineTransform](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga8f6d378f9f8eebb5cb55cd3ae295a999) - [ ] [getDefaultNewCameraMatrix](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga744529385e88ef7bc841cbe04b35bfbf) - - [ ] [getRectSubPix](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga77576d06075c1a4b6ba1a608850cd614) + - [X] [getRectSubPix](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga77576d06075c1a4b6ba1a608850cd614) - [ ] [initUndistortRectifyMap](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga7dfb72c9cf9780a347fbe3d1c47e5d5a) - [ ] [initWideAngleProjMap](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaceb049ec48898d1dadd5b50c604429c8) - - [ ] [invertAffineTransform](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga57d3505a878a7e1a636645727ca08f51) - - [ ] [linearPolar](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaa38a6884ac8b6e0b9bed47939b5362f3) - [ ] [undistort](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga69f2545a8b62a6b0fc2ee060dc30559d) - [ ] [undistortPoints](https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga55c716492470bfe86b0ee9bf3a1f0f7e) @@ -67,7 +64,7 @@ Your pull requests will be greatly appreciated! - [ ] [floodFill](https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#gaf1f55a048f8a45bc3383586e80b1f0d0) - [ ] **Drawing Functions - WORK STARTED** The following functions still need implementation: - - [ ] [clipLine](https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf483cb46ad6b049bc35ec67052ef1c2c) + - [X] [clipLine](https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf483cb46ad6b049bc35ec67052ef1c2c) - [ ] [drawMarker](https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga482fa7b0f578fcdd8a174904592a6250) - [ ] [ellipse2Poly](https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga727a72a3f6a625a2ae035f957c61051f) - [ ] [fillConvexPoly](https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga906aae1606ea4ed2f27bec1537f6c5c2) @@ -119,15 +116,71 @@ Your pull requests will be greatly appreciated! - [ ] [SparsePyrLKOpticalFlow](https://docs.opencv.org/master/d7/d08/classcv_1_1SparsePyrLKOpticalFlow.html) - [ ] **calib3d. Camera Calibration and 3D Reconstruction - WORK STARTED**. The following functions still need implementation: - - [ ] Camera Calibration + - [ ] **Camera Calibration - WORK STARTED** The following functions still need implementation: + - [ ] [calibrateCamera](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [calibrateCameraRO](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [calibrateHandEye](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [calibrationMatrixValues](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [checkChessboard](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [composeRT](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [computeCorrespondEpilines](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [convertPointsFromHomogeneous](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [convertPointsHomogeneous](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [convertPointsToHomogeneous](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [correctMatches](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [decomposeEssentialMat](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [decomposeHomographyMat](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [decomposeProjectionMatrix](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [drawChessboardCorners](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [drawFrameAxes](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [estimateAffine2D](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [estimateAffine3D](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [estimateAffinePartial2D](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [filterHomographyDecompByVisibleRefpoints](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [filterSpeckles](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [find4QuadCornerSubpix](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [findChessboardCorners](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [findChessboardCornersSB](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [findCirclesGrid](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [findEssentialMat](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [findFundamentalMat](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [findHomography](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [getDefaultNewCameraMatrix](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [getOptimalNewCameraMatrix](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [getValidDisparityROI](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [initCameraMatrix2D](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [initUndistortRectifyMap](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [initWideAngleProjMap](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [matMulDeriv](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [projectPoints](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [recoverPose](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [rectify3Collinear](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [reprojectImageTo3D](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [Rodrigues](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [RQDecomp3x3](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [sampsonDistance](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [solveP3P](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [solvePnP](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [solvePnPGeneric](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [solvePnPRansac](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [solvePnPRefineLM](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [solvePnPRefineVVS](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [stereoCalibrate](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [stereoRectify](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [stereoRectifyUncalibrated](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [triangulatePoints](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [x] [undistort](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [undistortPoints](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] [validateDisparity](https://docs.opencv.org/master/d9/d0c/group__calib3d.html) + - [ ] **Fisheye - WORK STARTED** The following functions still need implementation: - - [ ] [calibrate](https://docs.opencv.org/3.4.1/db/d58/group__calib3d__fisheye.html#gad626a78de2b1dae7489e152a5a5a89e1) - - [ ] [distortPoints](https://docs.opencv.org/3.4.1/db/d58/group__calib3d__fisheye.html#ga75d8877a98e38d0b29b6892c5f8d7765) - - [ ] [estimateNewCameraMatrixForUndistortRectify](https://docs.opencv.org/3.4.1/db/d58/group__calib3d__fisheye.html#ga384940fdf04c03e362e94b6eb9b673c9) - - [ ] [projectPoints](https://docs.opencv.org/3.4.1/db/d58/group__calib3d__fisheye.html#gab1ad1dc30c42ee1a50ce570019baf2c4) - - [ ] [stereoCalibrate](https://docs.opencv.org/3.4.1/db/d58/group__calib3d__fisheye.html#gadbb3a6ca6429528ef302c784df47949b) - - [ ] [stereoRectify](https://docs.opencv.org/3.4.1/db/d58/group__calib3d__fisheye.html#gac1af58774006689056b0f2ef1db55ecc) - - [ ] [undistortPoints](https://docs.opencv.org/3.4.1/db/d58/group__calib3d__fisheye.html#gab738cdf90ceee97b2b52b0d0e7511541) + - [ ] [calibrate](https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gad626a78de2b1dae7489e152a5a5a89e1) + - [ ] [distortPoints](https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#ga75d8877a98e38d0b29b6892c5f8d7765) + - [ ] [estimateNewCameraMatrixForUndistortRectify](https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#ga384940fdf04c03e362e94b6eb9b673c9) + - [ ] [projectPoints](https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gab1ad1dc30c42ee1a50ce570019baf2c4) + - [ ] [stereoCalibrate](https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gadbb3a6ca6429528ef302c784df47949b) + - [ ] [stereoRectify](https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gac1af58774006689056b0f2ef1db55ecc) + - [ ] [undistortPoints](https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gab738cdf90ceee97b2b52b0d0e7511541) - [ ] **features2d. 2D Features Framework - WORK STARTED** - [X] **Feature Detection and Description** @@ -176,7 +229,7 @@ Your pull requests will be greatly appreciated! ## Contrib modules list - [ ] aruco. ArUco Marker Detection -- [ ] bgsegm. Improved Background-Foreground Segmentation Methods +- [X] **bgsegm. Improved Background-Foreground Segmentation Methods - WORK STARTED** - [ ] bioinspired. Biologically inspired vision models and derivated tools - [ ] ccalib. Custom Calibration Pattern for 3D reconstruction - [ ] cnn_3dobj. 3D object recognition and pose estimation API diff --git a/vendor/gocv.io/x/gocv/appveyor_build_opencv.cmd b/vendor/gocv.io/x/gocv/appveyor_build_opencv.cmd index 5cea632..7813c25 100644 --- a/vendor/gocv.io/x/gocv/appveyor_build_opencv.cmd +++ b/vendor/gocv.io/x/gocv/appveyor_build_opencv.cmd @@ -2,22 +2,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.1.2.zip -FileName c:\opencv\opencv-4.1.2.zip -7z x c:\opencv\opencv-4.1.2.zip -oc:\opencv -y -del c:\opencv\opencv-4.1.2.zip /q -appveyor DownloadFile https://github.com/opencv/opencv_contrib/archive/4.1.2.zip -FileName c:\opencv\opencv_contrib-4.1.2.zip -7z x c:\opencv\opencv_contrib-4.1.2.zip -oc:\opencv -y -del c:\opencv\opencv_contrib-4.1.2.zip /q +appveyor DownloadFile https://github.com/opencv/opencv/archive/4.2.0.zip -FileName c:\opencv\opencv-4.2.0.zip +7z x c:\opencv\opencv-4.2.0.zip -oc:\opencv -y +del c:\opencv\opencv-4.2.0.zip /q +appveyor DownloadFile https://github.com/opencv/opencv_contrib/archive/4.2.0.zip -FileName c:\opencv\opencv_contrib-4.2.0.zip +7z x c:\opencv\opencv_contrib-4.2.0.zip -oc:\opencv -y +del c:\opencv\opencv_contrib-4.2.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-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin dir C:\opencv -cmake C:\opencv\opencv-4.1.2 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.1.2\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 -Wno-dev +cmake C:\opencv\opencv-4.2.0 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.2.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 -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.1.2 /s /q -rmdir c:\opencv\opencv_contrib-4.1.2 /s /q +rmdir c:\opencv\opencv-4.2.0 /s /q +rmdir c:\opencv\opencv_contrib-4.2.0 /s /q diff --git a/vendor/gocv.io/x/gocv/asyncarray.cpp b/vendor/gocv.io/x/gocv/asyncarray.cpp new file mode 100644 index 0000000..b457ff8 --- /dev/null +++ b/vendor/gocv.io/x/gocv/asyncarray.cpp @@ -0,0 +1,28 @@ +// +build openvino + +#include +#include "asyncarray.h" + + +// AsyncArray_New creates a new empty AsyncArray +AsyncArray AsyncArray_New() { + return new cv::AsyncArray(); +} + +// AsyncArray_Close deletes an existing AsyncArray +void AsyncArray_Close(AsyncArray a) { + delete a; +} + +const char* AsyncArray_GetAsync(AsyncArray async_out,Mat out) { + try { + async_out->get(*out); + } catch(cv::Exception ex) { + return ex.err.c_str(); + } + return ""; +} + +AsyncArray Net_forwardAsync(Net net, const char* outputName) { + return new cv::AsyncArray(net->forwardAsync(outputName)); +} diff --git a/vendor/gocv.io/x/gocv/asyncarray.go b/vendor/gocv.io/x/gocv/asyncarray.go new file mode 100644 index 0000000..345ec5e --- /dev/null +++ b/vendor/gocv.io/x/gocv/asyncarray.go @@ -0,0 +1,52 @@ +// +build openvino + +package gocv + +import ( + "errors" +) + +/* +#include +#include "dnn.h" +#include "asyncarray.h" +#include "core.h" +*/ +import "C" + +type AsyncArray struct { + p C.AsyncArray +} + +// NewAsyncArray returns a new empty AsyncArray. +func NewAsyncArray() AsyncArray { + return newAsyncArray(C.AsyncArray_New()) +} + +// Ptr returns the AsyncArray's underlying object pointer. +func (a *AsyncArray) Ptr() C.AsyncArray { + return a.p +} + +// Get async returns the Mat +func (m *AsyncArray) Get(mat *Mat) error { + result := C.AsyncArray_GetAsync(m.p, mat.p) + err := C.GoString(result) + + if len(err) > 0 { + return errors.New(err) + } + return nil +} + +// newAsyncArray returns a new AsyncArray from a C AsyncArray +func newAsyncArray(p C.AsyncArray) AsyncArray { + return AsyncArray{p: p} +} + +// Close the AsyncArray object. +func (a *AsyncArray) Close() error { + C.AsyncArray_Close(a.p) + a.p = nil + return nil +} diff --git a/vendor/gocv.io/x/gocv/asyncarray.h b/vendor/gocv.io/x/gocv/asyncarray.h new file mode 100644 index 0000000..cf894b6 --- /dev/null +++ b/vendor/gocv.io/x/gocv/asyncarray.h @@ -0,0 +1,23 @@ +#ifdef __cplusplus +#include +extern "C" { +#endif + +#include "core.h" +#include "dnn.h" + +#ifdef __cplusplus +typedef cv::AsyncArray* AsyncArray; +#else +typedef void* AsyncArray; +#endif + +AsyncArray AsyncArray_New(); +const char* AsyncArray_GetAsync(AsyncArray async_out,Mat out); +void AsyncArray_Close(AsyncArray a); +AsyncArray Net_forwardAsync(Net net, const char* outputName); + + +#ifdef __cplusplus +} +#endif diff --git a/vendor/gocv.io/x/gocv/calib3d.cpp b/vendor/gocv.io/x/gocv/calib3d.cpp index 5428cb3..9a3edbd 100644 --- a/vendor/gocv.io/x/gocv/calib3d.cpp +++ b/vendor/gocv.io/x/gocv/calib3d.cpp @@ -27,3 +27,7 @@ Mat GetOptimalNewCameraMatrixWithParams(Mat cameraMatrix,Mat distCoeffs,Size siz return mat; } +void Undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix) { + cv::undistort(*src, *dst, *cameraMatrix, *distCoeffs, *newCameraMatrix); +} + diff --git a/vendor/gocv.io/x/gocv/calib3d.go b/vendor/gocv.io/x/gocv/calib3d.go index 222be07..3246933 100644 --- a/vendor/gocv.io/x/gocv/calib3d.go +++ b/vendor/gocv.io/x/gocv/calib3d.go @@ -97,3 +97,7 @@ func GetOptimalNewCameraMatrixWithParams(cameraMatrix Mat, distCoeffs Mat, image rt := C.struct_Rect{} return newMat(C.GetOptimalNewCameraMatrixWithParams(cameraMatrix.Ptr(), distCoeffs.Ptr(), sz, C.double(alpha), newSize, &rt, C.bool(centerPrincipalPoint))), toRect(rt) } + +func Undistort(src Mat, dst *Mat, cameraMatrix Mat, distCoeffs Mat, newCameraMatrix Mat) { + C.Undistort(src.Ptr(), dst.Ptr(), cameraMatrix.Ptr(), distCoeffs.Ptr(), newCameraMatrix.Ptr()) +} diff --git a/vendor/gocv.io/x/gocv/calib3d.h b/vendor/gocv.io/x/gocv/calib3d.h index 31b5250..f93918f 100644 --- a/vendor/gocv.io/x/gocv/calib3d.h +++ b/vendor/gocv.io/x/gocv/calib3d.h @@ -17,7 +17,7 @@ void Fisheye_UndistortImageWithParams(Mat distorted, Mat undistorted, Mat k, Mat void InitUndistortRectifyMap(Mat cameraMatrix,Mat distCoeffs,Mat r,Mat newCameraMatrix,Size size,int m1type,Mat map1,Mat map2); Mat GetOptimalNewCameraMatrixWithParams(Mat cameraMatrix,Mat distCoeffs,Size size,double alpha,Size newImgSize,Rect* validPixROI,bool centerPrincipalPoint); - +void Undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix); #ifdef __cplusplus } #endif diff --git a/vendor/gocv.io/x/gocv/calib3d_string.go b/vendor/gocv.io/x/gocv/calib3d_string.go new file mode 100644 index 0000000..baa5451 --- /dev/null +++ b/vendor/gocv.io/x/gocv/calib3d_string.go @@ -0,0 +1,27 @@ +package gocv + +func (c CalibFlag) String() string { + switch c { + case CalibUseIntrinsicGuess: + return "calib-use-intrinsec-guess" + case CalibRecomputeExtrinsic: + return "calib-recompute-extrinsic" + case CalibCheckCond: + return "calib-check-cond" + case CalibFixSkew: + return "calib-fix-skew" + case CalibFixK1: + return "calib-fix-k1" + case CalibFixK2: + return "calib-fix-k2" + case CalibFixK3: + return "calib-fix-k3" + case CalibFixK4: + return "calib-fix-k4" + case CalibFixIntrinsic: + return "calib-fix-intrinsic" + case CalibFixPrincipalPoint: + return "calib-fix-principal-point" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/cgo.go b/vendor/gocv.io/x/gocv/cgo.go index a886502..8862cb0 100644 --- a/vendor/gocv.io/x/gocv/cgo.go +++ b/vendor/gocv.io/x/gocv/cgo.go @@ -8,6 +8,6 @@ package gocv #cgo !windows pkg-config: opencv4 #cgo CXXFLAGS: --std=c++11 #cgo windows CPPFLAGS: -IC:/opencv/build/install/include -#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core412 -lopencv_face412 -lopencv_videoio412 -lopencv_imgproc412 -lopencv_highgui412 -lopencv_imgcodecs412 -lopencv_objdetect412 -lopencv_features2d412 -lopencv_video412 -lopencv_dnn412 -lopencv_xfeatures2d412 -lopencv_plot412 -lopencv_tracking412 -lopencv_img_hash412 -lopencv_calib3d412 +#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core420 -lopencv_face420 -lopencv_videoio420 -lopencv_imgproc420 -lopencv_highgui420 -lopencv_imgcodecs420 -lopencv_objdetect420 -lopencv_features2d420 -lopencv_video420 -lopencv_dnn420 -lopencv_xfeatures2d420 -lopencv_plot420 -lopencv_tracking420 -lopencv_img_hash420 -lopencv_calib3d420 */ import "C" diff --git a/vendor/gocv.io/x/gocv/codecov.yml b/vendor/gocv.io/x/gocv/codecov.yml new file mode 100644 index 0000000..f608620 --- /dev/null +++ b/vendor/gocv.io/x/gocv/codecov.yml @@ -0,0 +1,3 @@ +ignore: + - "*_string.go" + - "*/*_string.go" diff --git a/vendor/gocv.io/x/gocv/core.cpp b/vendor/gocv.io/x/gocv/core.cpp index ab05ac1..2d312f2 100644 --- a/vendor/gocv.io/x/gocv/core.cpp +++ b/vendor/gocv.io/x/gocv/core.cpp @@ -323,6 +323,14 @@ void Mat_DivideFloat(Mat m, float val) { *m /= val; } +Mat Mat_MultiplyMatrix(Mat x, Mat y) { + return new cv::Mat((*x) * (*y)); +} + +Mat Mat_T(Mat x) { + return new cv::Mat(x->t()); +} + void Mat_AbsDiff(Mat src1, Mat src2, Mat dst) { cv::absdiff(*src1, *src2, *dst); } @@ -602,6 +610,10 @@ void Mat_ScaleAdd(Mat src1, double alpha, Mat src2, Mat dst) { cv::scaleAdd(*src1, alpha, *src2, *dst); } +void Mat_SetIdentity(Mat src, double scalar) { + cv::setIdentity(*src, scalar); +} + void Mat_Sort(Mat src, Mat dst, int flags) { cv::sort(*src, *dst, flags); } @@ -740,3 +752,12 @@ int64 GetCVTickCount() { double GetTickFrequency() { return cv::getTickFrequency(); } + +Mat Mat_rowRange(Mat m,int startrow,int endrow) { + return new cv::Mat(m->rowRange(startrow,endrow)); +} + +Mat Mat_colRange(Mat m,int startrow,int endrow) { + return new cv::Mat(m->colRange(startrow,endrow)); +} + diff --git a/vendor/gocv.io/x/gocv/core.go b/vendor/gocv.io/x/gocv/core.go index 87e9695..031be3c 100644 --- a/vendor/gocv.io/x/gocv/core.go +++ b/vendor/gocv.io/x/gocv/core.go @@ -66,6 +66,75 @@ const ( // MatTypeCV8UC4 is a Mat of 8-bit unsigned int with 4 channels MatTypeCV8UC4 = MatTypeCV8U + MatChannels4 + + // MatTypeCV8SC1 is a Mat of 8-bit signed int with a single channel + MatTypeCV8SC1 = MatTypeCV8S + MatChannels1 + + // MatTypeCV8SC2 is a Mat of 8-bit signed int with 2 channels + MatTypeCV8SC2 = MatTypeCV8S + MatChannels2 + + // MatTypeCV8SC3 is a Mat of 8-bit signed int with 3 channels + MatTypeCV8SC3 = MatTypeCV8S + MatChannels3 + + // MatTypeCV8SC4 is a Mat of 8-bit signed int with 4 channels + MatTypeCV8SC4 = MatTypeCV8S + MatChannels4 + + // MatTypeCV16UC1 is a Mat of 16-bit unsigned int with a single channel + MatTypeCV16UC1 = MatTypeCV16U + MatChannels1 + + // MatTypeCV16UC2 is a Mat of 16-bit unsigned int with 2 channels + MatTypeCV16UC2 = MatTypeCV16U + MatChannels2 + + // MatTypeCV16UC3 is a Mat of 16-bit unsigned int with 3 channels + MatTypeCV16UC3 = MatTypeCV16U + MatChannels3 + + // MatTypeCV16UC4 is a Mat of 16-bit unsigned int with 4 channels + MatTypeCV16UC4 = MatTypeCV16U + MatChannels4 + + // MatTypeCV16SC1 is a Mat of 16-bit signed int with a single channel + MatTypeCV16SC1 = MatTypeCV16S + MatChannels1 + + // MatTypeCV16SC3 is a Mat of 16-bit signed int with 3 channels + MatTypeCV16SC3 = MatTypeCV16S + MatChannels3 + + // MatTypeCV16SC4 is a Mat of 16-bit signed int with 4 channels + MatTypeCV16SC4 = MatTypeCV16S + MatChannels4 + + // MatTypeCV32SC1 is a Mat of 32-bit signed int with a single channel + MatTypeCV32SC1 = MatTypeCV32S + MatChannels1 + + // MatTypeCV32SC2 is a Mat of 32-bit signed int with 2 channels + MatTypeCV32SC2 = MatTypeCV32S + MatChannels2 + + // MatTypeCV32SC3 is a Mat of 32-bit signed int with 3 channels + MatTypeCV32SC3 = MatTypeCV32S + MatChannels3 + + // MatTypeCV32SC4 is a Mat of 32-bit signed int with 4 channels + MatTypeCV32SC4 = MatTypeCV32S + MatChannels4 + + // MatTypeCV32FC1 is a Mat of 32-bit float int with a single channel + MatTypeCV32FC1 = MatTypeCV32F + MatChannels1 + + // MatTypeCV32FC2 is a Mat of 32-bit float int with 2 channels + MatTypeCV32FC2 = MatTypeCV32F + MatChannels2 + + // MatTypeCV32FC3 is a Mat of 32-bit float int with 3 channels + MatTypeCV32FC3 = MatTypeCV32F + MatChannels3 + + // MatTypeCV32FC4 is a Mat of 32-bit float int with 4 channels + MatTypeCV32FC4 = MatTypeCV32F + MatChannels4 + + // MatTypeCV64FC1 is a Mat of 64-bit float int with a single channel + MatTypeCV64FC1 = MatTypeCV64F + MatChannels1 + + // MatTypeCV64FC2 is a Mat of 64-bit float int with 2 channels + MatTypeCV64FC2 = MatTypeCV64F + MatChannels2 + + // MatTypeCV64FC3 is a Mat of 64-bit float int with 3 channels + MatTypeCV64FC3 = MatTypeCV64F + MatChannels3 + + // MatTypeCV64FC4 is a Mat of 64-bit float int with 4 channels + MatTypeCV64FC4 = MatTypeCV64F + MatChannels4 ) // CompareType is used for Compare operations to indicate which kind of @@ -659,6 +728,17 @@ func (m *Mat) DivideFloat(val float32) { C.Mat_DivideFloat(m.p, C.float(val)) } +// MultiplyMatrix multiplies matrix (m*x) +func (m *Mat) MultiplyMatrix(x Mat) Mat { + return newMat(C.Mat_MultiplyMatrix(m.p, x.p)) +} + +// T transpose matrix +// https://docs.opencv.org/4.1.2/d3/d63/classcv_1_1Mat.html#aaa428c60ccb6d8ea5de18f63dfac8e11 +func (m *Mat) T() Mat { + return newMat(C.Mat_T(m.p)) +} + // ToImage converts a Mat to a image.Image. func (m *Mat) ToImage() (image.Image, error) { t := m.Type() @@ -1587,6 +1667,14 @@ func ScaleAdd(src1 Mat, alpha float64, src2 Mat, dst *Mat) { C.Mat_ScaleAdd(src1.p, C.double(alpha), src2.p, dst.p) } +// SetIdentity initializes a scaled identity matrix. +// For further details, please see: +// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga388d7575224a4a277ceb98ccaa327c99 +// +func SetIdentity(src Mat, scalar float64) { + C.Mat_SetIdentity(src.p, C.double(scalar)) +} + type SortFlags int const ( @@ -1867,3 +1955,21 @@ func toCStrings(strs []string) C.struct_CStrings { length: C.int(len(strs)), } } + +// RowRange creates a matrix header for the specified row span. +// +// For further details, please see: +// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa6542193430356ad631a9beabc624107 +// +func (m *Mat) RowRange(start, end int) Mat { + return newMat(C.Mat_rowRange(m.p, C.int(start), C.int(end))) +} + +// ColRange creates a matrix header for the specified column span. +// +// For further details, please see: +// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aadc8f9210fe4dec50513746c246fa8d9 +// +func (m *Mat) ColRange(start, end int) Mat { + return newMat(C.Mat_colRange(m.p, C.int(start), C.int(end))) +} diff --git a/vendor/gocv.io/x/gocv/core.h b/vendor/gocv.io/x/gocv/core.h index a0fa61f..0a8a50f 100644 --- a/vendor/gocv.io/x/gocv/core.h +++ b/vendor/gocv.io/x/gocv/core.h @@ -285,6 +285,9 @@ void Mat_AddFloat(Mat m, float val); void Mat_SubtractFloat(Mat m, float val); void Mat_MultiplyFloat(Mat m, float val); void Mat_DivideFloat(Mat m, float val); +Mat Mat_MultiplyMatrix(Mat x, Mat y); + +Mat Mat_T(Mat x); void LUT(Mat src, Mat lut, Mat dst); @@ -354,6 +357,7 @@ double Mat_SolvePoly(Mat coeffs, Mat roots, int maxIters); void Mat_Reduce(Mat src, Mat dst, int dim, int rType, int dType); void Mat_Repeat(Mat src, int nY, int nX, Mat dst); void Mat_ScaleAdd(Mat src1, double alpha, Mat src2, Mat dst); +void Mat_SetIdentity(Mat src, double scalar); void Mat_Sort(Mat src, Mat dst, int flags); void Mat_SortIdx(Mat src, Mat dst, int flags); void Mat_Split(Mat src, struct Mats* mats); @@ -371,6 +375,9 @@ TermCriteria TermCriteria_New(int typ, int maxCount, double epsilon); int64_t GetCVTickCount(); double GetTickFrequency(); +Mat Mat_rowRange(Mat m,int startrow,int endrow); +Mat Mat_colRange(Mat m,int startrow,int endrow); + #ifdef __cplusplus } #endif diff --git a/vendor/gocv.io/x/gocv/core_string.go b/vendor/gocv.io/x/gocv/core_string.go new file mode 100644 index 0000000..39d5d22 --- /dev/null +++ b/vendor/gocv.io/x/gocv/core_string.go @@ -0,0 +1,211 @@ +package gocv + +func (c MatType) String() string { + switch c { + case MatTypeCV8U: + return "CV8U" + case MatTypeCV8UC2: + return "CV8UC2" + case MatTypeCV8UC3: + return "CV8UC3" + case MatTypeCV8UC4: + return "CV8UC4" + case MatTypeCV16U: + return "CV16U" + case MatTypeCV16UC2: + return "CV16UC2" + case MatTypeCV16UC3: + return "CV16UC3" + case MatTypeCV16UC4: + return "CV16UC4" + case MatTypeCV16S: + return "CV16S" + case MatTypeCV16SC2: + return "CV16SC2" + case MatTypeCV16SC3: + return "CV16SC3" + case MatTypeCV16SC4: + return "CV16SC4" + case MatTypeCV32S: + return "CV32S" + case MatTypeCV32SC2: + return "CV32SC2" + case MatTypeCV32SC3: + return "CV32SC3" + case MatTypeCV32SC4: + return "CV32SC4" + case MatTypeCV32F: + return "CV32F" + case MatTypeCV32FC2: + return "CV32FC2" + case MatTypeCV32FC3: + return "CV32FC3" + case MatTypeCV32FC4: + return "CV32FC4" + case MatTypeCV64F: + return "CV64F" + case MatTypeCV64FC2: + return "CV64FC2" + case MatTypeCV64FC3: + return "CV64FC3" + case MatTypeCV64FC4: + return "CV64FC4" + } + return "" +} + +func (c CompareType) String() string { + switch c { + case CompareEQ: + return "eq" + case CompareGT: + return "gt" + case CompareGE: + return "ge" + case CompareLT: + return "lt" + case CompareLE: + return "le" + case CompareNE: + return "ne" + } + return "" +} + +func (c CovarFlags) String() string { + switch c { + case CovarScrambled: + return "covar-scrambled" + case CovarNormal: + return "covar-normal" + case CovarUseAvg: + return "covar-use-avg" + case CovarScale: + return "covar-scale" + case CovarRows: + return "covar-rows" + case CovarCols: + return "covar-cols" + } + return "" +} + +func (c DftFlags) String() string { + switch c { + case DftForward: + return "dft-forward" + case DftInverse: + return "dft-inverse" + case DftScale: + return "dft-scale" + case DftRows: + return "dft-rows" + case DftComplexOutput: + return "dft-complex-output" + case DftRealOutput: + return "dft-real-output" + case DftComplexInput: + return "dft-complex-input" + } + return "" +} + +func (c RotateFlag) String() string { + switch c { + case Rotate90Clockwise: + return "rotate-90-clockwise" + case Rotate180Clockwise: + return "rotate-180-clockwise" + case Rotate90CounterClockwise: + return "rotate-90-counter-clockwise" + } + return "" +} + +func (c KMeansFlags) String() string { + switch c { + case KMeansRandomCenters: + return "kmeans-random-centers" + case KMeansPPCenters: + return "kmeans-pp-centers" + case KMeansUseInitialLabels: + return "kmeans-use-initial-labels" + } + return "" +} + +func (c NormType) String() string { + switch c { + case NormInf: + return "norm-inf" + case NormL1: + return "norm-l1" + case NormL2: + return "norm-l2" + case NormL2Sqr: + return "norm-l2-sqr" + case NormHamming: + return "norm-hamming" + case NormHamming2: + return "norm-hamming2" + case NormRelative: + return "norm-relative" + case NormMinMax: + return "norm-minmax" + } + return "" +} + +func (c TermCriteriaType) String() string { + switch c { + case Count: + return "count" + case EPS: + return "eps" + } + return "" +} + +func (c SolveDecompositionFlags) String() string { + switch c { + case SolveDecompositionLu: + return "solve-decomposition-lu" + case SolveDecompositionSvd: + return "solve-decomposition-svd" + case SolveDecompositionEing: + return "solve-decomposition-eing" + case SolveDecompositionCholesky: + return "solve-decomposition-cholesky" + case SolveDecompositionQr: + return "solve-decomposition-qr" + case SolveDecompositionNormal: + return "solve-decomposition-normal" + } + return "" +} + +func (c ReduceTypes) String() string { + switch c { + case ReduceSum: + return "reduce-sum" + case ReduceAvg: + return "reduce-avg" + case ReduceMax: + return "reduce-max" + case ReduceMin: + return "reduce-min" + } + return "" +} + +func (c SortFlags) String() string { + switch c { + case SortEveryRow: + return "sort-every-row" + case SortEveryColumn: + return "sort-every-column" + case SortDescending: + return "sort-descending" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/dnn.cpp b/vendor/gocv.io/x/gocv/dnn.cpp index 25ef502..3885546 100644 --- a/vendor/gocv.io/x/gocv/dnn.cpp +++ b/vendor/gocv.io/x/gocv/dnn.cpp @@ -94,13 +94,33 @@ void Net_GetUnconnectedOutLayers(Net net, IntVector* res) { return; } +void Net_GetLayerNames(Net net, CStrings* names) { + std::vector< cv::String > cstrs(net->getLayerNames()); + const char **strs = new const char*[cstrs.size()]; + + for (size_t i = 0; i < cstrs.size(); ++i) { + strs[i] = cstrs[i].c_str(); + } + + names->length = cstrs.size(); + names->strs = strs; + return; +} + Mat Net_BlobFromImage(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB, bool crop) { cv::Size sz(size.width, size.height); - cv::Scalar cm = cv::Scalar(mean.val1, mean.val2, mean.val3, mean.val4); - // TODO: handle different version signatures of this function v2 vs v3. - return new cv::Mat(cv::dnn::blobFromImage(*image, scalefactor, sz, cm, swapRB, crop)); + // set the output ddepth to the input image depth + int ddepth = image->depth(); + if (ddepth == CV_8U) + { + // no scalar mean adjustment allowed, so ignore + return new cv::Mat(cv::dnn::blobFromImage(*image, scalefactor, sz, NULL, swapRB, crop, ddepth)); + } + + cv::Scalar cm(mean.val1, mean.val2, mean.val3, mean.val4); + return new cv::Mat(cv::dnn::blobFromImage(*image, scalefactor, sz, cm, swapRB, crop, ddepth)); } void Net_BlobFromImages(struct Mats images, Mat blob, double scalefactor, Size size, diff --git a/vendor/gocv.io/x/gocv/dnn.go b/vendor/gocv.io/x/gocv/dnn.go index 8165ebe..97374d9 100644 --- a/vendor/gocv.io/x/gocv/dnn.go +++ b/vendor/gocv.io/x/gocv/dnn.go @@ -410,6 +410,28 @@ func (net *Net) GetUnconnectedOutLayers() (ids []int) { return } +// GetLayerNames returns all layer names. +// +// For furtherdetails, please see: +// https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#ae8be9806024a0d1d41aba687cce99e6b +// +func (net *Net) GetLayerNames() (names []string) { + cstrs := C.CStrings{} + C.Net_GetLayerNames((C.Net)(net.p), &cstrs) + + h := &reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cstrs.strs)), + Len: int(cstrs.length), + Cap: int(cstrs.length), + } + pcstrs := *(*[]string)(unsafe.Pointer(h)) + + for i := 0; i < int(cstrs.length); i++ { + names = append(names, string(pcstrs[i])) + } + return +} + // Close Layer func (l *Layer) Close() error { C.Layer_Close((C.Layer)(l.p)) diff --git a/vendor/gocv.io/x/gocv/dnn.h b/vendor/gocv.io/x/gocv/dnn.h index 7112a4d..7f85842 100644 --- a/vendor/gocv.io/x/gocv/dnn.h +++ b/vendor/gocv.io/x/gocv/dnn.h @@ -39,6 +39,7 @@ void Net_SetPreferableBackend(Net net, int backend); void Net_SetPreferableTarget(Net net, int target); int64_t Net_GetPerfProfile(Net net); void Net_GetUnconnectedOutLayers(Net net, IntVector* res); +void Net_GetLayerNames(Net net, CStrings* names); Mat Net_GetBlobChannel(Mat blob, int imgidx, int chnidx); Scalar Net_GetBlobSize(Mat blob); diff --git a/vendor/gocv.io/x/gocv/dnn_async_openvino.go b/vendor/gocv.io/x/gocv/dnn_async_openvino.go new file mode 100644 index 0000000..0425d99 --- /dev/null +++ b/vendor/gocv.io/x/gocv/dnn_async_openvino.go @@ -0,0 +1,26 @@ +// +build openvino + +package gocv + +import ( + "unsafe" +) + +/* +#include +#include "dnn.h" +#include "asyncarray.h" +*/ +import "C" + +// ForwardAsync runs forward pass to compute output of layer with name outputName. +// +// For further details, please see: +// https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a814890154ea9e10b132fec00b6f6ba30 +// +func (net *Net) ForwardAsync(outputName string) AsyncArray { + cName := C.CString(outputName) + defer C.free(unsafe.Pointer(cName)) + + return newAsyncArray(C.Net_forwardAsync((C.Net)(net.p), cName)) +} diff --git a/vendor/gocv.io/x/gocv/dnn_string.go b/vendor/gocv.io/x/gocv/dnn_string.go new file mode 100644 index 0000000..ac42d8d --- /dev/null +++ b/vendor/gocv.io/x/gocv/dnn_string.go @@ -0,0 +1,35 @@ +package gocv + +func (c NetBackendType) String() string { + switch c { + case NetBackendDefault: + return "" + case NetBackendHalide: + return "halide" + case NetBackendOpenVINO: + return "openvino" + case NetBackendOpenCV: + return "opencv" + case NetBackendVKCOM: + return "vulkan" + } + return "" +} + +func (c NetTargetType) String() string { + switch c { + case NetTargetCPU: + return "cpu" + case NetTargetFP32: + return "fp32" + case NetTargetFP16: + return "fp16" + case NetTargetVPU: + return "vpu" + case NetTargetVulkan: + return "vulkan" + case NetTargetFPGA: + return "fpga" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/features2d_string.go b/vendor/gocv.io/x/gocv/features2d_string.go new file mode 100644 index 0000000..21637c6 --- /dev/null +++ b/vendor/gocv.io/x/gocv/features2d_string.go @@ -0,0 +1,33 @@ +package gocv + +/* +#include +#include "features2d.h" +*/ +import "C" + +func (c FastFeatureDetectorType) String() string { + switch c { + case FastFeatureDetectorType58: + return "fast-feature-detector-type-58" + case FastFeatureDetectorType712: + return "fast-feature-detector-type-712" + case FastFeatureDetectorType916: + return "fast-feature-detector-type-916" + } + return "" +} + +func (c DrawMatchesFlag) String() string { + switch c { + case DrawDefault: + return "draw-default" + case DrawOverOutImg: + return "draw-over-out-imt" + case NotDrawSinglePoints: + return "draw-single-points" + case DrawRichKeyPoints: + return "draw-rich-key-points" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/go.mod b/vendor/gocv.io/x/gocv/go.mod index acb0abc..c00a082 100644 --- a/vendor/gocv.io/x/gocv/go.mod +++ b/vendor/gocv.io/x/gocv/go.mod @@ -1,3 +1,3 @@ module gocv.io/x/gocv -go 1.13 +go 1.13 \ No newline at end of file diff --git a/vendor/gocv.io/x/gocv/gocv.go b/vendor/gocv.io/x/gocv/gocv.go index 5d71b14..c3b0126 100644 --- a/vendor/gocv.io/x/gocv/gocv.go +++ b/vendor/gocv.io/x/gocv/gocv.go @@ -1,4 +1,4 @@ -// Package gocv is a wrapper around the OpenCV 3.x computer vision library. +// Package gocv is a wrapper around the OpenCV 4.x computer vision library. // It provides a Go language interface to the latest version of OpenCV. // // OpenCV (Open Source Computer Vision Library: http://opencv.org) is an diff --git a/vendor/gocv.io/x/gocv/highgui_string.go b/vendor/gocv.io/x/gocv/highgui_string.go new file mode 100644 index 0000000..d073bbe --- /dev/null +++ b/vendor/gocv.io/x/gocv/highgui_string.go @@ -0,0 +1,35 @@ +package gocv + +/* +#include +#include "highgui_gocv.h" +*/ +import "C" + +func (c WindowFlag) String() string { + switch c { + case WindowNormal: + return "window-normal" + case WindowFullscreen: + return "window-fullscreen" + case WindowFreeRatio: + return "window-free-ratio" + } + return "" +} + +func (c WindowPropertyFlag) String() string { + switch c { + case WindowPropertyFullscreen: + return "window-property-fullscreen" + case WindowPropertyAutosize: + return "window-property-autosize" + case WindowPropertyAspectRatio: + return "window-property-aspect-ratio" + case WindowPropertyOpenGL: + return "window-property-opengl" + case WindowPropertyVisible: + return "window-property-visible" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/imgcodecs.cpp b/vendor/gocv.io/x/gocv/imgcodecs.cpp index 47886d8..1f3afe5 100644 --- a/vendor/gocv.io/x/gocv/imgcodecs.cpp +++ b/vendor/gocv.io/x/gocv/imgcodecs.cpp @@ -40,12 +40,7 @@ struct ByteArray Image_IMEncode_WithParams(const char* fileExt, Mat img, IntVect } Mat Image_IMDecode(ByteArray buf, int flags) { - std::vector data; - - for (size_t i = 0; i < buf.length; i++) { - data.push_back(buf.data[i]); - } - + std::vector data(buf.data, buf.data + buf.length); cv::Mat img = cv::imdecode(data, flags); return new cv::Mat(img); } diff --git a/vendor/gocv.io/x/gocv/imgproc.cpp b/vendor/gocv.io/x/gocv/imgproc.cpp index b49bf40..77b1697 100644 --- a/vendor/gocv.io/x/gocv/imgproc.cpp +++ b/vendor/gocv.io/x/gocv/imgproc.cpp @@ -95,6 +95,28 @@ double CompareHist(Mat hist1, Mat hist2, int method) { return cv::compareHist(*hist1, *hist2, method); } +struct RotatedRect FitEllipse(Points points) +{ + Point *rpts = new Point[points.length]; + std::vector pts; + + for (size_t i = 0; i < points.length; i++) + { + pts.push_back(cv::Point(points.points[i].x, points.points[i].y)); + Point pt = {points.points[i].x, points.points[i].y}; + rpts[i] = pt; + } + + cv::RotatedRect bRect = cv::fitEllipse(pts); + + Rect r = {bRect.boundingRect().x, bRect.boundingRect().y, bRect.boundingRect().width, bRect.boundingRect().height}; + Point centrpt = {int(lroundf(bRect.center.x)), int(lroundf(bRect.center.y))}; + Size szsz = {int(lroundf(bRect.size.width)), int(lroundf(bRect.size.height))}; + + RotatedRect rotRect = {(Contour){rpts, 4}, r, centrpt, szsz, bRect.angle}; + return rotRect; +} + void ConvexHull(Contour points, Mat hull, bool clockwise, bool returnPoints) { std::vector pts; @@ -377,6 +399,14 @@ void ArrowedLine(Mat img, Point pt1, Point pt2, Scalar color, int thickness) { cv::arrowedLine(*img, p1, p2, c, thickness); } +bool ClipLine(Size imgSize, Point pt1, Point pt2) { + cv::Size sz(imgSize.width, imgSize.height); + cv::Point p1(pt1.x, pt1.y); + cv::Point p2(pt2.x, pt2.y); + + return cv::clipLine(sz, p1, p2); +} + void Circle(Mat img, Point center, int radius, Scalar color, int thickness) { cv::Point p1(center.x, center.y); cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4); @@ -446,11 +476,24 @@ void PutText(Mat img, const char* text, Point org, int fontFace, double fontScal cv::putText(*img, text, pt, fontFace, fontScale, c, thickness); } +void PutTextWithParams(Mat img, const char* text, Point org, int fontFace, double fontScale, + Scalar color, int thickness, int lineType, bool bottomLeftOrigin) { + cv::Point pt(org.x, org.y); + cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4); + cv::putText(*img, text, pt, fontFace, fontScale, c, thickness, lineType, bottomLeftOrigin); +} + void Resize(Mat src, Mat dst, Size dsize, double fx, double fy, int interp) { cv::Size sz(dsize.width, dsize.height); cv::resize(*src, *dst, sz, fx, fy, interp); } +void GetRectSubPix(Mat src, Size patchSize, Point center, Mat dst) { + cv::Size sz(patchSize.width, patchSize.height); + cv::Point pt(center.x, center.y); + cv::getRectSubPix(*src, sz, pt, *dst); +} + Mat GetRotationMatrix2D(Point center, double angle, double scale) { cv::Point pt(center.x, center.y); return new cv::Mat(cv::getRotationMatrix2D(pt, angle, scale)); @@ -557,6 +600,11 @@ void FitLine(Contour points, Mat line, int distType, double param, double reps, cv::fitLine(pts, *line, distType, param, reps, aeps); } +void LinearPolar(Mat src, Mat dst, Point center, double maxRadius, int flags) { + cv::Point2f centerPt(center.x, center.y); + cv::linearPolar(*src, *dst, centerPt, maxRadius, flags); +} + CLAHE CLAHE_Create() { return new cv::Ptr(cv::createCLAHE()); } @@ -573,3 +621,7 @@ void CLAHE_Close(CLAHE c) { void CLAHE_Apply(CLAHE c, Mat src, Mat dst) { (*c)->apply(*src, *dst); } + +void InvertAffineTransform(Mat src, Mat dst) { + cv::invertAffineTransform(*src, *dst); +} diff --git a/vendor/gocv.io/x/gocv/imgproc.go b/vendor/gocv.io/x/gocv/imgproc.go index b3cc6ec..7102ab1 100644 --- a/vendor/gocv.io/x/gocv/imgproc.go +++ b/vendor/gocv.io/x/gocv/imgproc.go @@ -204,6 +204,29 @@ func CompareHist(hist1 Mat, hist2 Mat, method HistCompMethod) float32 { return float32(C.CompareHist(hist1.p, hist2.p, C.int(method))) } +// ClipLine clips the line against the image rectangle. +// For further details, please see: +// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf483cb46ad6b049bc35ec67052ef1c2c +// +func ClipLine(imgSize image.Point, pt1 image.Point, pt2 image.Point) bool { + pSize := C.struct_Size{ + width: C.int(imgSize.X), + height: C.int(imgSize.Y), + } + + rPt1 := C.struct_Point{ + x: C.int(pt1.X), + y: C.int(pt1.Y), + } + + rPt2 := C.struct_Point{ + x: C.int(pt2.X), + y: C.int(pt2.Y), + } + + return bool(C.ClipLine(pSize, rPt1, rPt2)) +} + // BilateralFilter applies a bilateral filter to an image. // // Bilateral filtering is described here: @@ -432,18 +455,11 @@ type RotatedRect struct { Angle float64 } -// MinAreaRect finds a rotated rectangle of the minimum area enclosing the input 2D point set. +// toPoints converts C.Contour to []image.Points // -// For further details, please see: -// https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#ga3d476a3417130ae5154aea421ca7ead9 -// -func MinAreaRect(points []image.Point) RotatedRect { - cPoints := toCPoints(points) - result := C.MinAreaRect(cPoints) - - defer C.Points_Close(result.pts) - pArray := result.pts.points - pLength := int(result.pts.length) +func toPoints(points C.Contour) []image.Point { + pArray := points.points + pLength := int(points.length) pHdr := reflect.SliceHeader{ Data: uintptr(unsafe.Pointer(pArray)), @@ -456,9 +472,21 @@ func MinAreaRect(points []image.Point) RotatedRect { for j, pt := range sPoints { points4[j] = image.Pt(int(pt.x), int(pt.y)) } + return points4 +} +// MinAreaRect finds a rotated rectangle of the minimum area enclosing the input 2D point set. +// +// For further details, please see: +// https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#ga3d476a3417130ae5154aea421ca7ead9 +// +func MinAreaRect(points []image.Point) RotatedRect { + cPoints := toCPoints(points) + result := C.MinAreaRect(cPoints) + + defer C.Points_Close(result.pts) return RotatedRect{ - Contour: points4, + Contour: toPoints(result.pts), BoundingRect: image.Rect(int(result.boundingRect.x), int(result.boundingRect.y), int(result.boundingRect.x)+int(result.boundingRect.width), int(result.boundingRect.y)+int(result.boundingRect.height)), Center: image.Pt(int(result.center.x), int(result.center.y)), Width: int(result.size.width), @@ -467,6 +495,27 @@ func MinAreaRect(points []image.Point) RotatedRect { } } +// FitEllipse Fits an ellipse around a set of 2D points. +// +// For further details, please see: +// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gaf259efaad93098103d6c27b9e4900ffa +// +func FitEllipse(points []image.Point) RotatedRect { + cPoints := toCPoints(points) + cRect := C.FitEllipse(cPoints) + defer C.Points_Close(cRect.pts) + + return RotatedRect{ + Contour: toPoints(cRect.pts), + BoundingRect: image.Rect(int(cRect.boundingRect.x), int(cRect.boundingRect.y), int(cRect.boundingRect.x)+int(cRect.boundingRect.width), int(cRect.boundingRect.y)+int(cRect.boundingRect.height)), + Center: image.Pt(int(cRect.center.x), int(cRect.center.y)), + Width: int(cRect.size.width), + Height: int(cRect.size.height), + Angle: float64(cRect.angle), + } + +} + // MinEnclosingCircle finds a circle of the minimum area enclosing the input 2D point set. // // For further details, please see: @@ -1230,24 +1279,22 @@ func FillPoly(img *Mat, pts [][]image.Point, c color.RGBA) { points := make([]C.struct_Points, len(pts)) for i, pt := range pts { - func() { - p := (*C.struct_Point)(C.malloc(C.size_t(C.sizeof_struct_Point * len(pt)))) - defer C.free(unsafe.Pointer(p)) + p := (*C.struct_Point)(C.malloc(C.size_t(C.sizeof_struct_Point * len(pt)))) + defer C.free(unsafe.Pointer(p)) - pa := getPoints(p, len(pt)) + pa := getPoints(p, len(pt)) - for j, point := range pt { - pa[j] = C.struct_Point{ - x: C.int(point.X), - y: C.int(point.Y), - } + for j, point := range pt { + pa[j] = C.struct_Point{ + x: C.int(point.X), + y: C.int(point.Y), } + } - points[i] = C.struct_Points{ - points: (*C.Point)(p), - length: C.int(len(pt)), - } - }() + points[i] = C.struct_Points{ + points: (*C.Point)(p), + length: C.int(len(pt)), + } } cPoints := C.struct_Contours{ @@ -1296,6 +1343,24 @@ const ( FontItalic = 16 ) +// LineType are the line libraries included in OpenCV. +// +// For more information, see: +// https://vovkos.github.io/doxyrest-showcase/opencv/sphinx_rtd_theme/enum_cv_LineTypes.html +// +type LineType int + +const ( + // Filled line + Filled LineType = -1 + // Line4 4-connected line + Line4 = 4 + // Line8 8-connected line + Line8 = 8 + // LineAA antialiased line + LineAA = 16 +) + // GetTextSize calculates the width and height of a text string. // It returns an image.Point with the size required to draw text using // a specific font face, scale, and thickness. @@ -1339,6 +1404,34 @@ func PutText(img *Mat, text string, org image.Point, fontFace HersheyFont, fontS return } +// PutTextWithParams draws a text string. +// It renders the specified text string into the img Mat at the location +// passed in the "org" param, using the desired font face, font scale, +// color, and line thinkness. +// +// For further details, please see: +// http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576 +// +func PutTextWithParams(img *Mat, text string, org image.Point, fontFace HersheyFont, fontScale float64, c color.RGBA, thickness int, lineType LineType, bottomLeftOrigin bool) { + cText := C.CString(text) + defer C.free(unsafe.Pointer(cText)) + + pOrg := C.struct_Point{ + x: C.int(org.X), + y: C.int(org.Y), + } + + sColor := C.struct_Scalar{ + val1: C.double(c.B), + val2: C.double(c.G), + val3: C.double(c.R), + val4: C.double(c.A), + } + + C.PutTextWithParams(img.p, cText, pOrg, C.int(fontFace), C.double(fontScale), sColor, C.int(thickness), C.int(lineType), C.bool(bottomLeftOrigin)) + return +} + // InterpolationFlags are bit flags that control the interpolation algorithm // that is used. type InterpolationFlags int @@ -1386,6 +1479,22 @@ func Resize(src Mat, dst *Mat, sz image.Point, fx, fy float64, interp Interpolat return } +// GetRectSubPix retrieves a pixel rectangle from an image with sub-pixel accuracy. +// +// For further details, please see: +// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga77576d06075c1a4b6ba1a608850cd614 +func GetRectSubPix(src Mat, patchSize image.Point, center image.Point, dst *Mat) { + sz := C.struct_Size{ + width: C.int(patchSize.X), + height: C.int(patchSize.Y), + } + pt := C.struct_Point{ + x: C.int(center.X), + y: C.int(center.Y), + } + C.GetRectSubPix(src.p, sz, pt, dst.p) +} + // GetRotationMatrix2D calculates an affine matrix of 2D rotation. // // For further details, please see: @@ -1511,24 +1620,22 @@ func DrawContours(img *Mat, contours [][]image.Point, contourIdx int, c color.RG cntrs := make([]C.struct_Points, len(contours)) for i, contour := range contours { - func() { - p := (*C.struct_Point)(C.malloc(C.size_t(C.sizeof_struct_Point * len(contour)))) - defer C.free(unsafe.Pointer(p)) + p := (*C.struct_Point)(C.malloc(C.size_t(C.sizeof_struct_Point * len(contour)))) + defer C.free(unsafe.Pointer(p)) - pa := getPoints(p, len(contour)) + pa := getPoints(p, len(contour)) - for j, point := range contour { - pa[j] = C.struct_Point{ - x: C.int(point.X), - y: C.int(point.Y), - } + for j, point := range contour { + pa[j] = C.struct_Point{ + x: C.int(point.X), + y: C.int(point.Y), } + } - cntrs[i] = C.struct_Points{ - points: (*C.Point)(p), - length: C.int(len(contour)), - } - }() + cntrs[i] = C.struct_Points{ + points: (*C.Point)(p), + length: C.int(len(contour)), + } } cContours := C.struct_Contours{ @@ -1596,6 +1703,18 @@ func LogPolar(src Mat, dst *Mat, center image.Point, m float64, flags Interpolat C.LogPolar(src.p, dst.p, centerP, C.double(m), C.int(flags)) } +// LinearPolar remaps an image to polar coordinates space. +// +// For further details, please see: +// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaa38a6884ac8b6e0b9bed47939b5362f3 +func LinearPolar(src Mat, dst *Mat, center image.Point, maxRadius float64, flags InterpolationFlags) { + centerP := C.struct_Point{ + x: C.int(center.X), + y: C.int(center.Y), + } + C.LinearPolar(src.p, dst.p, centerP, C.double(maxRadius), C.int(flags)) +} + // DistanceTypes types for Distance Transform and M-estimatorss // // For further details, please see: @@ -1665,3 +1784,7 @@ func (c *CLAHE) Close() error { func (c *CLAHE) Apply(src Mat, dst *Mat) { C.CLAHE_Apply((C.CLAHE)(c.p), src.p, dst.p) } + +func InvertAffineTransform(src Mat, dst *Mat) { + C.InvertAffineTransform(src.p, dst.p) +} diff --git a/vendor/gocv.io/x/gocv/imgproc.h b/vendor/gocv.io/x/gocv/imgproc.h index 49f8f07..adacc9b 100644 --- a/vendor/gocv.io/x/gocv/imgproc.h +++ b/vendor/gocv.io/x/gocv/imgproc.h @@ -40,6 +40,7 @@ struct Rect BoundingRect(Contour con); void BoxPoints(RotatedRect rect, Mat boxPts); double ContourArea(Contour con); struct RotatedRect MinAreaRect(Points points); +struct RotatedRect FitEllipse(Points points); void MinEnclosingCircle(Points points, Point2f* center, float* radius); struct Contours FindContours(Mat src, int mode, int method); int ConnectedComponents(Mat src, Mat dst, int connectivity, int ltype, int ccltype); @@ -83,7 +84,10 @@ void FillPoly(Mat img, Contours points, Scalar color); struct Size GetTextSize(const char* text, int fontFace, double fontScale, int thickness); void PutText(Mat img, const char* text, Point org, int fontFace, double fontScale, Scalar color, int thickness); +void PutTextWithParams(Mat img, const char* text, Point org, int fontFace, double fontScale, + Scalar color, int thickness, int lineType, bool bottomLeftOrigin); void Resize(Mat src, Mat dst, Size sz, double fx, double fy, int interp); +void GetRectSubPix(Mat src, Size patchSize, Point center, Mat dst); Mat GetRotationMatrix2D(Point center, double angle, double scale); void WarpAffine(Mat src, Mat dst, Mat rot_mat, Size dsize); void WarpAffineWithParams(Mat src, Mat dst, Mat rot_mat, Size dsize, int flags, int borderMode, @@ -101,10 +105,13 @@ void Filter2D(Mat src, Mat dst, int ddepth, Mat kernel, Point anchor, double del void SepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor, double delta, int borderType); void LogPolar(Mat src, Mat dst, Point center, double m, int flags); void FitLine(Contour points, Mat line, int distType, double param, double reps, double aeps); +void LinearPolar(Mat src, Mat dst, Point center, double maxRadius, int flags); +bool ClipLine(Size imgSize, Point pt1, Point pt2); CLAHE CLAHE_Create(); CLAHE CLAHE_CreateWithParams(double clipLimit, Size tileGridSize); void CLAHE_Close(CLAHE c); void CLAHE_Apply(CLAHE c, Mat src, Mat dst); +void InvertAffineTransform(Mat src, Mat dst); #ifdef __cplusplus } diff --git a/vendor/gocv.io/x/gocv/imgproc_colorcodes_string.go b/vendor/gocv.io/x/gocv/imgproc_colorcodes_string.go new file mode 100644 index 0000000..ac226ef --- /dev/null +++ b/vendor/gocv.io/x/gocv/imgproc_colorcodes_string.go @@ -0,0 +1,303 @@ +package gocv + +func (c ColorConversionCode) String() string { + switch c { + case ColorBGRToBGRA: + return "color-bgr-to-bgra" + case ColorBGRAToBGR: + return "color-bgra-to-bgr" + case ColorBGRToRGBA: + return "color-bgr-to-rgba" + case ColorRGBAToBGR: + return "color-rgba-to-bgr" + case ColorBGRToRGB: + return "color-bgr-to-rgb" + case ColorBGRAToRGBA: + return "color-bgra-to-rgba" + case ColorBGRToGray: + return "color-bgr-to-gray" + case ColorRGBToGray: + return "color-rgb-to-gray" + case ColorGrayToBGR: + return "color-gray-to-bgr" + case ColorGrayToBGRA: + return "color-gray-to-bgra" + case ColorBGRAToGray: + return "color-bgra-to-gray" + case ColorRGBAToGray: + return "color-rgba-to-gray" + case ColorBGRToBGR565: + return "color-bgr-to-bgr565" + case ColorRGBToBGR565: + return "color-rgb-to-bgr565" + case ColorBGR565ToBGR: + return "color-bgr565-to-bgr" + case ColorBGR565ToRGB: + return "color-bgr565-to-rgb" + case ColorBGRAToBGR565: + return "color-bgra-to-bgr565" + case ColorRGBAToBGR565: + return "color-rgba-to-bgr565" + case ColorBGR565ToBGRA: + return "color-bgr565-to-bgra" + case ColorBGR565ToRGBA: + return "color-bgr565-to-rgba" + case ColorGrayToBGR565: + return "color-gray-to-bgr565" + case ColorBGR565ToGray: + return "color-bgr565-to-gray" + case ColorBGRToBGR555: + return "color-bgr-to-bgr555" + case ColorRGBToBGR555: + return "color-rgb-to-bgr555" + case ColorBGR555ToBGR: + return "color-bgr555-to-bgr" + case ColorBGRAToBGR555: + return "color-bgra-to-bgr555" + case ColorRGBAToBGR555: + return "color-rgba-to-bgr555" + case ColorBGR555ToBGRA: + return "color-bgr555-to-bgra" + case ColorBGR555ToRGBA: + return "color-bgr555-to-rgba" + case ColorGrayToBGR555: + return "color-gray-to-bgr555" + case ColorBGR555ToGRAY: + return "color-bgr555-to-gray" + case ColorBGRToXYZ: + return "color-bgr-to-xyz" + case ColorRGBToXYZ: + return "color-rgb-to-xyz" + case ColorXYZToBGR: + return "color-xyz-to-bgr" + case ColorXYZToRGB: + return "color-xyz-to-rgb" + case ColorBGRToYCrCb: + return "color-bgr-to-ycrcb" + case ColorRGBToYCrCb: + return "color-rgb-to-ycrcb" + case ColorYCrCbToBGR: + return "color-ycrcb-to-bgr" + case ColorYCrCbToRGB: + return "color-ycrcb-to-rgb" + case ColorBGRToHSV: + return "color-bgr-to-hsv" + case ColorRGBToHSV: + return "color-rgb-to-hsv" + case ColorBGRToLab: + return "color-bgr-to-lab" + case ColorRGBToLab: + return "color-rgb-to-lab" + case ColorBGRToLuv: + return "color-bgr-to-luv" + case ColorRGBToLuv: + return "color-rgb-to-luv" + case ColorBGRToHLS: + return "color-bgr-to-hls" + case ColorRGBToHLS: + return "color-rgb-to-hls" + case ColorHSVToBGR: + return "color-hsv-to-bgr" + case ColorHSVToRGB: + return "color-hsv-to-rgb" + case ColorLabToBGR: + return "color-lab-to-bgr" + case ColorLabToRGB: + return "color-lab-to-rgb" + case ColorLuvToBGR: + return "color-luv-to-bgr" + case ColorLuvToRGB: + return "color-luv-to-rgb" + case ColorHLSToBGR: + return "color-hls-to-bgr" + case ColorHLSToRGB: + return "color-hls-to-rgb" + case ColorBGRToHSVFull: + return "color-bgr-to-hsv-full" + case ColorRGBToHSVFull: + return "color-rgb-to-hsv-full" + case ColorBGRToHLSFull: + return "color-bgr-to-hls-full" + case ColorRGBToHLSFull: + return "color-rgb-to-hls-full" + case ColorHSVToBGRFull: + return "color-hsv-to-bgr-full" + case ColorHSVToRGBFull: + return "color-hsv-to-rgb-full" + case ColorHLSToBGRFull: + return "color-hls-to-bgr-full" + case ColorHLSToRGBFull: + return "color-hls-to-rgb-full" + case ColorLBGRToLab: + return "color-lbgr-to-lab" + case ColorLRGBToLab: + return "color-lrgb-to-lab" + case ColorLBGRToLuv: + return "color-lbgr-to-luv" + case ColorLRGBToLuv: + return "color-lrgb-to-luv" + case ColorLabToLBGR: + return "color-lab-to-lbgr" + case ColorLabToLRGB: + return "color-lab-to-lrgb" + case ColorLuvToLBGR: + return "color-luv-to-lbgr" + case ColorLuvToLRGB: + return "color-luv-to-lrgb" + case ColorBGRToYUV: + return "color-bgr-to-yuv" + case ColorRGBToYUV: + return "color-rgb-to-yuv" + case ColorYUVToBGR: + return "color-yuv-to-bgr" + case ColorYUVToRGB: + return "color-yuv-to-rgb" + + case ColorYUVToRGBNV12: + return "color-yuv-to-rgbnv12" + case ColorYUVToBGRNV12: + return "color-yuv-to-bgrnv12" + case ColorYUVToRGBNV21: + return "color-yuv-to-rgbnv21" + case ColorYUVToBGRNV21: + return "color-yuv-to-bgrnv21" + + case ColorYUVToRGBANV12: + return "color-yuv-to-rgbanv12" + case ColorYUVToBGRANV12: + return "color-yuv-to-bgranv12" + case ColorYUVToRGBANV21: + return "color-yuv-to-rgbanv21" + case ColorYUVToBGRANV21: + return "color-yuv-to-bgranv21" + + case ColorYUVToRGBYV12: + return "color-yuv-to-rgbyv12" + case ColorYUVToBGRYV12: + return "color-yuv-to-bgryv12" + + case ColorYUVToRGBIYUV: + return "color-yuv-to-rgbiyuv" + case ColorYUVToBGRIYUV: + return "color-yuv-to-bgriyuv" + + case ColorYUVToRGBAYV12: + return "color-yuv-to-rgbayv12" + case ColorYUVToBGRAYV12: + return "color-yuv-to-bgrayv12" + case ColorYUVToRGBAIYUV: + return "color-yuv-to-rgbaiyuv" + case ColorYUVToBGRAIYUV: + return "color-yuv-to-bgraiyuv" + + case ColorYUVToGRAY420: + return "color-yuv-to-gray420" + + case ColorYUVToRGBUYVY: + return "color-yuv-to-rgbuyvy" + case ColorYUVToBGRUYVY: + return "color-yuv-to-bgruyvy" + + case ColorYUVToRGBAUYVY: + return "color-yuv-to-rgbauyvy" + case ColorYUVToBGRAUYVY: + return "color-yuv-to-bgrauyvy" + + case ColorYUVToRGBYUY2: + return "color-yuv-to-rgbyuy2" + case ColorYUVToBGRYUY2: + return "color-yuv-to-bgryuy2" + + case ColorYUVToRGBYVYU: + return "color-yuv-to-rgbyvyu" + case ColorYUVToBGRYVYU: + return "color-yuv-to-bgryvyu" + + case ColorYUVToRGBAYUY2: + return "color-yuv-to-rgbayuy2" + case ColorYUVToBGRAYUY2: + return "color-yuv-to-bgrayuy2" + + case ColorYUVToRGBAYVYU: + return "color-yuv-to-rgbayvyu" + case ColorYUVToBGRAYVYU: + return "color-yuv-to-bgrayvyu" + + case ColorYUVToGRAYUYVY: + return "color-yuv-to-grayuyvy" + case ColorYUVToGRAYYUY2: + return "color-yuv-to-grayyuy2" + + case ColorRGBATomRGBA: + return "color-rgba-to-mrgba" + case ColormRGBAToRGBA: + return "color-mrgba-to-rgba" + + case ColorRGBToYUVI420: + return "color-rgb-to-yuvi420" + case ColorBGRToYUVI420: + return "color-bgr-to-yuvi420" + + case ColorRGBAToYUVI420: + return "color-rgba-to-yuvi420" + + case ColorBGRAToYUVI420: + return "color-bgra-to-yuvi420" + case ColorRGBToYUVYV12: + return "color-rgb-to-yuvyv12" + case ColorBGRToYUVYV12: + return "color-bgr-to-yuvyv12" + case ColorRGBAToYUVYV12: + return "color-rgba-to-yuvyv12" + case ColorBGRAToYUVYV12: + return "color-bgra-to-yuvyv12" + + case ColorBayerBGToBGR: + return "color-bayer-bgt-to-bgr" + case ColorBayerGBToBGR: + return "color-bayer-gbt-to-bgr" + case ColorBayerRGToBGR: + return "color-bayer-rgt-to-bgr" + case ColorBayerGRToBGR: + return "color-bayer-grt-to-bgr" + + case ColorBayerBGToGRAY: + return "color-bayer-bgt-to-gray" + case ColorBayerGBToGRAY: + return "color-bayer-gbt-to-gray" + case ColorBayerRGToGRAY: + return "color-bayer-rgt-to-gray" + case ColorBayerGRToGRAY: + return "color-bayer-grt-to-gray" + + case ColorBayerBGToBGRVNG: + return "color-bayer-bgt-to-bgrvng" + case ColorBayerGBToBGRVNG: + return "color-bayer-gbt-to-bgrvng" + case ColorBayerRGToBGRVNG: + return "color-bayer-rgt-to-bgrvng" + case ColorBayerGRToBGRVNG: + return "color-bayer-grt-to-bgrvng" + + case ColorBayerBGToBGREA: + return "color-bayer-bgt-to-bgrea" + case ColorBayerGBToBGREA: + return "color-bayer-gbt-to-bgrea" + case ColorBayerRGToBGREA: + return "color-bayer-rgt-to-bgrea" + case ColorBayerGRToBGREA: + return "color-bayer-grt-to-bgrea" + + case ColorBayerBGToBGRA: + return "color-bayer-bgt-to-bgra" + case ColorBayerGBToBGRA: + return "color-bayer-gbt-to-bgra" + case ColorBayerRGToBGRA: + return "color-bayer-rgt-to-bgra" + case ColorBayerGRToBGRA: + return "color-bayer-grt-to-bgra" + case ColorCOLORCVTMAX: + return "color-color-cvt-max" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/imgproc_string.go b/vendor/gocv.io/x/gocv/imgproc_string.go new file mode 100644 index 0000000..589c7cb --- /dev/null +++ b/vendor/gocv.io/x/gocv/imgproc_string.go @@ -0,0 +1,333 @@ +package gocv + +func (c HistCompMethod) String() string { + switch c { + case HistCmpCorrel: + return "hist-cmp-correl" + case HistCmpChiSqr: + return "hist-cmp-chi-sqr" + case HistCmpIntersect: + return "hist-cmp-intersect" + case HistCmpBhattacharya: + return "hist-cmp-bhattacharya" + case HistCmpChiSqrAlt: + return "hist-cmp-chi-sqr-alt" + case HistCmpKlDiv: + return "hist-cmp-kl-div" + } + return "" +} + +func (c DistanceTransformLabelTypes) String() string { + switch c { + case DistanceLabelCComp: + return "distance-label-ccomp" + } + return "" +} + +func (c DistanceTransformMasks) String() string { + switch c { + case DistanceMask3: + return "distance-mask3" + } + return "" +} + +func (c RetrievalMode) String() string { + switch c { + case RetrievalExternal: + return "retrieval-external" + case RetrievalList: + return "retrieval-list" + case RetrievalCComp: + return "retrieval-ccomp" + case RetrievalTree: + return "retrieval-tree" + case RetrievalFloodfill: + return "retrieval-floodfill" + } + return "" +} + +func (c ContourApproximationMode) String() string { + switch c { + case ChainApproxNone: + return "chain-approx-none" + case ChainApproxSimple: + return "chain-approx-simple" + case ChainApproxTC89L1: + return "chain-approx-tc89l1" + case ChainApproxTC89KCOS: + return "chain-approx-tc89kcos" + } + return "" +} + +func (c ConnectedComponentsAlgorithmType) String() string { + switch c { + case CCL_WU: + return "ccl-wu" + case CCL_DEFAULT: + return "ccl-default" + case CCL_GRANA: + return "ccl-grana" + } + return "" +} + +func (c ConnectedComponentsTypes) String() string { + switch c { + case CC_STAT_LEFT: + return "cc-stat-left" + case CC_STAT_TOP: + return "cc-stat-top" + case CC_STAT_WIDTH: + return "cc-stat-width" + case CC_STAT_AREA: + return "cc-stat-area" + case CC_STAT_MAX: + return "cc-stat-max" + case CC_STAT_HEIGHT: + return "cc-stat-height" + } + return "" +} + +func (c TemplateMatchMode) String() string { + switch c { + case TmSqdiff: + return "tm-sq-diff" + case TmSqdiffNormed: + return "tm-sq-diff-normed" + case TmCcorr: + return "tm-ccorr" + case TmCcorrNormed: + return "tm-ccorr-normed" + case TmCcoeff: + return "tm-ccoeff" + case TmCcoeffNormed: + return "tm-ccoeff-normed" + } + return "" +} + +func (c MorphShape) String() string { + switch c { + case MorphRect: + return "morph-rect" + case MorphCross: + return "morph-cross" + case MorphEllipse: + return "morph-ellispe" + } + return "" +} + +func (c MorphType) String() string { + switch c { + case MorphErode: + return "morph-erode" + case MorphDilate: + return "morph-dilate" + case MorphOpen: + return "morph-open" + case MorphClose: + return "morph-close" + case MorphGradient: + return "morph-gradient" + case MorphTophat: + return "morph-tophat" + case MorphBlackhat: + return "morph-blackhat" + case MorphHitmiss: + return "morph-hitmiss" + } + return "" +} + +func (c BorderType) String() string { + switch c { + case BorderConstant: + return "border-constant" + case BorderReplicate: + return "border-replicate" + case BorderReflect: + return "border-reflect" + case BorderWrap: + return "border-wrap" + case BorderTransparent: + return "border-transparent" + case BorderDefault: + return "border-default" + case BorderIsolated: + return "border-isolated" + } + return "" +} + +func (c GrabCutMode) String() string { + switch c { + case GCInitWithRect: + return "gc-init-with-rect" + case GCInitWithMask: + return "gc-init-with-mask" + case GCEval: + return "gc-eval" + case GCEvalFreezeModel: + return "gc-eval-freeze-model" + } + return "" +} + +func (c HoughMode) String() string { + switch c { + case HoughStandard: + return "hough-standard" + case HoughProbabilistic: + return "hough-probabilistic" + case HoughMultiScale: + return "hough-multi-scale" + case HoughGradient: + return "hough-gradient" + } + return "" +} + +func (c ThresholdType) String() string { + switch c { + case ThresholdBinary: + return "threshold-binary" + case ThresholdBinaryInv: + return "threshold-binary-inv" + case ThresholdTrunc: + return "threshold-trunc" + case ThresholdToZero: + return "threshold-to-zero" + case ThresholdToZeroInv: + return "threshold-to-zero-inv" + case ThresholdMask: + return "threshold-mask" + case ThresholdOtsu: + return "threshold-otsu" + case ThresholdTriangle: + return "threshold-triangle" + } + return "" +} + +func (c AdaptiveThresholdType) String() string { + switch c { + case AdaptiveThresholdMean: + return "adaptative-threshold-mean" + case AdaptiveThresholdGaussian: + return "adaptative-threshold-gaussian" + } + return "" +} + +func (c HersheyFont) String() string { + switch c { + case FontHersheySimplex: + return "font-hershey-simplex" + case FontHersheyPlain: + return "font-hershey-plain" + case FontHersheyDuplex: + return "font-hershey-duplex" + case FontHersheyComplex: + return "font-hershey-complex" + case FontHersheyTriplex: + return "font-hershey-triplex" + case FontHersheyComplexSmall: + return "font-hershey-complex-small" + case FontHersheyScriptSimplex: + return "font-hershey-script-simplex" + case FontHersheyScriptComplex: + return "font-hershey-scipt-complex" + case FontItalic: + return "font-italic" + } + return "" +} + +func (c LineType) String() string { + switch c { + case Filled: + return "filled" + case Line4: + return "line4" + case Line8: + return "line8" + case LineAA: + return "line-aa" + } + return "" +} + +func (c InterpolationFlags) String() string { + switch c { + case InterpolationNearestNeighbor: + return "interpolation-nearest-neighbor" + case InterpolationLinear: + return "interpolation-linear" + case InterpolationCubic: + return "interpolation-cubic" + case InterpolationArea: + return "interpolation-area" + case InterpolationLanczos4: + return "interpolation-lanczos4" + case InterpolationMax: + return "interpolation-max" + } + return "" +} + +func (c ColormapTypes) String() string { + switch c { + case ColormapAutumn: + return "colormap-autumn" + case ColormapBone: + return "colormap-bone" + case ColormapJet: + return "colormap-jet" + case ColormapWinter: + return "colormap-winter" + case ColormapRainbow: + return "colormap-rainbow" + case ColormapOcean: + return "colormap-ocean" + case ColormapSummer: + return "colormap-summer" + case ColormapSpring: + return "colormap-spring" + case ColormapCool: + return "colormap-cool" + case ColormapHsv: + return "colormap-hsv" + case ColormapPink: + return "colormap-pink" + case ColormapParula: + return "colormap-parula" + } + return "" +} + +func (c DistanceTypes) String() string { + switch c { + case DistUser: + return "dist-user" + case DistL1: + return "dist-l1" + case DistL2: + return "dist-l2" + case DistL12: + return "dist-l12" + case DistFair: + return "dist-fair" + case DistWelsch: + return "dist-welsch" + case DistHuber: + return "dist-huber" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/objdetect.cpp b/vendor/gocv.io/x/gocv/objdetect.cpp index e3bb4e7..d5df10f 100644 --- a/vendor/gocv.io/x/gocv/objdetect.cpp +++ b/vendor/gocv.io/x/gocv/objdetect.cpp @@ -125,3 +125,27 @@ struct Rects GroupRectangles(struct Rects rects, int groupThreshold, double eps) Rects ret = {results, (int)vRect.size()}; return ret; } + +// QRCodeDetector + +QRCodeDetector QRCodeDetector_New() { + return new cv::QRCodeDetector(); +} + +void QRCodeDetector_Close(QRCodeDetector qr) { + delete qr; +} + +const char* QRCodeDetector_DetectAndDecode(QRCodeDetector qr, Mat input,Mat points,Mat straight_qrcode) { + cv::String *str = new cv::String(qr->detectAndDecode(*input,*points,*straight_qrcode)); + return str->c_str(); +} + +bool QRCodeDetector_Detect(QRCodeDetector qr, Mat input,Mat points) { + return qr->detect(*input,*points); +} + +const char* QRCodeDetector_Decode(QRCodeDetector qr, Mat input,Mat inputPoints,Mat straight_qrcode) { + cv::String *str = new cv::String(qr->detectAndDecode(*input,*inputPoints,*straight_qrcode)); + return str->c_str(); +} diff --git a/vendor/gocv.io/x/gocv/objdetect.go b/vendor/gocv.io/x/gocv/objdetect.go index 8a9b0ff..9a31d1a 100644 --- a/vendor/gocv.io/x/gocv/objdetect.go +++ b/vendor/gocv.io/x/gocv/objdetect.go @@ -184,3 +184,57 @@ func GroupRectangles(rects []image.Rectangle, groupThreshold int, eps float64) [ return toRectangles(ret) } + +// QRCodeDetector groups the object candidate rectangles. +// +// For further details, please see: +// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html +// +type QRCodeDetector struct { + p C.QRCodeDetector +} + +// newQRCodeDetector returns a new QRCodeDetector from a C QRCodeDetector +func newQRCodeDetector(p C.QRCodeDetector) QRCodeDetector { + return QRCodeDetector{p: p} +} + +func NewQRCodeDetector() QRCodeDetector { + return newQRCodeDetector(C.QRCodeDetector_New()) +} + +func (a *QRCodeDetector) Close() error { + C.QRCodeDetector_Close(a.p) + a.p = nil + return nil +} + +// DetectAndDecode Both detects and decodes QR code. +// +// For further details, please see: +// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a7290bd6a5d59b14a37979c3a14fbf394 +// +func (a *QRCodeDetector) DetectAndDecode(input Mat, points *Mat, straight_qrcode *Mat) string { + goResult := C.GoString(C.QRCodeDetector_DetectAndDecode(a.p, input.p, points.p, straight_qrcode.p)) + return string(goResult) +} + +// Detect detects QR code in image and returns the quadrangle containing the code. +// +// For further details, please see: +// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a64373f7d877d27473f64fe04bb57d22b +// +func (a *QRCodeDetector) Detect(input Mat, points *Mat) bool { + result := C.QRCodeDetector_Detect(a.p, input.p, points.p) + return bool(result) +} + +// Decode decodes QR code in image once it's found by the detect() method. Returns UTF8-encoded output string or empty string if the code cannot be decoded. +// +// For further details, please see: +// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a4172c2eb4825c844fb1b0ae67202d329 +// +func (a *QRCodeDetector) Decode(input Mat, points Mat, straight_qrcode *Mat) string { + goResult := C.GoString(C.QRCodeDetector_DetectAndDecode(a.p, input.p, points.p, straight_qrcode.p)) + return string(goResult) +} diff --git a/vendor/gocv.io/x/gocv/objdetect.h b/vendor/gocv.io/x/gocv/objdetect.h index 362510f..468d9c7 100644 --- a/vendor/gocv.io/x/gocv/objdetect.h +++ b/vendor/gocv.io/x/gocv/objdetect.h @@ -13,9 +13,11 @@ extern "C" { #ifdef __cplusplus typedef cv::CascadeClassifier* CascadeClassifier; typedef cv::HOGDescriptor* HOGDescriptor; +typedef cv::QRCodeDetector* QRCodeDetector; #else typedef void* CascadeClassifier; typedef void* HOGDescriptor; +typedef void* QRCodeDetector; #endif // CascadeClassifier @@ -38,6 +40,12 @@ void HOGDescriptor_SetSVMDetector(HOGDescriptor hog, Mat det); struct Rects GroupRectangles(struct Rects rects, int groupThreshold, double eps); +QRCodeDetector QRCodeDetector_New(); +const char* QRCodeDetector_DetectAndDecode(QRCodeDetector qr, Mat input,Mat points,Mat straight_qrcode); +bool QRCodeDetector_Detect(QRCodeDetector qr, Mat input,Mat points); +const char* QRCodeDetector_Decode(QRCodeDetector qr, Mat input,Mat inputPoints,Mat straight_qrcode); +void QRCodeDetector_Close(QRCodeDetector qr); + #ifdef __cplusplus } #endif diff --git a/vendor/gocv.io/x/gocv/svd.cpp b/vendor/gocv.io/x/gocv/svd.cpp new file mode 100644 index 0000000..0e0e82d --- /dev/null +++ b/vendor/gocv.io/x/gocv/svd.cpp @@ -0,0 +1,5 @@ +#include "svd.h" + +void SVD_Compute(Mat src, Mat w, Mat u, Mat vt) { + cv::SVD::compute(*src, *w, *u, *vt, 0); +} \ No newline at end of file diff --git a/vendor/gocv.io/x/gocv/svd.go b/vendor/gocv.io/x/gocv/svd.go new file mode 100644 index 0000000..16f26ef --- /dev/null +++ b/vendor/gocv.io/x/gocv/svd.go @@ -0,0 +1,14 @@ +package gocv + +/* +#include +#include "svd.h" +*/ +import "C" + +// SVDCompute decomposes matrix and stores the results to user-provided matrices +// +// https://docs.opencv.org/4.1.2/df/df7/classcv_1_1SVD.html#a76f0b2044df458160292045a3d3714c6 +func SVDCompute(src Mat, w, u, vt *Mat) { + C.SVD_Compute(src.Ptr(), w.Ptr(), u.Ptr(), vt.Ptr()) +} diff --git a/vendor/gocv.io/x/gocv/svd.h b/vendor/gocv.io/x/gocv/svd.h new file mode 100644 index 0000000..e3aab12 --- /dev/null +++ b/vendor/gocv.io/x/gocv/svd.h @@ -0,0 +1,18 @@ +#ifndef _OPENCV3_SVD_H_ +#define _OPENCV3_SVD_H_ + +#ifdef __cplusplus +#include + +extern "C" { +#endif + +#include "core.h" + +void SVD_Compute(Mat src, Mat w, Mat u, Mat vt); + +#ifdef __cplusplus +} +#endif + +#endif //_OPENCV3_SVD_H \ No newline at end of file diff --git a/vendor/gocv.io/x/gocv/travis_build_opencv.sh b/vendor/gocv.io/x/gocv/travis_build_opencv.sh index 4357b24..a2fb550 100644 --- a/vendor/gocv.io/x/gocv/travis_build_opencv.sh +++ b/vendor/gocv.io/x/gocv/travis_build_opencv.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eux -o pipefail -OPENCV_VERSION=${OPENCV_VERSION:-4.1.2} +OPENCV_VERSION=${OPENCV_VERSION:-4.2.0} #GRAPHICAL=ON GRAPHICAL=${GRAPHICAL:-OFF} diff --git a/vendor/gocv.io/x/gocv/version.go b/vendor/gocv.io/x/gocv/version.go index 6be4c81..00fbdcf 100644 --- a/vendor/gocv.io/x/gocv/version.go +++ b/vendor/gocv.io/x/gocv/version.go @@ -7,7 +7,7 @@ package gocv import "C" // GoCVVersion of this package, for display purposes. -const GoCVVersion = "0.21.0" +const GoCVVersion = "0.22.0" // Version returns the current golang package version func Version() string { diff --git a/vendor/gocv.io/x/gocv/videoio_string.go b/vendor/gocv.io/x/gocv/videoio_string.go new file mode 100644 index 0000000..b17d257 --- /dev/null +++ b/vendor/gocv.io/x/gocv/videoio_string.go @@ -0,0 +1,85 @@ +package gocv + +func (c VideoCaptureProperties) String() string { + switch c { + case VideoCapturePosMsec: + return "video-capture-pos-msec" + case VideoCapturePosFrames: + return "video-capture-pos-frames" + case VideoCapturePosAVIRatio: + return "video-capture-pos-avi-ratio" + case VideoCaptureFrameWidth: + return "video-capture-frame-width" + case VideoCaptureFrameHeight: + return "video-capture-frame-height" + case VideoCaptureFPS: + return "video-capture-fps" + case VideoCaptureFOURCC: + return "video-capture-fourcc" + case VideoCaptureFrameCount: + return "video-capture-frame-count" + case VideoCaptureFormat: + return "video-capture-format" + case VideoCaptureMode: + return "video-capture-mode" + case VideoCaptureBrightness: + return "video-capture-brightness" + case VideoCaptureContrast: + return "video-capture-contrast" + case VideoCaptureSaturation: + return "video-capture-saturation" + case VideoCaptureHue: + return "video-capture-hue" + case VideoCaptureGain: + return "video-capture-gain" + case VideoCaptureExposure: + return "video-capture-exposure" + case VideoCaptureConvertRGB: + return "video-capture-convert-rgb" + case VideoCaptureWhiteBalanceBlueU: + return "video-capture-white-balanced-blue-u" + case VideoCaptureWhiteBalanceRedV: + return "video-capture-white-balanced-red-v" + case VideoCaptureRectification: + return "video-capture-rectification" + case VideoCaptureMonochrome: + return "video-capture-monochrome" + case VideoCaptureSharpness: + return "video-capture-sharpness" + case VideoCaptureAutoExposure: + return "video-capture-auto-exposure" + case VideoCaptureGamma: + return "video-capture-gamma" + case VideoCaptureTemperature: + return "video-capture-temperature" + case VideoCaptureTrigger: + return "video-capture-trigger" + case VideoCaptureTriggerDelay: + return "video-capture-trigger-delay" + case VideoCaptureZoom: + return "video-capture-zoom" + case VideoCaptureFocus: + return "video-capture-focus" + case VideoCaptureGUID: + return "video-capture-guid" + case VideoCaptureISOSpeed: + return "video-capture-iso-speed" + case VideoCaptureBacklight: + return "video-capture-backlight" + case VideoCapturePan: + return "video-capture-pan" + case VideoCaptureTilt: + return "video-capture-tilt" + case VideoCaptureRoll: + return "video-capture-roll" + case VideoCaptureIris: + return "video-capture-iris" + case VideoCaptureSettings: + return "video-capture-settings" + case VideoCaptureBufferSize: + return "video-capture-buffer-size" + case VideoCaptureAutoFocus: + return "video-capture-auto-focus" + } + return "" +} diff --git a/vendor/gocv.io/x/gocv/win_build_opencv.cmd b/vendor/gocv.io/x/gocv/win_build_opencv.cmd index feeca44..26e18cb 100644 --- a/vendor/gocv.io/x/gocv/win_build_opencv.cmd +++ b/vendor/gocv.io/x/gocv/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.1.2.zip [91MB] -powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/4.1.2.zip -OutFile c:\opencv\opencv-4.1.2.zip" +echo Downloading: opencv-4.2.0.zip [91MB] +powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/4.2.0.zip -OutFile c:\opencv\opencv-4.2.0.zip" echo Extracting... -powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv-4.1.2.zip -DestinationPath c:\opencv" -del c:\opencv\opencv-4.1.2.zip /q +powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv-4.2.0.zip -DestinationPath c:\opencv" +del c:\opencv\opencv-4.2.0.zip /q echo. -echo Downloading: opencv_contrib-4.1.2.zip [58MB] -powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/4.1.2.zip -OutFile c:\opencv\opencv_contrib-4.1.2.zip" +echo Downloading: opencv_contrib-4.2.0.zip [58MB] +powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/4.2.0.zip -OutFile c:\opencv\opencv_contrib-4.2.0.zip" echo Extracting... -powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv_contrib-4.1.2.zip -DestinationPath c:\opencv" -del c:\opencv\opencv_contrib-4.1.2.zip /q +powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv_contrib-4.2.0.zip -DestinationPath c:\opencv" +del c:\opencv\opencv_contrib-4.2.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.1.2 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.1.2\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 -Wno-dev +cmake C:\opencv\opencv-4.2.0 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.2.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 -Wno-dev mingw32-make -j%NUMBER_OF_PROCESSORS% mingw32-make install -rmdir c:\opencv\opencv-4.1.2 /s /q -rmdir c:\opencv\opencv_contrib-4.1.2 /s /q +rmdir c:\opencv\opencv-4.2.0 /s /q +rmdir c:\opencv\opencv_contrib-4.2.0 /s /q chdir /D %GOPATH%\src\gocv.io\x\gocv diff --git a/vendor/modules.txt b/vendor/modules.txt index 16c8896..0095f6e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -18,7 +18,7 @@ github.com/konsorten/go-windows-terminal-sequences # github.com/sirupsen/logrus v1.4.2 ## explicit github.com/sirupsen/logrus -# gocv.io/x/gocv v0.21.0 +# gocv.io/x/gocv v0.22.0 ## explicit gocv.io/x/gocv # golang.org/x/net v0.0.0-20180906233101-161cd47e91fd