build: upgrade to go 1.18 and dependencies

refs robocars/robocar-setup#3
This commit is contained in:
2022-04-12 18:00:12 +02:00
parent d1788152f7
commit 48e75c1346
49 changed files with 714 additions and 375 deletions

34
vendor/gocv.io/x/gocv/CHANGELOG.md generated vendored
View File

@ -1,3 +1,37 @@
0.30.0
---
* **all**
* update to OpenCV 4.5.5
* **build**
* add install_nonfree make task to build all opencv_contrib modules
* correct download location for onnx test file
* Update Makefile for missing version changes
* **core**
* correct how memory is being allocated for Eye(), Zeros(), and Ones() to address issue #930
* **calib3d**
* Adding support for estimateAffine2DWithParams (#924)
* **imgproc**
* Add DrawContoursWithParams function
* **photo**
* Add bindings for fastNlMeansDenoising and fastNlMeansDenoisingColored
* add detailEnhance function
* add EdgePreservingFilter function
* add PencilSketch function
* add stylization function
* **docs**
* add godoc comments for FastNlMeansDenoising functions
* update README with info on latest mingw-w64 t use for Windows builds
* dnn pose detect examples correct the order of the argument variable name
* **examples**
* Fixed memory leaks in the motion detection example
* **openvino**
* Update env.sh and README.md
* **windows**
* use mingw-w64 8.1.0 for protobuf compile
* **contrib**
* add cv::wechat_qrcode::WeChatQRCode (#949)
* Update cgo_static.go
0.29.0
---
* **all**

View File

@ -81,7 +81,7 @@ go test ./openvino/...
## Contributing workflow
This section provides a short description of one of many possible workflows you can follow to contribute to `CoCV`. This workflow is based on multiple [git remotes](https://git-scm.com/docs/git-remote) and it's by no means the only workflow you can use to contribute to `GoCV`. However, it's an option that might help you get started quickly without too much hassle as this workflow lets you work off the `gocv` repo directory path!
This section provides a short description of one of many possible workflows you can follow to contribute to `GoCV`. This workflow is based on multiple [git remotes](https://git-scm.com/docs/git-remote) and it's by no means the only workflow you can use to contribute to `GoCV`. However, it's an option that might help you get started quickly without too much hassle as this workflow lets you work off the `gocv` repo directory path!
Assuming you have already forked the `gocv` repo, you need to add a new `git remote` which will point to your GitHub fork. Notice below that you **must** `cd` to `gocv` repo directory before you add the new `git remote`:

2
vendor/gocv.io/x/gocv/Dockerfile generated vendored
View File

@ -1,6 +1,6 @@
# to build this docker image:
# docker build .
FROM gocv/opencv:4.5.4
FROM gocv/opencv:4.5.5
ENV GOPATH /go

View File

@ -6,7 +6,7 @@
# docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix gocv-test
# xhost -
#
FROM gocv/opencv:4.5.4 AS gocv-test
FROM gocv/opencv:4.5.5 AS gocv-test
ENV GOPATH /go

View File

@ -4,7 +4,7 @@
# To run tests:
# docker run -it --rm --gpus all gocv-test-gpu-cuda-10
#
FROM gocv/opencv:4.5.4-gpu-cuda-10 AS gocv-gpu-test-cuda-10
FROM gocv/opencv:4.5.5-gpu-cuda-10 AS gocv-gpu-test-cuda-10
ENV GOPATH /go
ENV PATH="${PATH}:/go/bin"

View File

@ -4,7 +4,7 @@
# To run tests:
# docker run -it --rm --gpus all gocv-test-gpu-cuda-11
#
FROM gocv/opencv:4.5.4-gpu-cuda-11 AS gocv-gpu-test-cuda-11
FROM gocv/opencv:4.5.5-gpu-cuda-11 AS gocv-gpu-test-cuda-11
ENV GOPATH /go
ENV PATH="${PATH}:/go/bin"

View File

@ -1,6 +1,6 @@
# to build this docker image:
# docker build -f Dockerfile.gpu .
FROM gocv/opencv:4.5.4-gpu-cuda-11 AS gocv-gpu
FROM gocv/opencv:4.5.5-gpu-cuda-11 AS gocv-gpu
ENV GOPATH /go

View File

@ -1,5 +1,5 @@
# to build this docker image:
# docker build -f Dockerfile.opencv -t gocv/opencv:4.5.4 .
# docker build -f Dockerfile.opencv -t gocv/opencv:4.5.5 .
FROM golang:1.17-buster AS opencv
LABEL maintainer="hybridgroup"
@ -10,7 +10,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.5.4"
ARG OPENCV_VERSION="4.5.5"
ENV OPENCV_VERSION $OPENCV_VERSION
RUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \

View File

@ -1,5 +1,5 @@
# to build this docker image:
# docker build -f Dockerfile.opencv-gpu-cuda-10 -t gocv/opencv:4.5.4-gpu-cuda-10 .
# docker build -f Dockerfile.opencv-gpu-cuda-10 -t gocv/opencv:4.5.5-gpu-cuda-10 .
FROM nvidia/cuda:10.2-cudnn7-devel AS opencv-gpu-base
LABEL maintainer="hybridgroup"
@ -10,7 +10,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.5.4"
ARG OPENCV_VERSION="4.5.5"
ENV OPENCV_VERSION $OPENCV_VERSION
RUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \

View File

@ -1,5 +1,5 @@
# to build this docker image:
# docker build -f Dockerfile.opencv-gpu-cuda-11 -t gocv/opencv:4.5.4-gpu-cuda-11 .
# docker build -f Dockerfile.opencv-gpu-cuda-11 -t gocv/opencv:4.5.5-gpu-cuda-11 .
FROM nvidia/cuda:11.4.2-cudnn8-devel-ubuntu20.04 AS opencv-gpu-cuda-11-base
LABEL maintainer="hybridgroup"
ENV DEBIAN_FRONTEND=noninteractive
@ -11,7 +11,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.5.4"
ARG OPENCV_VERSION="4.5.5"
ENV OPENCV_VERSION $OPENCV_VERSION
RUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \

2
vendor/gocv.io/x/gocv/LICENSE.txt generated vendored
View File

@ -1,4 +1,4 @@
Copyright (c) 2017-2021 The Hybrid Group
Copyright (c) 2017-2022 The Hybrid Group and friends
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

7
vendor/gocv.io/x/gocv/Makefile generated vendored
View File

@ -2,10 +2,10 @@
.PHONY: test deps download build clean astyle cmds docker
# GoCV version to use.
GOCV_VERSION?="v0.26.0"
GOCV_VERSION?="v0.30.0"
# OpenCV version to use.
OPENCV_VERSION?=4.5.3
OPENCV_VERSION?=4.5.5
# Go version to use when building Docker image
GOVERSION?=1.16.2
@ -252,6 +252,9 @@ install_openvino: deps download download_openvino sudo_pre_install_clean build_o
# Do everything statically.
install_static: deps download sudo_pre_install_clean build_static sudo_install clean verify
# Do everything with non-free modules from cpencv_contrib.
install_nonfree: deps download sudo_pre_install_clean build_nonfree sudo_install clean verify
# Do everything with openvino and cuda.
install_all: deps download download_openvino sudo_pre_install_clean build_openvino_package sudo_install_openvino build_all sudo_install clean verify_openvino verify_cuda

64
vendor/gocv.io/x/gocv/README.md generated vendored
View File

@ -10,7 +10,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.5.4) on Linux, macOS, and Windows. We intend to make the Go language a "first-class" client compatible with the latest developments in the OpenCV ecosystem.
The GoCV package supports the latest releases of Go and OpenCV (v4.5.5) 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 supports [CUDA](https://en.wikipedia.org/wiki/CUDA) for hardware acceleration using Nvidia GPUs. Check out the [CUDA README](./cuda/README.md) for more info on how to use GoCV with OpenCV/CUDA.
@ -122,7 +122,7 @@ There are examples in the [cmd directory](./cmd) of this repo in the form of var
## How to install
To install GoCV, you must first have the matching version of OpenCV installed on your system. The current release of GoCV requires OpenCV 4.5.4.
To install GoCV, you must first have the matching version of OpenCV installed on your system. The current release of GoCV requires OpenCV 4.5.5.
Here are instructions for Ubuntu, Raspian, macOS, and Windows.
@ -130,7 +130,7 @@ Here are instructions for Ubuntu, Raspian, macOS, and Windows.
### Installation
You can use `make` to install OpenCV 4.5.4 with the handy `Makefile` included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the `Makefile` is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way.
You can use `make` to install OpenCV 4.5.5 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
@ -141,7 +141,7 @@ First, change directories to where you want to install GoCV, and then use git to
Make sure to change `$HOME/folder/with/your/src/` to where you actually want to save the code.
Once you have cloned the repo, the following commands should do everything to download and install OpenCV 4.5.4 on Linux:
Once you have cloned the repo, the following commands should do everything to download and install OpenCV 4.5.5 on Linux:
cd gocv
make install
@ -152,8 +152,8 @@ If you need static opencv libraries
If it works correctly, at the end of the entire process, the following message should be displayed:
gocv version: 0.29.0
opencv lib version: 4.5.4
gocv version: 0.30.0
opencv lib version: 4.5.5
That's it, now you are ready to use GoCV.
@ -167,7 +167,7 @@ See the [openvino directory](./openvino) for information.
#### Make Install for OpenVINO and Cuda
The following commands should do everything to download and install OpenCV 4.5.4 with CUDA and OpenVINO on Linux. Make sure to change `$HOME/folder/with/your/src/` to the directory you used to clone GoCV:
The following commands should do everything to download and install OpenCV 4.5.5 with CUDA and OpenVINO on Linux. Make sure to change `$HOME/folder/with/your/src/` to the directory you used to clone GoCV:
cd $HOME/folder/with/gocv/
make install_all
@ -178,8 +178,8 @@ If you need static opencv libraries
If it works correctly, at the end of the entire process, the following message should be displayed:
gocv version: 0.29.0
opencv lib version: 4.5.4-openvino
gocv version: 0.30.0
opencv lib version: 4.5.5-openvino
cuda information:
Device 0: "GeForce MX150" 2003Mb, sm_61, Driver/Runtime ver.10.0/10.0
@ -206,7 +206,7 @@ Next, you need to update the system, and install any required packages:
#### Download source
Now, download the OpenCV 4.5.4 and OpenCV Contrib source code:
Now, download the OpenCV 4.5.5 and OpenCV Contrib source code:
make download
@ -240,8 +240,8 @@ Now you should be able to build or run any of the examples:
The version program should output the following:
gocv version: 0.29.0
opencv lib version: 4.5.4
gocv version: 0.30.0
opencv lib version: 4.5.5
#### Cleanup extra files
@ -320,7 +320,7 @@ 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.5.4 with the handy `Makefile` included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the `Makefile` is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way.
We have a special installation for the Raspberry Pi that includes some hardware optimizations. You use `make` to install OpenCV 4.5.5 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
@ -331,15 +331,15 @@ First, change directories to where you want to install GoCV, and then use git to
Make sure to change `$HOME/folder/with/your/src/` to where you actually want to save the code.
The following make command should do everything to download and install OpenCV 4.5.4 on Raspbian:
The following make command should do everything to download and install OpenCV 4.5.5 on Raspbian:
cd $HOME/folder/with/your/src/gocv
make install_raspi
If it works correctly, at the end of the entire process, the following message should be displayed:
gocv version: 0.29.0
opencv lib version: 4.5.4
gocv version: 0.30.0
opencv lib version: 4.5.5
That's it, now you are ready to use GoCV.
@ -347,13 +347,13 @@ That's it, now you are ready to use GoCV.
### Installation
You can install OpenCV 4.5.4 using Homebrew.
You can install OpenCV 4.5.5 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.5.4:
You can then install OpenCV 4.5.5:
brew install opencv
@ -377,8 +377,8 @@ Now you should be able to build or run any of the examples:
The version program should output the following:
gocv version: 0.29.0
opencv lib version: 4.5.4
gocv version: 0.30.0
opencv lib version: 4.5.5
### Custom Environment
@ -387,8 +387,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.5.4/include"
export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/4.5.4/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core"
export CGO_CPPFLAGS="-I/usr/local/Cellar/opencv/4.5.5/include"
export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/4.5.5/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:
@ -400,25 +400,25 @@ 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.5.4 on Windows, you must first download and install MinGW-W64 and CMake, as follows.
In order to build and install OpenCV 4.5.5 on Windows, you must first download and install MinGW-W64 and CMake, as follows.
#### MinGW-W64
Download and run the MinGW-W64 compiler installer from [https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.3.0/](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.3.0/).
Download and run the MinGW-W64 compiler installer from [https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/).
The latest version of the MinGW-W64 toolchain is `7.3.0`, but any version from `7.X` on should work.
The latest version of the MinGW-W64 toolchain is `8.1.0`, but any version from `8.X` on should work.
Choose the options for "posix" threads, and for "seh" exceptions handling, then install to the default location `c:\Program Files\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev2`.
Choose the options for "posix" threads, and for "seh" exceptions handling, then install to the default location `c:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0`.
Add the `C:\Program Files\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev2\mingw64\bin` path to your System Path.
Add the `C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin` path to your System Path.
#### CMake
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.5.4 and OpenCV Contrib Modules
#### OpenCV 4.5.5 and OpenCV Contrib Modules
The following commands should do everything to download and install OpenCV 4.5.4 on Windows:
The following commands should do everything to download and install OpenCV 4.5.5 on Windows:
chdir %GOPATH%\src\gocv.io\x\gocv
win_build_opencv.cmd
@ -439,8 +439,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.29.0
opencv lib version: 4.5.4
gocv version: 0.30.0
opencv lib version: 4.5.5
That's it, now you are ready to use GoCV.
@ -454,7 +454,7 @@ For example:
set CGO_CXXFLAGS="--std=c++11"
set CGO_CPPFLAGS=-IC:\opencv\build\install\include
set CGO_LDFLAGS=-LC:\opencv\build\install\x64\mingw\lib -lopencv_core454 -lopencv_face454 -lopencv_videoio454 -lopencv_imgproc454 -lopencv_highgui454 -lopencv_imgcodecs454 -lopencv_objdetect454 -lopencv_features2d454 -lopencv_video454 -lopencv_dnn454 -lopencv_xfeatures2d454 -lopencv_plot454 -lopencv_tracking454 -lopencv_img_hash454
set CGO_LDFLAGS=-LC:\opencv\build\install\x64\mingw\lib -lopencv_core455 -lopencv_face455 -lopencv_videoio455 -lopencv_imgproc455 -lopencv_highgui455 -lopencv_imgcodecs455 -lopencv_objdetect455 -lopencv_features2d455 -lopencv_video455 -lopencv_dnn455 -lopencv_xfeatures2d455 -lopencv_plot455 -lopencv_tracking455 -lopencv_img_hash455
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:

16
vendor/gocv.io/x/gocv/ROADMAP.md generated vendored
View File

@ -188,9 +188,9 @@ Your pull requests will be greatly appreciated!
- [ ] **photo. Computational Photography - WORK STARTED** The following functions still need implementation:
- [ ] [inpaint](https://docs.opencv.org/master/d7/d8b/group__photo__inpaint.html#gaedd30dfa0214fec4c88138b51d678085)
- [ ] [denoise_TVL1](https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#ga7602ed5ae17b7de40152b922227c4e4f)
- [ ] [fastNlMeansDenoising](https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93)
- [ ] [fastNlMeansDenoisingColored](https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#ga03aa4189fc3e31dafd638d90de335617)
- [ ] [fastNlMeansDenoisingMulti](https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#gaf4421bf068c4d632ea7f0aa38e0bf172)
- [X] [fastNlMeansDenoising](https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93)
- [X] [fastNlMeansDenoisingColored](https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#ga03aa4189fc3e31dafd638d90de335617)
- [X] [fastNlMeansDenoisingMulti](https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#gaf4421bf068c4d632ea7f0aa38e0bf172)
- [ ] [createCalibrateDebevec](https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#ga7fed9707ad5f2cc0e633888867109f90)
- [ ] [createCalibrateRobertson](https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#gae77813a21cd351a596619e5ff013be5d)
- [ ] [createMergeDebevec](https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#gaa8eab36bc764abb2a225db7c945f87f9)
@ -200,10 +200,10 @@ Your pull requests will be greatly appreciated!
- [ ] [createTonemapMantiuk](https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#ga3b3f3bf083b7515802f039a6a70f2d21)
- [ ] [createTonemapReinhard](https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#gadabe7f6bf1fa96ad0fd644df9182c2fb)
- [ ] [decolor](https://docs.opencv.org/master/d4/d32/group__photo__decolor.html#ga4864d4c007bda5dacdc5e9d4ed7e222c)
- [ ] [detailEnhance](https://docs.opencv.org/master/df/dac/group__photo__render.html#ga0de660cb6f371a464a74c7b651415975)
- [ ] [edgePreservingFilter](https://docs.opencv.org/master/df/dac/group__photo__render.html#gafaee2977597029bc8e35da6e67bd31f7)
- [ ] [pencilSketch](https://docs.opencv.org/master/df/dac/group__photo__render.html#gae5930dd822c713b36f8529b21ddebd0c)
- [ ] [stylization](https://docs.opencv.org/master/df/dac/group__photo__render.html#gacb0f7324017df153d7b5d095aed53206)
- [X] [detailEnhance](https://docs.opencv.org/master/df/dac/group__photo__render.html#ga0de660cb6f371a464a74c7b651415975)
- [X] [edgePreservingFilter](https://docs.opencv.org/master/df/dac/group__photo__render.html#gafaee2977597029bc8e35da6e67bd31f7)
- [X] [pencilSketch](https://docs.opencv.org/master/df/dac/group__photo__render.html#gae5930dd822c713b36f8529b21ddebd0c)
- [X] [stylization](https://docs.opencv.org/master/df/dac/group__photo__render.html#gacb0f7324017df153d7b5d095aed53206)
- [ ] stitching. Images stitching
@ -393,7 +393,7 @@ Your pull requests will be greatly appreciated!
- [ ] **tracking. Tracking API - WORK STARTED**
- [ ] videostab. Video Stabilization
- [ ] viz. 3D Visualizer
- [ ] wechat_qrcode. WeChat QR code detector for detecting and parsing QR code.
- [X] **wechat_qrcode. WeChat QR code detector for detecting and parsing QR code**
- [ ] **xfeatures2d. Extra 2D Features Framework - WORK STARTED**
- [ ] ximgproc. Extended Image Processing
- [ ] xobjdetect. Extended object detection

View File

@ -3,23 +3,27 @@ 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.5.4.zip -FileName c:\opencv\opencv-4.5.4.zip
7z x c:\opencv\opencv-4.5.4.zip -oc:\opencv -y
del c:\opencv\opencv-4.5.4.zip /q
appveyor DownloadFile https://github.com/opencv/opencv_contrib/archive/4.5.4.zip -FileName c:\opencv\opencv_contrib-4.5.4.zip
7z x c:\opencv\opencv_contrib-4.5.4.zip -oc:\opencv -y
del c:\opencv\opencv_contrib-4.5.4.zip /q
appveyor DownloadFile https://github.com/opencv/opencv/archive/4.5.5.zip -FileName c:\opencv\opencv-4.5.5.zip
7z x c:\opencv\opencv-4.5.5.zip -oc:\opencv -y
del c:\opencv\opencv-4.5.5.zip /q
appveyor DownloadFile https://github.com/opencv/opencv_contrib/archive/4.5.5.zip -FileName c:\opencv\opencv_contrib-4.5.5.zip
7z x c:\opencv\opencv_contrib-4.5.5.zip -oc:\opencv -y
del c:\opencv\opencv_contrib-4.5.5.zip /q
cd C:\opencv\build
set PATH=C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft\Web Platform Installer\;C:\Tools\PsTools;C:\Program Files (x86)\CMake\bin;C:\go\bin;C:\Tools\NuGet;C:\Program Files\LLVM\bin;C:\Tools\curl\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin;C:\Users\appveyor\AppData\Local\Yarn\bin;C:\Program Files\AppVeyor\BuildAgent\
set PATH=%PATH%;C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin
set PATH=%PATH%;C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
dir C:\opencv
cmake C:\opencv\opencv-4.5.4 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.5.4\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 -DBUILD_opencv_wechat_qrcode=OFF -DCPU_DISPATCH= -DBUILD_opencv_gapi=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -DWITH_TBB=ON -Wno-dev
cmake C:\opencv\opencv-4.5.5 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.5.5\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 -DBUILD_opencv_wechat_qrcode=ON -DCPU_DISPATCH= -DBUILD_opencv_gapi=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -DWITH_TBB=ON -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 https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.caffemodel -FileName C:\opencv\testdata\detect.caffemodel
appveyor DownloadFile https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.prototxt -FileName C:\opencv\testdata\detect.prototxt
appveyor DownloadFile https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.caffemodel -FileName C:\opencv\testdata\sr.caffemodel
appveyor DownloadFile https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.prototxt -FileName C:\opencv\testdata\sr.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
appveyor DownloadFile https://github.com/onnx/models/raw/master/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx -FileName C:\opencv\testdata\googlenet-9.onnx
appveyor DownloadFile https://github.com/onnx/models/raw/main/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx -FileName C:\opencv\testdata\googlenet-9.onnx
7z x C:\opencv\testdata\inception5h.zip -oC:\opencv\testdata tensorflow_inception_graph.pb -y
rmdir c:\opencv\opencv-4.5.4 /s /q
rmdir c:\opencv\opencv_contrib-4.5.4 /s /q
rmdir c:\opencv\opencv-4.5.5 /s /q
rmdir c:\opencv\opencv_contrib-4.5.5 /s /q

4
vendor/gocv.io/x/gocv/calib3d.cpp generated vendored
View File

@ -76,3 +76,7 @@ Mat EstimateAffinePartial2D(Point2fVector from, Point2fVector to) {
Mat EstimateAffine2D(Point2fVector from, Point2fVector to) {
return new cv::Mat(cv::estimateAffine2D(*from, *to));
}
Mat EstimateAffine2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters) {
return new cv::Mat(cv::estimateAffine2D(*from, *to, *inliers, method, ransacReprojThreshold, maxIters, confidence, refineIters));
}

9
vendor/gocv.io/x/gocv/calib3d.go generated vendored
View File

@ -245,3 +245,12 @@ func EstimateAffinePartial2D(from, to Point2fVector) Mat {
func EstimateAffine2D(from, to Point2fVector) Mat {
return newMat(C.EstimateAffine2D(from.p, to.p))
}
// EstimateAffine2DWithParams Computes an optimal affine transformation between two 2D point sets
// with additional optional parameters.
//
// For further details, please see:
// https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga27865b1d26bac9ce91efaee83e94d4dd
func EstimateAffine2DWithParams(from Point2fVector, to Point2fVector, inliers Mat, method int, ransacReprojThreshold float64, maxIters uint, confidence float64, refineIters uint) Mat {
return newMat(C.EstimateAffine2DWithParams(from.p, to.p, inliers.p, C.int(method), C.double(ransacReprojThreshold), C.size_t(maxIters), C.double(confidence), C.size_t(refineIters)))
}

3
vendor/gocv.io/x/gocv/calib3d.h generated vendored
View File

@ -28,8 +28,9 @@ bool FindChessboardCornersSBWithMeta(Mat image, Size patternSize, Mat corners, i
void DrawChessboardCorners(Mat image, Size patternSize, Mat corners, bool patternWasFound);
Mat EstimateAffinePartial2D(Point2fVector from, Point2fVector to);
Mat EstimateAffine2D(Point2fVector from, Point2fVector to);
Mat EstimateAffine2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters);
#ifdef __cplusplus
}
#endif
#endif //_OPENCV3_CALIB_H
#endif //_OPENCV3_CALIB_H

2
vendor/gocv.io/x/gocv/cgo.go generated vendored
View File

@ -9,6 +9,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_core454 -lopencv_face454 -lopencv_videoio454 -lopencv_imgproc454 -lopencv_highgui454 -lopencv_imgcodecs454 -lopencv_objdetect454 -lopencv_features2d454 -lopencv_video454 -lopencv_dnn454 -lopencv_xfeatures2d454 -lopencv_plot454 -lopencv_tracking454 -lopencv_img_hash454 -lopencv_calib3d454 -lopencv_bgsegm454 -lopencv_photo454 -lopencv_aruco454
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/lib -lopencv_core455 -lopencv_face455 -lopencv_videoio455 -lopencv_imgproc455 -lopencv_highgui455 -lopencv_imgcodecs455 -lopencv_objdetect455 -lopencv_features2d455 -lopencv_video455 -lopencv_dnn455 -lopencv_xfeatures2d455 -lopencv_plot455 -lopencv_tracking455 -lopencv_img_hash455 -lopencv_calib3d455 -lopencv_bgsegm455 -lopencv_photo455 -lopencv_aruco455 -lopencv_wechat_qrcode455
*/
import "C"

View File

@ -1,3 +1,4 @@
//go:build !customenv && static
// +build !customenv,static
package gocv
@ -7,8 +8,8 @@ package gocv
/*
#cgo CXXFLAGS: --std=c++11
#cgo !windows CPPFLAGS: -I/usr/local/include -I/usr/local/include/opencv4
#cgo !windows LDFLAGS: -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_highgui -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_video -lopencv_videoio -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -littnotify -llibprotobuf -lIlmImf -lquirc -lippiw -lippicv -lade -lz -ljpeg -ldl -lm -lpthread -lrt -lquadmath
#cgo !windows LDFLAGS: -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_highgui -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_video -lopencv_videoio -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_wechat_qrcode -lopencv_photo -lopencv_imgproc -lopencv_core -littnotify -llibprotobuf -lIlmImf -lquirc -lippiw -lippicv -lade -lz -ljpeg -ldl -lm -lpthread -lrt -lquadmath
#cgo windows CPPFLAGS: -IC:/opencv/build/install/include
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo452 -lopencv_tracking452 -lopencv_superres452 -lopencv_stitching452 -lopencv_optflow452 -lopencv_gapi452 -lopencv_face452 -lopencv_dpm452 -lopencv_dnn_objdetect452 -lopencv_ccalib452 -lopencv_bioinspired452 -lopencv_bgsegm452 -lopencv_aruco452 -lopencv_xobjdetect452 -lopencv_ximgproc452 -lopencv_xfeatures2d452 -lopencv_videostab452 -lopencv_video452 -lopencv_structured_light452 -lopencv_shape452 -lopencv_rgbd452 -lopencv_rapid452 -lopencv_objdetect452 -lopencv_mcc452 -lopencv_highgui452 -lopencv_datasets452 -lopencv_calib3d452 -lopencv_videoio452 -lopencv_text452 -lopencv_line_descriptor452 -lopencv_imgcodecs452 -lopencv_img_hash452 -lopencv_hfs452 -lopencv_fuzzy452 -lopencv_features2d452 -lopencv_dnn_superres452 -lopencv_dnn452 -lopencv_xphoto452 -lopencv_surface_matching452 -lopencv_reg452 -lopencv_quality452 -lopencv_plot452 -lopencv_photo452 -lopencv_phase_unwrapping452 -lopencv_ml452 -lopencv_intensity_transform452 -lopencv_imgproc452 -lopencv_flann452 -lopencv_core452 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
#cgo windows LDFLAGS: -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo455 -lopencv_tracking455 -lopencv_superres455 -lopencv_stitching455 -lopencv_optflow455 -lopencv_gapi455 -lopencv_face455 -lopencv_dpm455 -lopencv_dnn_objdetect455 -lopencv_ccalib455 -lopencv_bioinspired455 -lopencv_bgsegm455 -lopencv_aruco455 -lopencv_xobjdetect455 -lopencv_ximgproc455 -lopencv_xfeatures2d455 -lopencv_videostab455 -lopencv_video455 -lopencv_structured_light455 -lopencv_shape455 -lopencv_rgbd455 -lopencv_rapid455 -lopencv_objdetect455 -lopencv_mcc455 -lopencv_highgui455 -lopencv_datasets455 -lopencv_calib3d455 -lopencv_videoio455 -lopencv_text455 -lopencv_line_descriptor455 -lopencv_imgcodecs455 -lopencv_img_hash455 -lopencv_hfs455 -lopencv_fuzzy455 -lopencv_features2d455 -lopencv_dnn_superres455 -lopencv_dnn455 -lopencv_xphoto455 -lopencv_wechat_qrcode455 -lopencv_surface_matching455 -lopencv_reg455 -lopencv_quality455 -lopencv_plot455 -lopencv_photo455 -lopencv_phase_unwrapping455 -lopencv_ml455 -lopencv_intensity_transform455 -lopencv_imgproc455 -lopencv_flann455 -lopencv_core455 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32
*/
import "C"

15
vendor/gocv.io/x/gocv/core.cpp generated vendored
View File

@ -59,18 +59,21 @@ Mat Mat_NewWithSizesFromBytes(IntVector sizes, int type, struct ByteArray buf) {
}
Mat Eye(int rows, int cols, int type) {
cv::Mat temp = cv::Mat::eye(rows, cols, type);
return new cv::Mat(rows, cols, type, temp.data);
cv::Mat* mat = new cv::Mat(rows, cols, type);
*mat = cv::Mat::eye(rows, cols, type);
return mat;
}
Mat Zeros(int rows, int cols, int type) {
cv::Mat temp = cv::Mat::zeros(rows, cols, type);
return new cv::Mat(rows, cols, type, temp.data);
cv::Mat* mat = new cv::Mat(rows, cols, type);
*mat = cv::Mat::zeros(rows, cols, type);
return mat;
}
Mat Ones(int rows, int cols, int type) {
cv::Mat temp = cv::Mat::ones(rows, cols, type);
return new cv::Mat(rows, cols, type, temp.data);
cv::Mat* mat = new cv::Mat(rows, cols, type);
*mat = cv::Mat::ones(rows, cols, type);
return mat;
}
Mat Mat_FromPtr(Mat m, int rows, int cols, int type, int prow, int pcol) {

13
vendor/gocv.io/x/gocv/imgproc.cpp generated vendored
View File

@ -550,6 +550,19 @@ void DrawContours(Mat src, PointsVector contours, int contourIdx, Scalar color,
cv::drawContours(*src, *contours, contourIdx, c, thickness);
}
void DrawContoursWithParams(Mat src, PointsVector contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset) {
cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);
cv::Point offsetPt(offset.x, offset.y);
std::vector<cv::Vec4i> vecHierarchy;
if (hierarchy->empty() == 0) {
for (int j = 0; j < hierarchy->cols; ++j) {
vecHierarchy.push_back(hierarchy->at<cv::Vec4i>(0, j));
}
}
cv::drawContours(*src, *contours, contourIdx, c, thickness, lineType, vecHierarchy, maxLevel, offsetPt);
}
void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType) {
cv::Sobel(*src, *dst, ddepth, dx, dy, ksize, scale, delta, borderType);
}

20
vendor/gocv.io/x/gocv/imgproc.go generated vendored
View File

@ -1780,6 +1780,26 @@ func DrawContours(img *Mat, contours PointsVector, contourIdx int, c color.RGBA,
C.DrawContours(img.p, contours.p, C.int(contourIdx), sColor, C.int(thickness))
}
// DrawContoursWithParams draws contours outlines or filled contours.
//
// For further details, please see:
// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga746c0625f1781f1ffc9056259103edbc
//
func DrawContoursWithParams(img *Mat, contours PointsVector, contourIdx int, c color.RGBA, thickness int, lineType LineType, hierarchy Mat, maxLevel int, offset image.Point) {
sColor := C.struct_Scalar{
val1: C.double(c.B),
val2: C.double(c.G),
val3: C.double(c.R),
val4: C.double(c.A),
}
offsetP := C.struct_Point{
x: C.int(offset.X),
y: C.int(offset.Y),
}
C.DrawContoursWithParams(img.p, contours.p, C.int(contourIdx), sColor, C.int(thickness), C.int(lineType), hierarchy.p, C.int(maxLevel), offsetP)
}
// Remap applies a generic geometrical transformation to an image.
//
// For further details, please see:

1
vendor/gocv.io/x/gocv/imgproc.h generated vendored
View File

@ -113,6 +113,7 @@ Mat GetAffineTransform(PointVector src, PointVector dst);
Mat GetAffineTransform2f(Point2fVector src, Point2fVector dst);
Mat FindHomography(Mat src, Mat dst, int method, double ransacReprojThreshold, Mat mask, const int maxIters, const double confidence) ;
void DrawContours(Mat src, PointsVector contours, int contourIdx, Scalar color, int thickness);
void DrawContoursWithParams(Mat src, PointsVector contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset);
void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType);
void SpatialGradient(Mat src, Mat dx, Mat dy, int ksize, int borderType);
void Remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation, int borderMode, Scalar borderValue);

32
vendor/gocv.io/x/gocv/photo.cpp generated vendored
View File

@ -84,3 +84,35 @@ void AlignMTB_Process(AlignMTB b, struct Mats src, struct Mats *dst) {
}
dst->length = (int)dstMats.size();
}
void FastNlMeansDenoising(Mat src, Mat dst) {
cv::fastNlMeansDenoising(*src, *dst);
}
void FastNlMeansDenoisingWithParams(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize) {
cv::fastNlMeansDenoising(*src, *dst, h, templateWindowSize, searchWindowSize);
}
void FastNlMeansDenoisingColored(Mat src, Mat dst) {
cv::fastNlMeansDenoisingColored(*src, *dst);
}
void FastNlMeansDenoisingColoredWithParams(Mat src, Mat dst, float h, float hColor, int templateWindowSize, int searchWindowSize) {
cv::fastNlMeansDenoisingColored(*src, *dst, h, hColor, templateWindowSize, searchWindowSize);
}
void EdgePreservingFilter(Mat src, Mat dst, int filter, float sigma_s, float sigma_r) {
cv::edgePreservingFilter(*src, *dst, filter, sigma_s, sigma_r);
}
void DetailEnhance(Mat src, Mat dst, float sigma_s, float sigma_r) {
cv::detailEnhance(*src, *dst, sigma_s, sigma_r);
}
void PencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r, float shade_factor) {
cv::pencilSketch(*src, *dst1, *dst2, sigma_s, sigma_r, shade_factor);
}
void Stylization(Mat src, Mat dst, float sigma_s, float sigma_r) {
cv::stylization(*src, *dst, sigma_s, sigma_r);
}

89
vendor/gocv.io/x/gocv/photo.go generated vendored
View File

@ -5,6 +5,7 @@ package gocv
#include "photo.h"
*/
import "C"
import (
"image"
"unsafe"
@ -225,3 +226,91 @@ func (b *AlignMTB) Process(src []Mat, dst *[]Mat) {
}
return
}
// FastNlMeansDenoising performs image denoising using Non-local Means Denoising algorithm
// http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/
//
// For further details, please see:
// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93
//
func FastNlMeansDenoising(src Mat, dst *Mat) {
C.FastNlMeansDenoising(src.p, dst.p)
}
// FastNlMeansDenoisingWithParams performs image denoising using Non-local Means Denoising algorithm
// http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/
//
// For further details, please see:
// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93
//
func FastNlMeansDenoisingWithParams(src Mat, dst *Mat, h float32, templateWindowSize int, searchWindowSize int) {
C.FastNlMeansDenoisingWithParams(src.p, dst.p, C.float(h), C.int(templateWindowSize), C.int(searchWindowSize))
}
// FastNlMeansDenoisingColored is a modification of fastNlMeansDenoising function for colored images.
//
// For further details, please see:
// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga21abc1c8b0e15f78cd3eff672cb6c476
//
func FastNlMeansDenoisingColored(src Mat, dst *Mat) {
C.FastNlMeansDenoisingColored(src.p, dst.p)
}
// FastNlMeansDenoisingColoredWithParams is a modification of fastNlMeansDenoising function for colored images.
//
// For further details, please see:
// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga21abc1c8b0e15f78cd3eff672cb6c476
//
func FastNlMeansDenoisingColoredWithParams(src Mat, dst *Mat, h float32, hColor float32, templateWindowSize int, searchWindowSize int) {
C.FastNlMeansDenoisingColoredWithParams(src.p, dst.p, C.float(h), C.float(hColor), C.int(templateWindowSize), C.int(searchWindowSize))
}
// DetailEnhance filter enhances the details of a particular image
//
// For further details, please see:
// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gae5930dd822c713b36f8529b21ddebd0c
//
func DetailEnhance(src Mat, dst *Mat, sigma_s, sigma_r float32) {
C.DetailEnhance(src.p, dst.p, C.float(sigma_s), C.float(sigma_r))
}
type EdgeFilter int
const (
// RecursFilter Recursive Filtering.
RecursFilter EdgeFilter = 1
// NormconvFilter Normalized Convolution Filtering.
NormconvFilter = 2
)
// EdgePreservingFilter filtering is the fundamental operation in image and video processing.
// Edge-preserving smoothing filters are used in many different applications.
//
// For further details, please see:
// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gafaee2977597029bc8e35da6e67bd31f7
//
func EdgePreservingFilter(src Mat, dst *Mat, filter EdgeFilter, sigma_s, sigma_r float32) {
C.EdgePreservingFilter(src.p, dst.p, C.int(filter), C.float(sigma_s), C.float(sigma_r))
}
// PencilSketch pencil-like non-photorealistic line drawing.
//
// For further details, please see:
// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gae5930dd822c713b36f8529b21ddebd0c
//
func PencilSketch(src Mat, dst1, dst2 *Mat, sigma_s, sigma_r, shade_factor float32) {
C.PencilSketch(src.p, dst1.p, dst2.p, C.float(sigma_s), C.float(sigma_r), C.float(shade_factor))
}
// Stylization aims to produce digital imagery with a wide variety of effects
// not focused on photorealism. Edge-aware filters are ideal for stylization,
// as they can abstract regions of low contrast while preserving, or enhancing,
// high-contrast features.
//
// For further details, please see:
// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gacb0f7324017df153d7b5d095aed53206
//
func Stylization(src Mat, dst *Mat, sigma_s, sigma_r float32) {
C.Stylization(src.p, dst.p, C.float(sigma_s), C.float(sigma_r))
}

11
vendor/gocv.io/x/gocv/photo.h generated vendored
View File

@ -4,7 +4,6 @@
#ifdef __cplusplus
#include <opencv2/opencv.hpp>
#include <opencv2/photo.hpp>
extern "C" {
#endif
@ -29,8 +28,11 @@ void IlluminationChange(Mat src, Mat mask, Mat dst, float alpha, float beta);
void TextureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold, int kernel_size);
void FastNlMeansDenoisingColoredMulti(struct Mats src, Mat dst, int imgToDenoiseIndex, int temporalWindowSize);
void FastNlMeansDenoisingColoredMultiWithParams(struct Mats src, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize, int searchWindowSize );
void FastNlMeansDenoising(Mat src, Mat dst);
void FastNlMeansDenoisingWithParams(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize);
void FastNlMeansDenoisingColored(Mat src, Mat dst);
void FastNlMeansDenoisingColoredWithParams(Mat src, Mat dst, float h, float hColor, int templateWindowSize, int searchWindowSize);
MergeMertens MergeMertens_Create();
MergeMertens MergeMertens_CreateWithParams(float contrast_weight, float saturation_weight, float exposure_weight);
@ -42,6 +44,11 @@ AlignMTB AlignMTB_CreateWithParams(int max_bits, int exclude_range, bool cut);
void AlignMTB_Process(AlignMTB b, struct Mats src, struct Mats *dst);
void AlignMTB_Close(AlignMTB b);
void DetailEnhance(Mat src, Mat dst, float sigma_s, float sigma_r);
void EdgePreservingFilter(Mat src, Mat dst, int filter, float sigma_s, float sigma_r);
void PencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r, float shade_factor);
void Stylization(Mat src, Mat dst, float sigma_s, float sigma_r);
#ifdef __cplusplus
}
#endif

2
vendor/gocv.io/x/gocv/version.go generated vendored
View File

@ -7,7 +7,7 @@ package gocv
import "C"
// GoCVVersion of this package, for display purposes.
const GoCVVersion = "0.29.0"
const GoCVVersion = "0.30.0"
// Version returns the current golang package version
func Version() string {

View File

@ -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.5.4.zip [91MB]
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/4.5.4.zip -OutFile c:\opencv\opencv-4.5.4.zip"
echo Downloading: opencv-4.5.5.zip [91MB]
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/4.5.5.zip -OutFile c:\opencv\opencv-4.5.5.zip"
echo Extracting...
powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv-4.5.4.zip -DestinationPath c:\opencv"
del c:\opencv\opencv-4.5.4.zip /q
powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv-4.5.5.zip -DestinationPath c:\opencv"
del c:\opencv\opencv-4.5.5.zip /q
echo.
echo Downloading: opencv_contrib-4.5.4.zip [58MB]
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/4.5.4.zip -OutFile c:\opencv\opencv_contrib-4.5.4.zip"
echo Downloading: opencv_contrib-4.5.5.zip [58MB]
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/opencv/opencv_contrib/archive/4.5.5.zip -OutFile c:\opencv\opencv_contrib-4.5.5.zip"
echo Extracting...
powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv_contrib-4.5.4.zip -DestinationPath c:\opencv"
del c:\opencv\opencv_contrib-4.5.4.zip /q
powershell -command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path c:\opencv\opencv_contrib-4.5.5.zip -DestinationPath c:\opencv"
del c:\opencv\opencv_contrib-4.5.5.zip /q
echo.
echo Done with downloading and extracting sources.
@ -31,16 +31,16 @@ echo.
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
set PATH=%PATH%;C:\Program Files (x86)\CMake\bin;C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
if [%1]==[static] (
echo Build static opencv
set enable_shared=OFF
) else (
set enable_shared=ON
)
cmake C:\opencv\opencv-4.5.4 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.5.4\modules -DBUILD_SHARED_LIBS=%enable_shared% -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 -DBUILD_opencv_wechat_qrcode=OFF -DCPU_DISPATCH= -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -Wno-dev
cmake C:\opencv\opencv-4.5.5 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.5.5\modules -DBUILD_SHARED_LIBS=%enable_shared% -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 -DBUILD_opencv_wechat_qrcode=ON -DCPU_DISPATCH= -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -Wno-dev
mingw32-make -j%NUMBER_OF_PROCESSORS%
mingw32-make install
rmdir c:\opencv\opencv-4.5.4 /s /q
rmdir c:\opencv\opencv_contrib-4.5.4 /s /q
rmdir c:\opencv\opencv-4.5.5 /s /q
rmdir c:\opencv\opencv_contrib-4.5.5 /s /q
chdir /D %GOPATH%\src\gocv.io\x\gocv