mirror of
https://github.com/hybridgroup/gocv
synced 2025-08-25 08:41:04 +08:00
docs: update all OpenCV 3.3.1 references to v3.4.0
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
16
README.md
16
README.md
@@ -178,7 +178,7 @@ Now you should be able to build or run any of the examples:
|
||||
The version program should output the following:
|
||||
|
||||
gocv version: 0.2.0
|
||||
opencv lib version: 3.3.1
|
||||
opencv lib version: 3.4.0
|
||||
|
||||
You might want to copy the `env.sh` script into your own projects, to make it easier to setup these vars when building your own code.
|
||||
|
||||
@@ -236,7 +236,7 @@ Now you should be able to build or run any of the command examples:
|
||||
The version program should output the following:
|
||||
|
||||
gocv version: 0.2.0
|
||||
opencv lib version: 3.3.1
|
||||
opencv lib version: 3.4.0
|
||||
|
||||
You might want to copy the `env.sh` script into your own projects, to make it easier to setup these vars when building your own code.
|
||||
|
||||
@@ -260,13 +260,13 @@ Download and install CMake [https://cmake.org/download/](https://cmake.org/downl
|
||||
|
||||
#### Download OpenCV 3.3 and OpenCV Contrib Modules
|
||||
|
||||
Download the source code for the latest OpenCV release from [https://github.com/opencv/opencv/archive/3.3.1.zip](https://github.com/opencv/opencv/archive/3.3.1.zip) and extract it to the directory `C:\opencv\opencv-3.3.1`
|
||||
Download the source code for the latest OpenCV release from [https://github.com/opencv/opencv/archive/3.4.0.zip](https://github.com/opencv/opencv/archive/3.4.0.zip) and extract it to the directory `C:\opencv\opencv-3.4.0`
|
||||
|
||||
Download the source code for the latest OpenCV Contrib release from [https://github.com/opencv/opencv_contrib/archive/3.3.1.zip](https://github.com/opencv/opencv_contrib/archive/3.3.1.zip) and extract it to the directory `C:\opencv\opencv_contrib-3.3.1`
|
||||
Download the source code for the latest OpenCV Contrib release from [https://github.com/opencv/opencv_contrib/archive/3.4.0.zip](https://github.com/opencv/opencv_contrib/archive/3.4.0.zip) and extract it to the directory `C:\opencv\opencv_contrib-3.4.0`
|
||||
|
||||
Create the directory `C:\opencv\build` as the build directory.
|
||||
|
||||
Now launch the `cmake-gui` program, and set the "Where is the source code" to `C:\opencv\opencv-3.3.1`, and the "Where to build the binaries" to `C:\opencv\build`.
|
||||
Now launch the `cmake-gui` program, and set the "Where is the source code" to `C:\opencv\opencv-3.4.0`, and the "Where to build the binaries" to `C:\opencv\build`.
|
||||
|
||||
Click on "Configure" and select "MinGW MakeFile" from the window, then click on the "Next" button.
|
||||
|
||||
@@ -278,7 +278,7 @@ Now, scroll down the list and change the following settings as follows:
|
||||
- `BUILD_PERF_TESTS` should be unchecked (aka disabled).
|
||||
- `ENABLE_PRECOMPILED_HEADERS` should be unchecked.
|
||||
- `ENABLE_CXX11` should be checked.
|
||||
- `OPENCV_EXTRA_MODULES_PATH` should be set to `C:\opencv\opencv_contrib-3.3.1\modules`
|
||||
- `OPENCV_EXTRA_MODULES_PATH` should be set to `C:\opencv\opencv_contrib-3.4.0\modules`
|
||||
|
||||
Click on the "Configure" button again, and wait for the configuration step.
|
||||
|
||||
@@ -307,7 +307,7 @@ You should now have OpenCV 3.3 installed on your Windows 10 machine.
|
||||
Run these commands to configure Go to know about the include and lib directories:
|
||||
|
||||
set CGO_CPPFLAGS=-IC:\opencv\build\install\include
|
||||
set CGO_LDFLAGS=-LC:\opencv\build\install\x64\mingw\lib -lopencv_core331 -lopencv_videoio331 -lopencv_imgproc331 -lopencv_highgui331 -lopencv_imgcodecs331 -lopencv_objdetect331 -lopencv_calib3d331 -lopencv_video331 -lopencv_xfeatures2d331 -lopencv_face331
|
||||
set CGO_LDFLAGS=-LC:\opencv\build\install\x64\mingw\lib -lopencv_core340 -lopencv_videoio340 -lopencv_imgproc340 -lopencv_highgui340 -lopencv_imgcodecs340 -lopencv_objdetect340 -lopencv_calib3d340 -lopencv_video340 -lopencv_xfeatures2d340 -lopencv_face340
|
||||
|
||||
Now you should be able to build or run any of the command examples:
|
||||
|
||||
@@ -316,7 +316,7 @@ Now you should be able to build or run any of the command examples:
|
||||
The version program should output the following:
|
||||
|
||||
gocv version: 0.2.0
|
||||
opencv lib version: 3.3.1
|
||||
opencv lib version: 3.4.0
|
||||
|
||||
## How to contribute
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ package contrib
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"gocv.io/x/gocv"
|
||||
"unsafe"
|
||||
|
||||
"gocv.io/x/gocv"
|
||||
)
|
||||
|
||||
type PredictResponse struct {
|
||||
@@ -21,7 +22,7 @@ type LBPHFaceRecognizer struct {
|
||||
|
||||
// Create new LBPH Recognizer model
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html
|
||||
// see https://docs.opencv.org/3.4.0/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html
|
||||
//
|
||||
func NewLBPHFaceRecognizer() *LBPHFaceRecognizer {
|
||||
return &LBPHFaceRecognizer{p: C.CreateLBPHFaceRecognizer()}
|
||||
@@ -29,7 +30,7 @@ func NewLBPHFaceRecognizer() *LBPHFaceRecognizer {
|
||||
|
||||
// Train loaded model with images and their labels
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ac8680c2aa9649ad3f55e27761165c0d6
|
||||
// see https://docs.opencv.org/3.4.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ac8680c2aa9649ad3f55e27761165c0d6
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) Train(images []gocv.Mat, labels []int) {
|
||||
cparams := []C.int{}
|
||||
@@ -54,7 +55,7 @@ func (fr *LBPHFaceRecognizer) Train(images []gocv.Mat, labels []int) {
|
||||
|
||||
// update existing trained model with new images and labels
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a8a4e73ea878dcd0c235d0487189d25f3
|
||||
// see https://docs.opencv.org/3.4.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a8a4e73ea878dcd0c235d0487189d25f3
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) Update(newImages []gocv.Mat, newLabels []int) {
|
||||
cparams := []C.int{}
|
||||
@@ -79,7 +80,7 @@ func (fr *LBPHFaceRecognizer) Update(newImages []gocv.Mat, newLabels []int) {
|
||||
|
||||
// predict image for trained model, retun label for correctly predicted image, return -1 if not found
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#aa2d2f02faffab1bf01317ae6502fb631
|
||||
// see https://docs.opencv.org/3.4.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#aa2d2f02faffab1bf01317ae6502fb631
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) Predict(sample gocv.Mat) int {
|
||||
label := C.LBPHFaceRecognizer_Predict(fr.p, (C.Mat)(sample.Ptr()))
|
||||
@@ -89,7 +90,7 @@ func (fr *LBPHFaceRecognizer) Predict(sample gocv.Mat) int {
|
||||
|
||||
// the same as above but returns some more info
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ab0d593e53ebd9a0f350c989fcac7f251
|
||||
// see https://docs.opencv.org/3.4.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ab0d593e53ebd9a0f350c989fcac7f251
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) PredictExtendedResponse(sample gocv.Mat) PredictResponse {
|
||||
respp := C.LBPHFaceRecognizer_PredictExtended(fr.p, (C.Mat)(sample.Ptr()))
|
||||
@@ -103,7 +104,7 @@ func (fr *LBPHFaceRecognizer) PredictExtendedResponse(sample gocv.Mat) PredictRe
|
||||
|
||||
// set Threshold value
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a3182081e5f8023e658ad8ab96656dd63
|
||||
// see https://docs.opencv.org/3.4.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a3182081e5f8023e658ad8ab96656dd63
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) SetThreshold(threshold float32) {
|
||||
C.LBPHFaceRecognizer_SetThreshold(fr.p, (C.double)(threshold))
|
||||
@@ -111,7 +112,7 @@ func (fr *LBPHFaceRecognizer) SetThreshold(threshold float32) {
|
||||
|
||||
// set Neighbors
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ab225f7bf353ce8697a506eda10124a92
|
||||
// see https://docs.opencv.org/3.4.0/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ab225f7bf353ce8697a506eda10124a92
|
||||
// wrong neighbors can raise opencv exception!
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) SetNeighbors(neighbors int) {
|
||||
@@ -120,7 +121,7 @@ func (fr *LBPHFaceRecognizer) SetNeighbors(neighbors int) {
|
||||
|
||||
// get Neighbors
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a50a3e2ca6e8464166e153c9df84b0a77
|
||||
// see https://docs.opencv.org/3.4.0/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a50a3e2ca6e8464166e153c9df84b0a77
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) GetNeighbors() int {
|
||||
n := C.LBPHFaceRecognizer_GetNeighbors(fr.p)
|
||||
@@ -130,7 +131,7 @@ func (fr *LBPHFaceRecognizer) GetNeighbors() int {
|
||||
|
||||
// set Radius
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a62d94c75cade902fd3b487b1ef9883fc
|
||||
// see https://docs.opencv.org/3.4.0/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a62d94c75cade902fd3b487b1ef9883fc
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) SetRadius(radius int) {
|
||||
C.LBPHFaceRecognizer_SetRadius(fr.p, (C.int)(radius))
|
||||
@@ -138,7 +139,7 @@ func (fr *LBPHFaceRecognizer) SetRadius(radius int) {
|
||||
|
||||
// save trained model data to file
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a2adf2d555550194244b05c91fefcb4d6
|
||||
// see https://docs.opencv.org/3.4.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a2adf2d555550194244b05c91fefcb4d6
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) SaveFile(fname string) {
|
||||
cName := C.CString(fname)
|
||||
@@ -148,7 +149,7 @@ func (fr *LBPHFaceRecognizer) SaveFile(fname string) {
|
||||
|
||||
// load traned model data from file
|
||||
//
|
||||
// see https://docs.opencv.org/3.3.1/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#acc42e5b04595dba71f0777c7179af8c3
|
||||
// see https://docs.opencv.org/3.4.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#acc42e5b04595dba71f0777c7179af8c3
|
||||
//
|
||||
func (fr *LBPHFaceRecognizer) LoadFile(fname string) {
|
||||
cName := C.CString(fname)
|
||||
|
||||
@@ -22,7 +22,7 @@ type SIFT struct {
|
||||
// NewSIFT returns a new SIFT algorithm.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html
|
||||
// https://docs.opencv.org/3.4.0/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html
|
||||
//
|
||||
func NewSIFT() SIFT {
|
||||
return SIFT{p: unsafe.Pointer(C.SIFT_Create())}
|
||||
@@ -38,7 +38,7 @@ func (d *SIFT) Close() error {
|
||||
// Detect keypoints in an image using SIFT.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (d *SIFT) Detect(src gocv.Mat) []gocv.KeyPoint {
|
||||
ret := C.SIFT_Detect((C.SIFT)(d.p), C.Mat(src.Ptr()))
|
||||
@@ -50,7 +50,7 @@ func (d *SIFT) Detect(src gocv.Mat) []gocv.KeyPoint {
|
||||
// DetectAndCompute detects and computes keypoints in an image using SIFT.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
//
|
||||
func (d *SIFT) DetectAndCompute(src gocv.Mat, mask gocv.Mat) ([]gocv.KeyPoint, gocv.Mat) {
|
||||
desc := gocv.NewMat()
|
||||
@@ -70,7 +70,7 @@ type SURF struct {
|
||||
// NewSURF returns a new SURF algorithm.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/df7/classcv_1_1xfeatures2d_1_1SURF.html
|
||||
// https://docs.opencv.org/3.4.0/d5/df7/classcv_1_1xfeatures2d_1_1SURF.html
|
||||
//
|
||||
func NewSURF() SURF {
|
||||
return SURF{p: unsafe.Pointer(C.SURF_Create())}
|
||||
@@ -86,7 +86,7 @@ func (d *SURF) Close() error {
|
||||
// Detect keypoints in an image using SURF.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (d *SURF) Detect(src gocv.Mat) []gocv.KeyPoint {
|
||||
ret := C.SURF_Detect((C.SURF)(d.p), C.Mat(src.Ptr()))
|
||||
@@ -98,7 +98,7 @@ func (d *SURF) Detect(src gocv.Mat) []gocv.KeyPoint {
|
||||
// DetectAndCompute detects and computes keypoints in an image using SURF.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
//
|
||||
func (d *SURF) DetectAndCompute(src gocv.Mat, mask gocv.Mat) ([]gocv.KeyPoint, gocv.Mat) {
|
||||
desc := gocv.NewMat()
|
||||
|
||||
40
core.go
40
core.go
@@ -68,7 +68,7 @@ const (
|
||||
// vector fields, point clouds, tensors, and histograms.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d3/d63/classcv_1_1Mat.html
|
||||
// http://docs.opencv.org/3.4.0/d3/d63/classcv_1_1Mat.html
|
||||
//
|
||||
type Mat struct {
|
||||
p C.Mat
|
||||
@@ -152,7 +152,7 @@ func (m *Mat) Mean() Scalar {
|
||||
// Indices of the entries are taken from the input array.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gab55b8d062b7f5587720ede032d34156f
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#gab55b8d062b7f5587720ede032d34156f
|
||||
func LUT(src, wbLUT, dst Mat) {
|
||||
C.LUT(src.p, wbLUT.p, dst.p)
|
||||
}
|
||||
@@ -243,7 +243,7 @@ func (m *Mat) SetDoubleAt(row int, col int, val float64) {
|
||||
// or between an array and a scalar.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga6fef31bc8c4071cbc114a758a2b79c14
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga6fef31bc8c4071cbc114a758a2b79c14
|
||||
//
|
||||
func AbsDiff(src1 Mat, src2 Mat, dst Mat) {
|
||||
C.Mat_AbsDiff(src1.p, src2.p, dst.p)
|
||||
@@ -252,7 +252,7 @@ func AbsDiff(src1 Mat, src2 Mat, dst Mat) {
|
||||
// Add calculates the per-element sum of two arrays or an array and a scalar.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga10ac1bfb180e2cfda1701d06c24fdbd6
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga10ac1bfb180e2cfda1701d06c24fdbd6
|
||||
//
|
||||
func Add(src1 Mat, src2 Mat, dst Mat) {
|
||||
C.Mat_Add(src1.p, src2.p, dst.p)
|
||||
@@ -261,7 +261,7 @@ func Add(src1 Mat, src2 Mat, dst Mat) {
|
||||
// AddWeighted calculates the weighted sum of two arrays.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gafafb2513349db3bcff51f54ee5592a19
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#gafafb2513349db3bcff51f54ee5592a19
|
||||
//
|
||||
func AddWeighted(src1 Mat, alpha float64, src2 Mat, beta float64, gamma float64, dst Mat) {
|
||||
C.Mat_AddWeighted(src1.p, C.double(alpha),
|
||||
@@ -273,7 +273,7 @@ func AddWeighted(src1 Mat, alpha float64, src2 Mat, beta float64, gamma float64,
|
||||
// or an array and a scalar.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga60b4d04b251ba5eb1392c34425497e14
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga60b4d04b251ba5eb1392c34425497e14
|
||||
//
|
||||
func BitwiseAnd(src1 Mat, src2 Mat, dst Mat) {
|
||||
C.Mat_BitwiseAnd(src1.p, src2.p, dst.p)
|
||||
@@ -282,7 +282,7 @@ func BitwiseAnd(src1 Mat, src2 Mat, dst Mat) {
|
||||
// BitwiseNot inverts every bit of an array.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga0002cf8b418479f4cb49a75442baee2f
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga0002cf8b418479f4cb49a75442baee2f
|
||||
//
|
||||
func BitwiseNot(src1 Mat, dst Mat) {
|
||||
C.Mat_BitwiseNot(src1.p, dst.p)
|
||||
@@ -292,7 +292,7 @@ func BitwiseNot(src1 Mat, dst Mat) {
|
||||
// or an array and a scalar.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gab85523db362a4e26ff0c703793a719b4
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#gab85523db362a4e26ff0c703793a719b4
|
||||
//
|
||||
func BitwiseOr(src1 Mat, src2 Mat, dst Mat) {
|
||||
C.Mat_BitwiseOr(src1.p, src2.p, dst.p)
|
||||
@@ -302,7 +302,7 @@ func BitwiseOr(src1 Mat, src2 Mat, dst Mat) {
|
||||
// on two arrays or an array and a scalar.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga84b2d8188ce506593dcc3f8cd00e8e2c
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga84b2d8188ce506593dcc3f8cd00e8e2c
|
||||
//
|
||||
func BitwiseXor(src1 Mat, src2 Mat, dst Mat) {
|
||||
C.Mat_BitwiseXor(src1.p, src2.p, dst.p)
|
||||
@@ -311,7 +311,7 @@ func BitwiseXor(src1 Mat, src2 Mat, dst Mat) {
|
||||
// InRange checks if array elements lie between the elements of two Mat arrays.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981
|
||||
//
|
||||
func InRange(src Mat, lb Mat, ub Mat, dst Mat) {
|
||||
C.Mat_InRange(src.p, lb.p, ub.p, dst.p)
|
||||
@@ -321,7 +321,7 @@ func InRange(src Mat, lb Mat, ub Mat, dst Mat) {
|
||||
// for a given vector size.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga6577a2e59968936ae02eb2edde5de299
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga6577a2e59968936ae02eb2edde5de299
|
||||
//
|
||||
func GetOptimalDFTSize(vecsize int) int {
|
||||
return int(C.Mat_GetOptimalDFTSize(C.int(vecsize)))
|
||||
@@ -331,7 +331,7 @@ func GetOptimalDFTSize(vecsize int) int {
|
||||
// of a 1D or 2D floating-point array.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gadd6cf9baf2b8b704a11b5f04aaf4f39d
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#gadd6cf9baf2b8b704a11b5f04aaf4f39d
|
||||
//
|
||||
func DFT(src Mat, dst Mat) {
|
||||
C.Mat_DFT(src.p, dst.p)
|
||||
@@ -340,7 +340,7 @@ func DFT(src Mat, dst Mat) {
|
||||
// Merge creates one multi-channel array out of several single-channel ones.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga7d7b4d6c6ee504b30a20b1680029c7b4
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga7d7b4d6c6ee504b30a20b1680029c7b4
|
||||
//
|
||||
func Merge(mv []Mat, dst Mat) {
|
||||
cMatArray := make([]C.Mat, len(mv))
|
||||
@@ -358,7 +358,7 @@ func Merge(mv []Mat, dst Mat) {
|
||||
// NormType for normalization operations.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gad12cefbcb5291cf958a85b4b67b6149f
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#gad12cefbcb5291cf958a85b4b67b6149f
|
||||
//
|
||||
type NormType int
|
||||
|
||||
@@ -377,7 +377,7 @@ const (
|
||||
// Normalize normalizes the norm or value range of an array.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd
|
||||
//
|
||||
func Normalize(src Mat, dst Mat, alpha float64, beta float64, typ NormType) {
|
||||
C.Mat_Normalize(src.p, dst.p, C.double(alpha), C.double(beta), C.int(typ))
|
||||
@@ -386,7 +386,7 @@ func Normalize(src Mat, dst Mat, alpha float64, beta float64, typ NormType) {
|
||||
// Norm calculates the absolute norm of an array.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga7c331fb8dd951707e184ef4e3f21dd33
|
||||
// https://docs.opencv.org/3.4.0/d2/de8/group__core__array.html#ga7c331fb8dd951707e184ef4e3f21dd33
|
||||
//
|
||||
func Norm(src1 Mat, normType NormType) float64 {
|
||||
return float64(C.Norm(src1.p, C.int(normType)))
|
||||
@@ -395,7 +395,7 @@ func Norm(src1 Mat, normType NormType) float64 {
|
||||
// TermCriteriaType for TermCriteria.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57
|
||||
// https://docs.opencv.org/3.4.0/d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57
|
||||
//
|
||||
type TermCriteriaType int
|
||||
|
||||
@@ -414,7 +414,7 @@ const (
|
||||
// TermCriteria is the criteria for iterative algorithms.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d9/d5d/classcv_1_1TermCriteria.html
|
||||
// https://docs.opencv.org/3.4.0/d9/d5d/classcv_1_1TermCriteria.html
|
||||
//
|
||||
type TermCriteria struct {
|
||||
p C.TermCriteria
|
||||
@@ -428,7 +428,7 @@ func NewTermCriteria(typ TermCriteriaType, maxCount int, epsilon float64) TermCr
|
||||
// Scalar is a 4-element vector widely used in OpenCV to pass pixel values.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d1/da0/classcv_1_1Scalar__.html
|
||||
// http://docs.opencv.org/3.4.0/d1/da0/classcv_1_1Scalar__.html
|
||||
//
|
||||
type Scalar struct {
|
||||
Val1 float64
|
||||
@@ -446,7 +446,7 @@ func NewScalar(v1 float64, v2 float64, v3 float64, v4 float64) Scalar {
|
||||
// KeyPoint is data structure for salient point detectors.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d2/d29/classcv_1_1KeyPoint.html
|
||||
// https://docs.opencv.org/3.4.0/d2/d29/classcv_1_1KeyPoint.html
|
||||
//
|
||||
type KeyPoint struct {
|
||||
X, Y float64
|
||||
|
||||
@@ -19,7 +19,7 @@ type AKAZE struct {
|
||||
// NewAKAZE returns a new AKAZE algorithm
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d8/d30/classcv_1_1AKAZE.html
|
||||
// https://docs.opencv.org/3.4.0/d8/d30/classcv_1_1AKAZE.html
|
||||
//
|
||||
func NewAKAZE() AKAZE {
|
||||
return AKAZE{p: unsafe.Pointer(C.AKAZE_Create())}
|
||||
@@ -35,7 +35,7 @@ func (a *AKAZE) Close() error {
|
||||
// Detect keypoints in an image using AKAZE.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (a *AKAZE) Detect(src Mat) []KeyPoint {
|
||||
ret := C.AKAZE_Detect((C.AKAZE)(a.p), src.p)
|
||||
@@ -47,7 +47,7 @@ func (a *AKAZE) Detect(src Mat) []KeyPoint {
|
||||
// Detect keypoints and compute in an image using AKAZE.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
//
|
||||
func (a *AKAZE) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {
|
||||
desc := NewMat()
|
||||
@@ -66,7 +66,7 @@ type AgastFeatureDetector struct {
|
||||
// NewAgastFeatureDetector returns a new AgastFeatureDetector algorithm
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/d19/classcv_1_1AgastFeatureDetector.html
|
||||
// https://docs.opencv.org/3.4.0/d7/d19/classcv_1_1AgastFeatureDetector.html
|
||||
//
|
||||
func NewAgastFeatureDetector() AgastFeatureDetector {
|
||||
return AgastFeatureDetector{p: unsafe.Pointer(C.AgastFeatureDetector_Create())}
|
||||
@@ -82,7 +82,7 @@ func (a *AgastFeatureDetector) Close() error {
|
||||
// Detect keypoints in an image using AgastFeatureDetector.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (a *AgastFeatureDetector) Detect(src Mat) []KeyPoint {
|
||||
ret := C.AgastFeatureDetector_Detect((C.AgastFeatureDetector)(a.p), src.p)
|
||||
@@ -100,7 +100,7 @@ type BRISK struct {
|
||||
// NewBRISK returns a new BRISK algorithm
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d8/d30/classcv_1_1AKAZE.html
|
||||
// https://docs.opencv.org/3.4.0/d8/d30/classcv_1_1AKAZE.html
|
||||
//
|
||||
func NewBRISK() BRISK {
|
||||
return BRISK{p: unsafe.Pointer(C.BRISK_Create())}
|
||||
@@ -116,7 +116,7 @@ func (b *BRISK) Close() error {
|
||||
// Detect keypoints in an image using BRISK.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (b *BRISK) Detect(src Mat) []KeyPoint {
|
||||
ret := C.BRISK_Detect((C.BRISK)(b.p), src.p)
|
||||
@@ -128,7 +128,7 @@ func (b *BRISK) Detect(src Mat) []KeyPoint {
|
||||
// Detect keypoints and compute in an image using BRISK.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
//
|
||||
func (b *BRISK) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {
|
||||
desc := NewMat()
|
||||
@@ -147,7 +147,7 @@ type FastFeatureDetector struct {
|
||||
// NewFastFeatureDetector returns a new FastFeatureDetector algorithm
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/df/d74/classcv_1_1FastFeatureDetector.html
|
||||
// https://docs.opencv.org/3.4.0/df/d74/classcv_1_1FastFeatureDetector.html
|
||||
//
|
||||
func NewFastFeatureDetector() FastFeatureDetector {
|
||||
return FastFeatureDetector{p: unsafe.Pointer(C.FastFeatureDetector_Create())}
|
||||
@@ -163,7 +163,7 @@ func (f *FastFeatureDetector) Close() error {
|
||||
// Detect keypoints in an image using FastFeatureDetector.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (f *FastFeatureDetector) Detect(src Mat) []KeyPoint {
|
||||
ret := C.FastFeatureDetector_Detect((C.FastFeatureDetector)(f.p), src.p)
|
||||
@@ -181,7 +181,7 @@ type ORB struct {
|
||||
// NewORB returns a new ORB algorithm
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/d19/classcv_1_1AgastFeatureDetector.html
|
||||
// https://docs.opencv.org/3.4.0/d7/d19/classcv_1_1AgastFeatureDetector.html
|
||||
//
|
||||
func NewORB() ORB {
|
||||
return ORB{p: unsafe.Pointer(C.ORB_Create())}
|
||||
@@ -197,7 +197,7 @@ func (o *ORB) Close() error {
|
||||
// Detect keypoints in an image using ORB.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (o *ORB) Detect(src Mat) []KeyPoint {
|
||||
ret := C.ORB_Detect((C.ORB)(o.p), src.p)
|
||||
@@ -209,7 +209,7 @@ func (o *ORB) Detect(src Mat) []KeyPoint {
|
||||
// Detect keypoints and compute in an image using ORB.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
|
||||
//
|
||||
func (o *ORB) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {
|
||||
desc := NewMat()
|
||||
@@ -228,7 +228,7 @@ type SimpleBlobDetector struct {
|
||||
// NewSimpleBlobDetector returns a new SimpleBlobDetector algorithm
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d7a/classcv_1_1SimpleBlobDetector.html
|
||||
// https://docs.opencv.org/3.4.0/d0/d7a/classcv_1_1SimpleBlobDetector.html
|
||||
//
|
||||
func NewSimpleBlobDetector() SimpleBlobDetector {
|
||||
return SimpleBlobDetector{p: unsafe.Pointer(C.SimpleBlobDetector_Create())}
|
||||
@@ -244,7 +244,7 @@ func (b *SimpleBlobDetector) Close() error {
|
||||
// Detect keypoints in an image using SimpleBlobDetector.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
// https://docs.opencv.org/3.4.0/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
|
||||
//
|
||||
func (b *SimpleBlobDetector) Detect(src Mat) []KeyPoint {
|
||||
ret := C.SimpleBlobDetector_Detect((C.SimpleBlobDetector)(b.p), src.p)
|
||||
|
||||
2
gocv.go
2
gocv.go
@@ -6,6 +6,6 @@
|
||||
// computer vision algorithms.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d1/dfb/intro.html
|
||||
// http://docs.opencv.org/3.4.0/d1/dfb/intro.html
|
||||
//
|
||||
package gocv // import "gocv.io/x/gocv"
|
||||
|
||||
34
highgui.go
34
highgui.go
@@ -19,7 +19,7 @@ import (
|
||||
// quickly and visualize the results. This is what the HighGUI module has been designed for.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html
|
||||
// http://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html
|
||||
//
|
||||
type Window struct {
|
||||
name string
|
||||
@@ -29,7 +29,7 @@ type Window struct {
|
||||
// NewWindow creates a new named OpenCV window
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b
|
||||
// http://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b
|
||||
//
|
||||
func NewWindow(name string) *Window {
|
||||
runtime.LockOSThread()
|
||||
@@ -45,7 +45,7 @@ func NewWindow(name string) *Window {
|
||||
// Close closes and deletes a named OpenCV Window.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga851ccdd6961022d1d5b4c4f255dbab34
|
||||
// http://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga851ccdd6961022d1d5b4c4f255dbab34
|
||||
//
|
||||
func (w *Window) Close() error {
|
||||
cName := C.CString(w.name)
|
||||
@@ -100,7 +100,7 @@ const (
|
||||
// GetWindowProperty returns properties of a window.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#gaaf9504b8f9cf19024d9d44a14e461656
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#gaaf9504b8f9cf19024d9d44a14e461656
|
||||
//
|
||||
func (w *Window) GetWindowProperty(flag WindowPropertyFlag) float64 {
|
||||
cName := C.CString(w.name)
|
||||
@@ -112,7 +112,7 @@ func (w *Window) GetWindowProperty(flag WindowPropertyFlag) float64 {
|
||||
// SetWindowProperty changes parameters of a window dynamically.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga66e4a6db4d4e06148bcdfe0d70a5df27
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga66e4a6db4d4e06148bcdfe0d70a5df27
|
||||
//
|
||||
func (w *Window) SetWindowProperty(flag WindowPropertyFlag, value WindowFlag) {
|
||||
cName := C.CString(w.name)
|
||||
@@ -124,7 +124,7 @@ func (w *Window) SetWindowProperty(flag WindowPropertyFlag, value WindowFlag) {
|
||||
// SetWindowTitle updates window title.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga56f8849295fd10d0c319724ddb773d96
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga56f8849295fd10d0c319724ddb773d96
|
||||
//
|
||||
func (w *Window) SetWindowTitle(title string) {
|
||||
cName := C.CString(w.name)
|
||||
@@ -141,7 +141,7 @@ func (w *Window) SetWindowTitle(title string) {
|
||||
// the image for specified milliseconds. Otherwise, it won't display the image.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563
|
||||
// http://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563
|
||||
//
|
||||
func (w *Window) IMShow(img Mat) {
|
||||
cName := C.CString(w.name)
|
||||
@@ -156,7 +156,7 @@ func (w *Window) IMShow(img Mat) {
|
||||
// for normal event processing
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7
|
||||
// http://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7
|
||||
//
|
||||
func (w *Window) WaitKey(delay int) int {
|
||||
return int(C.Window_WaitKey(C.int(delay)))
|
||||
@@ -165,7 +165,7 @@ func (w *Window) WaitKey(delay int) int {
|
||||
// MoveWindow moves window to the specified position.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga8d86b207f7211250dbe6e28f76307ffb
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga8d86b207f7211250dbe6e28f76307ffb
|
||||
//
|
||||
func (w *Window) MoveWindow(x, y int) {
|
||||
cName := C.CString(w.name)
|
||||
@@ -177,7 +177,7 @@ func (w *Window) MoveWindow(x, y int) {
|
||||
// ResizeWindow resizes window to the specified size.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga9e80e080f7ef33f897e415358aee7f7e
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga9e80e080f7ef33f897e415358aee7f7e
|
||||
//
|
||||
func (w *Window) ResizeWindow(width, height int) {
|
||||
cName := C.CString(w.name)
|
||||
@@ -194,7 +194,7 @@ func (w *Window) ResizeWindow(width, height int) {
|
||||
// use key c to cancel selection (function will return a zero Rect).
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga8daf4730d3adf7035b6de9be4c469af5
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga8daf4730d3adf7035b6de9be4c469af5
|
||||
//
|
||||
func SelectROI(name string, img Mat) image.Rectangle {
|
||||
cName := C.CString(name)
|
||||
@@ -213,7 +213,7 @@ func SelectROI(name string, img Mat) image.Rectangle {
|
||||
// use esc to terminate multiple ROI selection process
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga0f11fad74a6432b8055fb21621a0f893
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga0f11fad74a6432b8055fb21621a0f893
|
||||
//
|
||||
func SelectROIs(name string, img Mat) []image.Rectangle {
|
||||
cName := C.CString(name)
|
||||
@@ -254,7 +254,7 @@ type Trackbar struct {
|
||||
// CreateTrackbar creates a trackbar and attaches it to the specified window.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#gaf78d2155d30b728fc413803745b67a9b
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#gaf78d2155d30b728fc413803745b67a9b
|
||||
//
|
||||
func (w *Window) CreateTrackbar(name string, max int) *Trackbar {
|
||||
cName := C.CString(w.name)
|
||||
@@ -270,7 +270,7 @@ func (w *Window) CreateTrackbar(name string, max int) *Trackbar {
|
||||
// GetPos returns the trackbar position.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga122632e9e91b9ec06943472c55d9cda8
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga122632e9e91b9ec06943472c55d9cda8
|
||||
//
|
||||
func (t *Trackbar) GetPos() int {
|
||||
cName := C.CString(t.parent.name)
|
||||
@@ -285,7 +285,7 @@ func (t *Trackbar) GetPos() int {
|
||||
// SetPos sets the trackbar position.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga67d73c4c9430f13481fd58410d01bd8d
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga67d73c4c9430f13481fd58410d01bd8d
|
||||
//
|
||||
func (t *Trackbar) SetPos(pos int) {
|
||||
cName := C.CString(t.parent.name)
|
||||
@@ -300,7 +300,7 @@ func (t *Trackbar) SetPos(pos int) {
|
||||
// SetMin sets the trackbar minimum position.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#gabe26ffe8d2b60cc678895595a581b7aa
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#gabe26ffe8d2b60cc678895595a581b7aa
|
||||
//
|
||||
func (t *Trackbar) SetMin(pos int) {
|
||||
cName := C.CString(t.parent.name)
|
||||
@@ -315,7 +315,7 @@ func (t *Trackbar) SetMin(pos int) {
|
||||
// SetMax sets the trackbar maximum position.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga7e5437ccba37f1154b65210902fc4480
|
||||
// https://docs.opencv.org/3.4.0/d7/dfc/group__highgui.html#ga7e5437ccba37f1154b65210902fc4480
|
||||
//
|
||||
func (t *Trackbar) SetMax(pos int) {
|
||||
cName := C.CString(t.parent.name)
|
||||
|
||||
10
imgcodecs.go
10
imgcodecs.go
@@ -124,7 +124,7 @@ const (
|
||||
// unsupported or invalid format), the function returns an empty Mat.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56
|
||||
// http://docs.opencv.org/3.4.0/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56
|
||||
//
|
||||
func IMRead(name string, flags IMReadFlag) Mat {
|
||||
cName := C.CString(name)
|
||||
@@ -136,7 +136,7 @@ func IMRead(name string, flags IMReadFlag) Mat {
|
||||
// IMWrite writes a Mat to an image file.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
|
||||
// http://docs.opencv.org/3.4.0/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
|
||||
//
|
||||
func IMWrite(name string, img Mat) bool {
|
||||
cName := C.CString(name)
|
||||
@@ -149,7 +149,7 @@ func IMWrite(name string, img Mat) bool {
|
||||
// With that func you can pass compression parameters
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
|
||||
// http://docs.opencv.org/3.4.0/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
|
||||
//
|
||||
func IMWriteWithParams(name string, img Mat, params []int) bool {
|
||||
cName := C.CString(name)
|
||||
@@ -173,7 +173,7 @@ func IMWriteWithParams(name string, img Mat, params []int) bool {
|
||||
// using the image format passed in in the form of a file extension string.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#ga461f9ac09887e47797a54567df3b8b63
|
||||
// http://docs.opencv.org/3.4.0/d4/da8/group__imgcodecs.html#ga461f9ac09887e47797a54567df3b8b63
|
||||
//
|
||||
func IMEncode(fileExt string, img Mat) (buf []byte, err error) {
|
||||
cfileExt := C.CString(fileExt)
|
||||
@@ -190,7 +190,7 @@ func IMEncode(fileExt string, img Mat) (buf []byte, err error) {
|
||||
// returns an empty matrix.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#ga26a67788faa58ade337f8d28ba0eb19e
|
||||
// https://docs.opencv.org/3.4.0/d4/da8/group__imgcodecs.html#ga26a67788faa58ade337f8d28ba0eb19e
|
||||
//
|
||||
func IMDecode(buf []byte, flags IMReadFlag) Mat {
|
||||
data := toByteArray(buf)
|
||||
|
||||
64
imgproc.go
64
imgproc.go
@@ -17,7 +17,7 @@ import (
|
||||
// code param containing the desired ColorConversionCode color space.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
|
||||
// http://docs.opencv.org/3.4.0/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
|
||||
//
|
||||
func CvtColor(src Mat, dst Mat, code ColorConversionCode) {
|
||||
C.CvtColor(src.p, dst.p, C.int(code))
|
||||
@@ -30,7 +30,7 @@ func CvtColor(src Mat, dst Mat, code ColorConversionCode) {
|
||||
// fairly sharp. However, it is very slow compared to most filters.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed
|
||||
//
|
||||
func BilateralFilter(src Mat, dst Mat, d int, sigmaColor float64, sigmaSpace float64) {
|
||||
C.BilateralFilter(src.p, dst.p, C.int(d), C.double(sigmaColor), C.double(sigmaSpace))
|
||||
@@ -41,7 +41,7 @@ func BilateralFilter(src Mat, dst Mat, d int, sigmaColor float64, sigmaSpace flo
|
||||
// the specified Gaussian kernel params.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
|
||||
// http://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
|
||||
//
|
||||
func Blur(src Mat, dst Mat, ksize image.Point) {
|
||||
pSize := C.struct_Size{
|
||||
@@ -55,7 +55,7 @@ func Blur(src Mat, dst Mat, ksize image.Point) {
|
||||
// Dilate dilates an image by using a specific structuring element.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c
|
||||
//
|
||||
func Dilate(src Mat, dst Mat, kernel Mat) {
|
||||
C.Dilate(src.p, dst.p, kernel.p)
|
||||
@@ -64,7 +64,7 @@ func Dilate(src Mat, dst Mat, kernel Mat) {
|
||||
// Erode erodes an image by using a specific structuring element.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb
|
||||
//
|
||||
func Erode(src Mat, dst Mat, kernel Mat) {
|
||||
C.Erode(src.p, dst.p, kernel.p)
|
||||
@@ -213,7 +213,7 @@ func FindContours(src Mat, mode RetrievalMode, method ContourApproximationMode)
|
||||
// or rasterized shape.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d3/dc0/group__imgproc__shape.html#ga556a180f43cab22649c23ada36a8a139
|
||||
// https://docs.opencv.org/3.4.0/d3/dc0/group__imgproc__shape.html#ga556a180f43cab22649c23ada36a8a139
|
||||
//
|
||||
func Moments(src Mat, binaryImage bool) map[string]float64 {
|
||||
r := C.Moments(src.p, C.bool(binaryImage))
|
||||
@@ -250,7 +250,7 @@ func Moments(src Mat, binaryImage bool) map[string]float64 {
|
||||
// MorphologyEx performs advanced morphological transformations.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f
|
||||
//
|
||||
func MorphologyEx(src Mat, dst Mat, op MorphType, kernel Mat) {
|
||||
C.MorphologyEx(src.p, dst.p, C.int(op), kernel.p)
|
||||
@@ -274,7 +274,7 @@ const (
|
||||
// and shape for morphological operations.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc
|
||||
//
|
||||
func GetStructuringElement(shape MorphShape, ksize image.Point) Mat {
|
||||
sz := C.struct_Size{
|
||||
@@ -345,7 +345,7 @@ const (
|
||||
// the specified Gaussian kernel params.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
|
||||
// http://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
|
||||
//
|
||||
func GaussianBlur(src Mat, dst Mat, ksize image.Point, sigmaX float64,
|
||||
sigmaY float64, borderType BorderType) {
|
||||
@@ -360,7 +360,7 @@ func GaussianBlur(src Mat, dst Mat, ksize image.Point, sigmaX float64,
|
||||
// Laplacian calculates the Laplacian of an image.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6
|
||||
//
|
||||
func Laplacian(src Mat, dst Mat, dDepth int, kSize int, scale float64,
|
||||
delta float64, borderType BorderType) {
|
||||
@@ -370,7 +370,7 @@ func Laplacian(src Mat, dst Mat, dDepth int, kSize int, scale float64,
|
||||
// Scharr calculates the first x- or y- image derivative using Scharr operator.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9
|
||||
//
|
||||
func Scharr(src Mat, dst Mat, dDepth int, dx int, dy int, scale float64,
|
||||
delta float64, borderType BorderType) {
|
||||
@@ -380,7 +380,7 @@ func Scharr(src Mat, dst Mat, dDepth int, dx int, dy int, scale float64,
|
||||
// MedianBlur blurs an image using the median filter.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9
|
||||
// https://docs.opencv.org/3.4.0/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9
|
||||
//
|
||||
func MedianBlur(src Mat, dst Mat, ksize int) {
|
||||
C.MedianBlur(src.p, dst.p, C.int(ksize))
|
||||
@@ -395,7 +395,7 @@ func MedianBlur(src Mat, dst Mat, ksize int) {
|
||||
// See http://en.wikipedia.org/wiki/Canny_edge_detector
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de
|
||||
// http://docs.opencv.org/3.4.0/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de
|
||||
//
|
||||
func Canny(src Mat, edges Mat, t1 float32, t2 float32) {
|
||||
C.Canny(src.p, edges.p, C.double(t1), C.double(t2))
|
||||
@@ -405,7 +405,7 @@ func Canny(src Mat, edges Mat, t1 float32, t2 float32) {
|
||||
// the sub-pixel accurate location of corners or radial saddle points.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga354e0d7c86d0d9da75de9b9701a9a87e
|
||||
// https://docs.opencv.org/3.4.0/dd/d1a/group__imgproc__feature.html#ga354e0d7c86d0d9da75de9b9701a9a87e
|
||||
//
|
||||
func CornerSubPix(img Mat, corners Mat, winSize image.Point, zeroZone image.Point, criteria TermCriteria) {
|
||||
winSz := C.struct_Size{
|
||||
@@ -426,7 +426,7 @@ func CornerSubPix(img Mat, corners Mat, winSize image.Point, zeroZone image.Poin
|
||||
// finds the most prominent corners in the image or in the specified image region.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541
|
||||
// https://docs.opencv.org/3.4.0/dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541
|
||||
//
|
||||
func GoodFeaturesToTrack(img Mat, corners Mat, maxCorners int, quality float64, minDist float64) {
|
||||
C.GoodFeaturesToTrack(img.p, corners.p, C.int(maxCorners), C.double(quality), C.double(minDist))
|
||||
@@ -436,7 +436,7 @@ func GoodFeaturesToTrack(img Mat, corners Mat, maxCorners int, quality float64,
|
||||
// The only "method" currently supported is HOUGH_GRADIENT = 3.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d
|
||||
// https://docs.opencv.org/3.4.0/dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d
|
||||
//
|
||||
func HoughCircles(src Mat, circles Mat, method int, dp float64, minDist float64) {
|
||||
C.HoughCircles(src.p, circles.p, C.int(method), C.double(dp), C.double(minDist))
|
||||
@@ -447,7 +447,7 @@ func HoughCircles(src Mat, circles Mat, method int, dp float64, minDist float64)
|
||||
// http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga46b4e588934f6c8dfd509cc6e0e4545a
|
||||
// http://docs.opencv.org/3.4.0/dd/d1a/group__imgproc__feature.html#ga46b4e588934f6c8dfd509cc6e0e4545a
|
||||
//
|
||||
func HoughLines(src Mat, lines Mat, rho float32, theta float32, threshold int) {
|
||||
C.HoughLines(src.p, lines.p, C.double(rho), C.double(theta), C.int(threshold))
|
||||
@@ -458,7 +458,7 @@ func HoughLines(src Mat, lines Mat, rho float32, theta float32, threshold int) {
|
||||
// http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb
|
||||
// http://docs.opencv.org/3.4.0/dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb
|
||||
//
|
||||
func HoughLinesP(src Mat, lines Mat, rho float32, theta float32, threshold int) {
|
||||
C.HoughLinesP(src.p, lines.p, C.double(rho), C.double(theta), C.int(threshold))
|
||||
@@ -506,7 +506,7 @@ func Threshold(src Mat, dst Mat, thresh float32, maxvalue float32, typ Threshold
|
||||
// to the second one.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga0a165a3ca093fd488ac709fdf10c05b2
|
||||
// https://docs.opencv.org/3.4.0/d6/d6e/group__imgproc__draw.html#ga0a165a3ca093fd488ac709fdf10c05b2
|
||||
//
|
||||
func ArrowedLine(img Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int) {
|
||||
sp1 := C.struct_Point{
|
||||
@@ -532,7 +532,7 @@ func ArrowedLine(img Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickn
|
||||
// Circle draws a circle.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670
|
||||
// https://docs.opencv.org/3.4.0/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670
|
||||
//
|
||||
func Circle(img Mat, center image.Point, radius int, c color.RGBA, thickness int) {
|
||||
pc := C.struct_Point{
|
||||
@@ -553,7 +553,7 @@ func Circle(img Mat, center image.Point, radius int, c color.RGBA, thickness int
|
||||
// Line draws a line segment connecting two points.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2
|
||||
// https://docs.opencv.org/3.4.0/d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2
|
||||
//
|
||||
func Line(img Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int) {
|
||||
sp1 := C.struct_Point{
|
||||
@@ -580,7 +580,7 @@ func Line(img Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int
|
||||
// It renders a rectangle with the desired characteristics to the target Mat image.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga346ac30b5c74e9b5137576c9ee9e0e8c
|
||||
// http://docs.opencv.org/3.4.0/d6/d6e/group__imgproc__draw.html#ga346ac30b5c74e9b5137576c9ee9e0e8c
|
||||
//
|
||||
func Rectangle(img Mat, r image.Rectangle, c color.RGBA, thickness int) {
|
||||
cRect := C.struct_Rect{
|
||||
@@ -636,7 +636,7 @@ const (
|
||||
// a specific font face, scale, and thickness.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga3d2abfcb995fd2db908c8288199dba82
|
||||
// http://docs.opencv.org/3.4.0/d6/d6e/group__imgproc__draw.html#ga3d2abfcb995fd2db908c8288199dba82
|
||||
//
|
||||
func GetTextSize(text string, fontFace HersheyFont, fontScale float64, thickness int) image.Point {
|
||||
cText := C.CString(text)
|
||||
@@ -652,7 +652,7 @@ func GetTextSize(text string, fontFace HersheyFont, fontScale float64, thickness
|
||||
// color, and line thinkness.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576
|
||||
// http://docs.opencv.org/3.4.0/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576
|
||||
//
|
||||
func PutText(img Mat, text string, org image.Point, fontFace HersheyFont, fontScale float64, c color.RGBA, thickness int) {
|
||||
cText := C.CString(text)
|
||||
@@ -710,7 +710,7 @@ const (
|
||||
// zero for both fx and fy.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d
|
||||
// https://docs.opencv.org/3.4.0/da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d
|
||||
func Resize(src, dst Mat, sz image.Point, fx, fy float64, interp InterpolationFlags) {
|
||||
pSize := C.struct_Size{
|
||||
width: C.int(sz.X),
|
||||
@@ -724,7 +724,7 @@ func Resize(src, dst Mat, sz image.Point, fx, fy float64, interp InterpolationFl
|
||||
// GetRotationMatrix2D calculates an affine matrix of 2D rotation.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/da/d54/group__imgproc__transform.html#gafbbc470ce83812914a70abfb604f4326
|
||||
// https://docs.opencv.org/3.4.0/da/d54/group__imgproc__transform.html#gafbbc470ce83812914a70abfb604f4326
|
||||
func GetRotationMatrix2D(center image.Point, angle, scale float64) Mat {
|
||||
pc := C.struct_Point{
|
||||
x: C.int(center.X),
|
||||
@@ -736,7 +736,7 @@ func GetRotationMatrix2D(center image.Point, angle, scale float64) Mat {
|
||||
// WarpAffine applies an affine transformation to an image. For more parameters please check WarpAffineWithParams
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983
|
||||
// https://docs.opencv.org/3.4.0/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983
|
||||
func WarpAffine(src, dst, m Mat, sz image.Point) {
|
||||
pSize := C.struct_Size{
|
||||
width: C.int(sz.X),
|
||||
@@ -749,7 +749,7 @@ func WarpAffine(src, dst, m Mat, sz image.Point) {
|
||||
// WarpAffineWithParams applies an affine transformation to an image.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983
|
||||
// https://docs.opencv.org/3.4.0/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983
|
||||
func WarpAffineWithParams(src, dst, m Mat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA) {
|
||||
pSize := C.struct_Size{
|
||||
width: C.int(sz.X),
|
||||
@@ -767,13 +767,13 @@ func WarpAffineWithParams(src, dst, m Mat, sz image.Point, flags InterpolationFl
|
||||
// ColormapTypes are the 12 GNU Octave/MATLAB equivalent colormaps.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d3/d50/group__imgproc__colormap.html
|
||||
// https://docs.opencv.org/3.4.0/d3/d50/group__imgproc__colormap.html
|
||||
type ColormapTypes int
|
||||
|
||||
// List of the available color maps
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d3/d50/group__imgproc__colormap.html#ga9a805d8262bcbe273f16be9ea2055a65
|
||||
// https://docs.opencv.org/3.4.0/d3/d50/group__imgproc__colormap.html#ga9a805d8262bcbe273f16be9ea2055a65
|
||||
const (
|
||||
ColormapAutumn ColormapTypes = 0
|
||||
ColormapBone = 1
|
||||
@@ -793,7 +793,7 @@ const (
|
||||
// ApplyColorMap applies a GNU Octave/MATLAB equivalent colormap on a given image.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d3/d50/group__imgproc__colormap.html#gadf478a5e5ff49d8aa24e726ea6f65d15
|
||||
// https://docs.opencv.org/3.4.0/d3/d50/group__imgproc__colormap.html#gadf478a5e5ff49d8aa24e726ea6f65d15
|
||||
func ApplyColorMap(src, dst Mat, colormapType ColormapTypes) {
|
||||
C.ApplyColorMap(src.p, dst.p, C.int(colormapType))
|
||||
}
|
||||
@@ -801,7 +801,7 @@ func ApplyColorMap(src, dst Mat, colormapType ColormapTypes) {
|
||||
// ApplyCustomColorMap applies a custom defined colormap on a given image.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d3/d50/group__imgproc__colormap.html#gacb22288ddccc55f9bd9e6d492b409cae
|
||||
// https://docs.opencv.org/3.4.0/d3/d50/group__imgproc__colormap.html#gacb22288ddccc55f9bd9e6d492b409cae
|
||||
func ApplyCustomColorMap(src, dst, customColormap Mat) {
|
||||
C.ApplyCustomColorMap(src.p, dst.p, customColormap.p)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package gocv
|
||||
// ColorConversionCode is a color conversion code used on Mat.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
|
||||
// http://docs.opencv.org/3.4.0/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
|
||||
//
|
||||
type ColorConversionCode int
|
||||
|
||||
|
||||
20
objdetect.go
20
objdetect.go
@@ -14,7 +14,7 @@ import (
|
||||
// CascadeClassifier is a cascade classifier class for object detection.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html
|
||||
// http://docs.opencv.org/3.4.0/d1/de5/classcv_1_1CascadeClassifier.html
|
||||
//
|
||||
type CascadeClassifier struct {
|
||||
p C.CascadeClassifier
|
||||
@@ -35,7 +35,7 @@ func (c *CascadeClassifier) Close() error {
|
||||
// Load cascade classifier from a file.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html#a1a5884c8cc749422f9eb77c2471958bc
|
||||
// http://docs.opencv.org/3.4.0/d1/de5/classcv_1_1CascadeClassifier.html#a1a5884c8cc749422f9eb77c2471958bc
|
||||
//
|
||||
func (c *CascadeClassifier) Load(name string) bool {
|
||||
cName := C.CString(name)
|
||||
@@ -47,7 +47,7 @@ func (c *CascadeClassifier) Load(name string) bool {
|
||||
// The detected objects are returned as a slice of image.Rectangle structs.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
|
||||
// http://docs.opencv.org/3.4.0/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
|
||||
//
|
||||
func (c *CascadeClassifier) DetectMultiScale(img Mat) []image.Rectangle {
|
||||
ret := C.CascadeClassifier_DetectMultiScale(c.p, img.p)
|
||||
@@ -73,7 +73,7 @@ func (c *CascadeClassifier) DetectMultiScale(img Mat) []image.Rectangle {
|
||||
// to values other than just the defaults.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
|
||||
// http://docs.opencv.org/3.4.0/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
|
||||
//
|
||||
func (c *CascadeClassifier) DetectMultiScaleWithParams(img Mat, scale float64,
|
||||
minNeighbors, flags int, minSize, maxSize image.Point) []image.Rectangle {
|
||||
@@ -111,7 +111,7 @@ func (c *CascadeClassifier) DetectMultiScaleWithParams(img Mat, scale float64,
|
||||
// HOGDescriptor is a Histogram Of Gradiants (HOG) for object detection.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a723b95b709cfd3f95cf9e616de988fc8
|
||||
// https://docs.opencv.org/3.4.0/d5/d33/structcv_1_1HOGDescriptor.html#a723b95b709cfd3f95cf9e616de988fc8
|
||||
//
|
||||
type HOGDescriptor struct {
|
||||
p C.HOGDescriptor
|
||||
@@ -133,7 +133,7 @@ func (h *HOGDescriptor) Close() error {
|
||||
// The detected objects are returned as a slice of image.Rectangle structs.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
|
||||
// https://docs.opencv.org/3.4.0/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
|
||||
//
|
||||
func (h *HOGDescriptor) DetectMultiScale(img Mat) []image.Rectangle {
|
||||
ret := C.HOGDescriptor_DetectMultiScale(h.p, img.p)
|
||||
@@ -159,7 +159,7 @@ func (h *HOGDescriptor) DetectMultiScale(img Mat) []image.Rectangle {
|
||||
// to values other than just the defaults.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
|
||||
// https://docs.opencv.org/3.4.0/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
|
||||
//
|
||||
func (h *HOGDescriptor) DetectMultiScaleWithParams(img Mat, hitThresh float64,
|
||||
winStride, padding image.Point, scale, finalThreshold float64, useMeanshiftGrouping bool) []image.Rectangle {
|
||||
@@ -196,7 +196,7 @@ func (h *HOGDescriptor) DetectMultiScaleWithParams(img Mat, hitThresh float64,
|
||||
// HOGDefaultPeopleDetector returns a new Mat with the HOG DefaultPeopleDetector.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
|
||||
// https://docs.opencv.org/3.4.0/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
|
||||
//
|
||||
func HOGDefaultPeopleDetector() Mat {
|
||||
return Mat{p: C.HOG_GetDefaultPeopleDetector()}
|
||||
@@ -205,7 +205,7 @@ func HOGDefaultPeopleDetector() Mat {
|
||||
// SetSVMDetector sets the data for the HOGDescriptor.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a09e354ad701f56f9c550dc0385dc36f1
|
||||
// https://docs.opencv.org/3.4.0/d5/d33/structcv_1_1HOGDescriptor.html#a09e354ad701f56f9c550dc0385dc36f1
|
||||
//
|
||||
func (h *HOGDescriptor) SetSVMDetector(det Mat) error {
|
||||
C.HOGDescriptor_SetSVMDetector(h.p, det.p)
|
||||
@@ -215,7 +215,7 @@ func (h *HOGDescriptor) SetSVMDetector(det Mat) error {
|
||||
// GroupRectangles groups the object candidate rectangles.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d5/d54/group__objdetect.html#ga3dba897ade8aa8227edda66508e16ab9
|
||||
// https://docs.opencv.org/3.4.0/d5/d54/group__objdetect.html#ga3dba897ade8aa8227edda66508e16ab9
|
||||
//
|
||||
func GroupRectangles(rects []image.Rectangle, groupThreshold int, eps float64) []image.Rectangle {
|
||||
cRectArray := make([]C.struct_Rect, len(rects))
|
||||
|
||||
12
video.go
12
video.go
@@ -18,7 +18,7 @@ type BackgroundSubtractorMOG2 struct {
|
||||
// Segmentation Algorithm.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/d7b/classcv_1_1BackgroundSubtractorMOG2.html
|
||||
// https://docs.opencv.org/3.4.0/d7/d7b/classcv_1_1BackgroundSubtractorMOG2.html
|
||||
//
|
||||
func NewBackgroundSubtractorMOG2() BackgroundSubtractorMOG2 {
|
||||
return BackgroundSubtractorMOG2{p: unsafe.Pointer(C.BackgroundSubtractorMOG2_Create())}
|
||||
@@ -34,7 +34,7 @@ func (b *BackgroundSubtractorMOG2) Close() error {
|
||||
// Apply computes a foreground mask using the current BackgroundSubtractorMOG2.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21
|
||||
// https://docs.opencv.org/3.4.0/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21
|
||||
//
|
||||
func (b *BackgroundSubtractorMOG2) Apply(src Mat, dst Mat) {
|
||||
C.BackgroundSubtractorMOG2_Apply((C.BackgroundSubtractorMOG2)(b.p), src.p, dst.p)
|
||||
@@ -52,7 +52,7 @@ type BackgroundSubtractorKNN struct {
|
||||
// Segmentation Algorithm
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/db/d88/classcv_1_1BackgroundSubtractorKNN.html
|
||||
// https://docs.opencv.org/3.4.0/db/d88/classcv_1_1BackgroundSubtractorKNN.html
|
||||
//
|
||||
func NewBackgroundSubtractorKNN() BackgroundSubtractorKNN {
|
||||
return BackgroundSubtractorKNN{p: unsafe.Pointer(C.BackgroundSubtractorKNN_Create())}
|
||||
@@ -68,7 +68,7 @@ func (k *BackgroundSubtractorKNN) Close() error {
|
||||
// Apply computes a foreground mask using the current BackgroundSubtractorKNN.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21
|
||||
// https://docs.opencv.org/3.4.0/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21
|
||||
//
|
||||
func (k *BackgroundSubtractorKNN) Apply(src Mat, dst Mat) {
|
||||
C.BackgroundSubtractorKNN_Apply((C.BackgroundSubtractorKNN)(k.p), src.p, dst.p)
|
||||
@@ -79,7 +79,7 @@ func (k *BackgroundSubtractorKNN) Apply(src Mat, dst Mat) {
|
||||
// Gunnar Farneback's algorithm.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/dc/d6b/group__video__track.html#ga5d10ebbd59fe09c5f650289ec0ece5af
|
||||
// https://docs.opencv.org/3.4.0/dc/d6b/group__video__track.html#ga5d10ebbd59fe09c5f650289ec0ece5af
|
||||
//
|
||||
func CalcOpticalFlowFarneback(prevImg Mat, nextImg Mat, flow Mat, pyrScale float64, levels int, winsize int,
|
||||
iterations int, polyN int, polySigma float64, flags int) {
|
||||
@@ -92,7 +92,7 @@ func CalcOpticalFlowFarneback(prevImg Mat, nextImg Mat, flow Mat, pyrScale float
|
||||
// the iterative Lucas-Kanade method with pyramids.
|
||||
//
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/3.3.1/dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323
|
||||
// https://docs.opencv.org/3.4.0/dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323
|
||||
//
|
||||
func CalcOpticalFlowPyrLK(prevImg Mat, nextImg Mat, prevPts Mat, nextPts Mat, status Mat, err Mat) {
|
||||
C.CalcOpticalFlowPyrLK(prevImg.p, nextImg.p, prevPts.p, nextPts.p, status.p, err.p)
|
||||
|
||||
10
videoio.go
10
videoio.go
@@ -152,7 +152,7 @@ const (
|
||||
// VideoCapture is a wrapper around the OpenCV VideoCapture class.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/d8/dfe/classcv_1_1VideoCapture.html
|
||||
// http://docs.opencv.org/3.4.0/d8/dfe/classcv_1_1VideoCapture.html
|
||||
//
|
||||
type VideoCapture struct {
|
||||
p C.VideoCapture
|
||||
@@ -216,7 +216,7 @@ func (v *VideoCapture) Grab(skip int) {
|
||||
// VideoWriter is a wrapper around the OpenCV VideoWriter`class.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html
|
||||
// http://docs.opencv.org/3.4.0/dd/d9e/classcv_1_1VideoWriter.html
|
||||
//
|
||||
type VideoWriter struct {
|
||||
mu *sync.RWMutex
|
||||
@@ -228,7 +228,7 @@ type VideoWriter struct {
|
||||
// codec, for example "MJPG".
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html#a0901c353cd5ea05bba455317dab81130
|
||||
// http://docs.opencv.org/3.4.0/dd/d9e/classcv_1_1VideoWriter.html#a0901c353cd5ea05bba455317dab81130
|
||||
//
|
||||
func VideoWriterFile(name string, codec string, fps float64, width int, height int) (vw *VideoWriter, err error) {
|
||||
vw = &VideoWriter{
|
||||
@@ -256,7 +256,7 @@ func (vw *VideoWriter) Close() error {
|
||||
// IsOpened checks if the VideoWriter is open and ready to be written to.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html#a9a40803e5f671968ac9efa877c984d75
|
||||
// http://docs.opencv.org/3.4.0/dd/d9e/classcv_1_1VideoWriter.html#a9a40803e5f671968ac9efa877c984d75
|
||||
//
|
||||
func (vw *VideoWriter) IsOpened() bool {
|
||||
isOpend := C.VideoWriter_IsOpened(vw.p)
|
||||
@@ -266,7 +266,7 @@ func (vw *VideoWriter) IsOpened() bool {
|
||||
// Write the next video frame from the Mat image to the open VideoWriter.
|
||||
//
|
||||
// For further details, please see:
|
||||
// http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html#a3115b679d612a6a0b5864a0c88ed4b39
|
||||
// http://docs.opencv.org/3.4.0/dd/d9e/classcv_1_1VideoWriter.html#a3115b679d612a6a0b5864a0c88ed4b39
|
||||
//
|
||||
func (vw *VideoWriter) Write(img Mat) error {
|
||||
vw.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user