Go package for computer vision using OpenCV 4 and beyond.

Overview

GoCV

GoCV

Go Reference CircleCI Build status AppVeyor Build status codecov Go Report Card License

The GoCV package provides Go language bindings for the OpenCV 4 computer vision library.

The GoCV package supports the latest releases of Go and OpenCV (v4.5.1) 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 for hardware acceleration using Nvidia GPUs. Check out the CUDA README for more info on how to use GoCV with OpenCV/CUDA.

GoCV also supports Intel OpenVINO. Check out the OpenVINO README for more info on how to use GoCV with the Intel OpenVINO toolkit.

How to use

Hello, video

This example opens a video capture device using device "0", reads frames, and shows the video in a GUI window:

package main

import (
	"gocv.io/x/gocv"
)

func main() {
	webcam, _ := gocv.OpenVideoCapture(0)
	window := gocv.NewWindow("Hello")
	img := gocv.NewMat()

	for {
		webcam.Read(&img)
		window.IMShow(img)
		window.WaitKey(1)
	}
}

Face detect

GoCV

This is a more complete example that opens a video capture device using device "0". It also uses the CascadeClassifier class to load an external data file containing the classifier data. The program grabs each frame from the video, then uses the classifier to detect faces. If any faces are found, it draws a green rectangle around each one, then displays the video in an output window:

package main

import (
	"fmt"
	"image/color"

	"gocv.io/x/gocv"
)

func main() {
    // set to use a video capture device 0
    deviceID := 0

	// open webcam
	webcam, err := gocv.OpenVideoCapture(deviceID)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer webcam.Close()

	// open display window
	window := gocv.NewWindow("Face Detect")
	defer window.Close()

	// prepare image matrix
	img := gocv.NewMat()
	defer img.Close()

	// color for the rect when faces detected
	blue := color.RGBA{0, 0, 255, 0}

	// load classifier to recognize faces
	classifier := gocv.NewCascadeClassifier()
	defer classifier.Close()

	if !classifier.Load("data/haarcascade_frontalface_default.xml") {
		fmt.Println("Error reading cascade file: data/haarcascade_frontalface_default.xml")
		return
	}

	fmt.Printf("start reading camera device: %v\n", deviceID)
	for {
		if ok := webcam.Read(&img); !ok {
			fmt.Printf("cannot read device %v\n", deviceID)
			return
		}
		if img.Empty() {
			continue
		}

		// detect faces
		rects := classifier.DetectMultiScale(img)
		fmt.Printf("found %d faces\n", len(rects))

		// draw a rectangle around each face on the original image
		for _, r := range rects {
			gocv.Rectangle(&img, r, blue, 3)
		}

		// show the image in the window, and wait 1 millisecond
		window.IMShow(img)
		window.WaitKey(1)
	}
}

More examples

There are examples in the cmd directory of this repo in the form of various useful command line utilities, such as capturing an image file, streaming mjpeg video, counting objects that cross a line, and using OpenCV with Tensorflow for object classification.

How to install

To install GoCV, run the following command:

go get -u -d gocv.io/x/gocv

To run code that uses the GoCV package, you must also install OpenCV 4.5.1 on your system. Here are instructions for Ubuntu, Raspian, macOS, and Windows.

Ubuntu/Linux

Installation

You can use make to install OpenCV 4.5.1 with the handy Makefile included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the Makefile is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way.

Quick Install

The following commands should do everything to download and install OpenCV 4.5.1 on Linux:

cd $GOPATH/src/gocv.io/x/gocv
make install

If you need static opencv libraries

make install BUILD_SHARED_LIBS=OFF

If it works correctly, at the end of the entire process, the following message should be displayed:

gocv version: 0.26.0
opencv lib version: 4.5.1

That's it, now you are ready to use GoCV.

Using CUDA with GoCV

See the cuda directory for information.

Using OpenVINO with GoCV

See the openvino directory for information.

Make Install for OpenVINO and Cuda

The following commands should do everything to download and install OpenCV 4.5.1 with CUDA and OpenVINO on Linux:

cd $GOPATH/src/gocv.io/x/gocv
make install_all

If you need static opencv libraries

make install_all BUILD_SHARED_LIBS=OFF

If it works correctly, at the end of the entire process, the following message should be displayed:

gocv version: 0.26.0
opencv lib version: 4.5.1-openvino
cuda information:
  Device 0:  "GeForce MX150"  2003Mb, sm_61, Driver/Runtime ver.10.0/10.0

Complete Install

If you have already done the "Quick Install" as described above, you do not need to run any further commands. For the curious, or for custom installations, here are the details for each of the steps that are performed when you run make install.

Install required packages

First, you need to change the current directory to the location of the GoCV repo, so you can access the Makefile:

cd $GOPATH/src/gocv.io/x/gocv

Next, you need to update the system, and install any required packages:

make deps

Download source

Now, download the OpenCV 4.5.1 and OpenCV Contrib source code:

make download

Build

Build everything. This will take quite a while:

make build

If you need static opencv libraries

make build BUILD_SHARED_LIBS=OFF

Install

Once the code is built, you are ready to install:

make sudo_install

Verifying the installation

To verify your installation you can run one of the included examples.

First, change the current directory to the location of the GoCV repo:

cd $GOPATH/src/gocv.io/x/gocv

Now you should be able to build or run any of the examples:

go run ./cmd/version/main.go

The version program should output the following:

gocv version: 0.26.0
opencv lib version: 4.5.1

Cleanup extra files

After the installation is complete, you can remove the extra files and folders:

make clean

Cache builds

If you are running a version of Go older than v1.10 and not modifying GoCV source, precompile the GoCV package to significantly decrease your build times:

go install gocv.io/x/gocv

Custom Environment

By default, pkg-config is used to determine the correct flags for compiling and linking OpenCV. This behavior can be disabled by supplying -tags customenv when building/running your application. When building with this tag you will need to supply the CGO environment variables yourself.

For example:

export CGO_CPPFLAGS="-I/usr/local/include"
export CGO_LDFLAGS="-L/usr/local/lib -lopencv_core -lopencv_face -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_features2d -lopencv_video -lopencv_dnn -lopencv_xfeatures2d"

Please note that you will need to run these 2 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:

go run -tags customenv ./cmd/version/main.go

Docker

The project now provides Dockerfile which lets you build GoCV Docker image which you can then use to build and run GoCV applications in Docker containers. The Makefile contains docker target which lets you build Docker image with a single command:

make docker

By default Docker image built by running the command above ships Go version 1.13.5, but if you would like to build an image which uses different version of Go you can override the default value when running the target command:

make docker GOVERSION='1.13.5'

Running GUI programs in Docker on macOS

Sometimes your GoCV programs create graphical interfaces like windows eg. when you use gocv.Window type when you display an image or video stream. Running the programs which create graphical interfaces in Docker container on macOS is unfortunately a bit elaborate, but not impossible. First you need to satisfy the following prerequisites:

  • install xquartz. You can also install xquartz using homebrew by running brew cask install xquartz
  • install socat brew install socat

Note, you will have to log out and log back in to your machine once you have installed xquartz. This is so the X window system is reloaded.

Once you have installed all the prerequisites you need to allow connections from network clients to xquartz. Here is how you do that. First run the following command to open xquart so you can configure it:

open -a xquartz

Click on Security tab in preferences and check the "Allow connections" box:

app image

Next, you need to create a TCP proxy using socat which will stream X Window data into xquart. Before you start the proxy you need to make sure that there is no process listening in port 6000. The following command should not return any results:

lsof -i TCP:6000

Now you can start a local proxy which will proxy the X Window traffic into xquartz which acts a your local X server:

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

You are now finally ready to run your GoCV GUI programs in Docker containers. In order to make everything work you must set DISPLAY environment variables as shown in a sample command below:

docker run -it --rm -e DISPLAY=docker.for.mac.host.internal:0 your-gocv-app

Note, since Docker for MacOS does not provide any video device support, you won't be able run GoCV apps which require camera.

Alpine 3.7 Docker image

There is a Docker image with Alpine 3.7 that has been created by project contributor @denismakogon. You can find it located at https://github.com/denismakogon/gocv-alpine.

Raspbian

Installation

We have a special installation for the Raspberry Pi that includes some hardware optimizations. You use make to install OpenCV 4.5.1 with the handy Makefile included with this repo. If you already have installed OpenCV, you do not need to do so again. The installation performed by the Makefile is minimal, so it may remove OpenCV options such as Python or Java wrappers if you have already installed OpenCV some other way.

Quick Install

The following commands should do everything to download and install OpenCV 4.5.1 on Raspbian:

cd $GOPATH/src/gocv.io/x/gocv
make install_raspi

If it works correctly, at the end of the entire process, the following message should be displayed:

gocv version: 0.26.0
opencv lib version: 4.5.1

That's it, now you are ready to use GoCV.

macOS

Installation

You can install OpenCV 4.5.1 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.1:

brew install opencv

pkgconfig Installation

pkg-config is used to determine the correct flags for compiling and linking OpenCV. You can install it by using Homebrew:

brew install pkgconfig

Verifying the installation

To verify your installation you can run one of the included examples.

First, change the current directory to the location of the GoCV repo:

cd $GOPATH/src/gocv.io/x/gocv

Now you should be able to build or run any of the examples:

go run ./cmd/version/main.go

The version program should output the following:

gocv version: 0.26.0
opencv lib version: 4.5.1

Cache builds

If you are running a version of Go older than v1.10 and not modifying GoCV source, precompile the GoCV package to significantly decrease your build times:

go install gocv.io/x/gocv

Custom Environment

By default, pkg-config is used to determine the correct flags for compiling and linking OpenCV. This behavior can be disabled by supplying -tags customenv when building/running your application. When building with this tag you will need to supply the CGO environment variables yourself.

For example:

export CGO_CXXFLAGS="--std=c++11"
export CGO_CPPFLAGS="-I/usr/local/Cellar/opencv/4.5.1/include"
export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/4.5.1/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:

go run -tags customenv ./cmd/version/main.go

Windows

Installation

The following assumes that you are running a 64-bit version of Windows 10.

In order to build and install OpenCV 4.5.1 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/.

The latest version of the MinGW-W64 toolchain is 7.3.0, but any version from 7.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.

Add the C:\Program Files\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev2\mingw64\bin path to your System Path.

CMake

Download and install CMake https://cmake.org/download/ to the default location. CMake installer will add CMake to your system path.

OpenCV 4.5.1 and OpenCV Contrib Modules

The following commands should do everything to download and install OpenCV 4.5.1 on Windows:

chdir %GOPATH%\src\gocv.io\x\gocv
win_build_opencv.cmd

It might take up to one hour.

Last, add C:\opencv\build\install\x64\mingw\bin to your System Path.

Verifying the installation

Change the current directory to the location of the GoCV repo:

chdir %GOPATH%\src\gocv.io\x\gocv

Now you should be able to build or run any of the command examples:

go run cmd\version\main.go

The version program should output the following:

gocv version: 0.26.0
opencv lib version: 4.5.1

That's it, now you are ready to use GoCV.

Cache builds

If you are running a version of Go older than v1.10 and not modifying GoCV source, precompile the GoCV package to significantly decrease your build times:

go install gocv.io/x/gocv

Custom Environment

By default, OpenCV is expected to be in C:\opencv\build\install\include. This behavior can be disabled by supplying -tags customenv when building/running your application. When building with this tag you will need to supply the CGO environment variables yourself.

Due to the way OpenCV produces DLLs, including the version in the name, using this method is required if you're using a different version of OpenCV.

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_core412 -lopencv_face412 -lopencv_videoio412 -lopencv_imgproc412 -lopencv_highgui412 -lopencv_imgcodecs412 -lopencv_objdetect412 -lopencv_features2d412 -lopencv_video412 -lopencv_dnn412 -lopencv_xfeatures2d412 -lopencv_plot412 -lopencv_tracking412 -lopencv_img_hash412

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:

go run -tags customenv cmd\version\main.go

Android

There is some work in progress for running GoCV on Android using Gomobile. For information on how to install OpenCV/GoCV for Android, please see: https://gist.github.com/ogero/c19458cf64bd3e91faae85c3ac887481

See original discussion here: https://github.com/hybridgroup/gocv/issues/235

Profiling

Since memory allocations for images in GoCV are done through C based code, the go garbage collector will not clean all resources associated with a Mat. As a result, any Mat created must be closed to avoid memory leaks.

To ease the detection and repair of the resource leaks, GoCV provides a Mat profiler that records when each Mat is created and closed. Each time a Mat is allocated, the stack trace is added to the profile. When it is closed, the stack trace is removed. See the runtime/pprof documentation.

In order to include the MatProfile custom profiler, you MUST build or run your application or tests using the -tags matprofile build tag. For example:

go run -tags matprofile cmd/version/main.go

You can get the profile's count at any time using:

gocv.MatProfile.Count()

You can display the current entries (the stack traces) with:

var b bytes.Buffer
gocv.MatProfile.WriteTo(&b, 1)
fmt.Print(b.String())

This can be very helpful to track down a leak. For example, suppose you have the following nonsense program:

package main

import (
	"bytes"
	"fmt"

	"gocv.io/x/gocv"
)

func leak() {
	gocv.NewMat()
}

func main() {
	fmt.Printf("initial MatProfile count: %v\n", gocv.MatProfile.Count())
	leak()

	fmt.Printf("final MatProfile count: %v\n", gocv.MatProfile.Count())
	var b bytes.Buffer
	gocv.MatProfile.WriteTo(&b, 1)
	fmt.Print(b.String())
}

Running this program produces the following output:

initial MatProfile count: 0
final MatProfile count: 1
gocv.io/x/gocv.Mat profile: total 1
1 @ 0x40b936c 0x40b93b7 0x40b94e2 0x40b95af 0x402cd87 0x40558e1
#	0x40b936b	gocv.io/x/gocv.newMat+0x4b	/go/src/gocv.io/x/gocv/core.go:153
#	0x40b93b6	gocv.io/x/gocv.NewMat+0x26	/go/src/gocv.io/x/gocv/core.go:159
#	0x40b94e1	main.leak+0x21			/go/src/github.com/dougnd/gocvprofexample/main.go:11
#	0x40b95ae	main.main+0xae			/go/src/github.com/dougnd/gocvprofexample/main.go:16
#	0x402cd86	runtime.main+0x206		/usr/local/Cellar/go/1.11.1/libexec/src/runtime/proc.go:201

We can see that this program would leak memory. As it exited, it had one Mat that was never closed. The stack trace points to exactly which line the allocation happened on (line 11, the gocv.NewMat()).

Furthermore, if the program is a long running process or if GoCV is being used on a web server, it may be helpful to install the HTTP interface )). For example:

package main

import (
	"net/http"
	_ "net/http/pprof"
	"time"

	"gocv.io/x/gocv"
)

func leak() {
	gocv.NewMat()
}

func main() {
	go func() {
		ticker := time.NewTicker(time.Second)
		for {
			<-ticker.C
			leak()
		}
	}()

	http.ListenAndServe("localhost:6060", nil)
}

This will leak a Mat once per second. You can see the current profile count and stack traces by going to the installed HTTP debug interface: http://localhost:6060/debug/pprof/gocv.io/x/gocv.Mat.

How to contribute

Please take a look at our CONTRIBUTING.md document to understand our contribution guidelines.

Then check out our ROADMAP.md document to know what to work on next.

Why this project exists

The https://github.com/go-opencv/go-opencv package for Go and OpenCV does not support any version above OpenCV 2.x, and work on adding support for OpenCV 3 had stalled for over a year, mostly due to the complexity of SWIG. That is why we started this project.

The GoCV package uses a C-style wrapper around the OpenCV 4 C++ classes to avoid having to deal with applying SWIG to a huge existing codebase. The mappings are intended to match as closely as possible to the original OpenCV project structure, to make it easier to find things, and to be able to figure out where to add support to GoCV for additional OpenCV image filters, algorithms, and other features.

For example, the OpenCV videoio module wrappers can be found in the GoCV package in the videoio.* files.

This package was inspired by the original https://github.com/go-opencv/go-opencv project, the blog post https://medium.com/@peterleyssens/using-opencv-3-from-golang-5510c312a3c and the repo at https://github.com/sensorbee/opencv thank you all!

License

Licensed under the Apache 2.0 license. Copyright (c) 2017-2020 The Hybrid Group.

Logo generated by GopherizeMe - https://gopherize.me

Comments
  • I am getting an error

    I am getting an error "eigenNonSymmetric is not a member of 'cv' " at core.cpp:344:9

    I want to work on Opencv3 with Go-Lang. I have followed step according to http://gocv.io I have installed it successfully but now I am getting an error "eigenNonSymmetric is not a member of 'cv' " at core.cpp:344:9 any help. And I am on Ubuntu 18.04

    Description

    I am getting this error

    gocv.io/x/gocv

    core.cpp: In function ‘void Mat_EigenNonSymmetric(Mat, Mat, Mat)’: core.cpp:345:9: error: ‘eigenNonSymmetric’ is not a member of ‘cv’ cv::eigenNonSymmetric(*src, *eigenvalues, *eigenvectors); ^~~~~~~~~~~~~~~~~

    Your Environment

    • Operating System and version: Ubuntu 18.04
    • OpenCV version used: 3.4.1
    • How did you install OpenCV? according to gocv.io
    • GoCV version used: latest
    • Go version: 1.10.2
    • Did you run the env.sh or env.cmd script before trying to go run or go build? no
    question documentation 
    opened by Kabariya 31
  • Use Go-style return values for gocv functions that have result Mat

    Use Go-style return values for gocv functions that have result Mat

    When reviewing #135, I was like "wait, why is this test actually passing?". The test was about flipping a Mat into a brand new Mat, both passed to a function that looks roughly like this:

    func Flip(src Mat, dst Mat, flipCode int) {}
    

    In Go, parameters passed by value (default like above) should not be modified (and in any case, it will never change the value in the parent block). In gocv, this would works though because we manipulate a C pointer under the hood but this is a bit misleading.

    Question is: could we agree on a "convention" stating that all arguments modified should be passed by pointer?

    If we take the Flip() function as an example:

    src := ...
    dst := gocv.NewMat()
    
    // wait, how does `dst` can be updated? No return-value either? Hmmm.
    gocv.Flip(src, dst, 0);
    
    // versus
    
    // oh right so `Flip` takes a `src` Mat and puts the result in `dst`. Lovely <3
    gocv.Flip(src, &dst, 0);
    
    enhancement 
    opened by willdurand 30
  • Building gocv package under visual studio code

    Building gocv package under visual studio code

    Hello, I cannot run my test application under Visual Studio Code. I have the following error: file not found: opencv2/opencv.hpp Any idea? Regards Fooky

    question 
    opened by Fookiwara 27
  • imgproc.cpp issue on MacOS

    imgproc.cpp issue on MacOS

    Hi! I am getting

    imgproc.cpp:61:28: error: expected '(' for function-style cast or type construction
    

    error, tried running simple Hello World! sample.

    opened by jkuri 24
  • I am getting error with OpenVino on Windows

    I am getting error with OpenVino on Windows

    Description

    I want to use Openvino and i have installed it on windows 10. Only one peoblem is I am getting error something like this.

    screenshot 86

    • Did you run the env.sh or env.cmd script before trying to go run or go build?

    there is no file at

    source /opt/intel/computer_vision_sdk/bin/setupvars.sh

    and i tried to find it out but it was for ubuntu and i ran it it's not working.

    so can you help me out here. where can i get

    setupvars.sh for window 10

    Your Environment

    • Operating System and version:Windows 10
    • OpenCV version used:3.4.1
    • How did you install OpenCV? according to gocv.io
    • GoCV version used: latest
    • Go version: 10.1.2
    enhancement 
    opened by Kabariya 19
  • gocv.NewMat ToImage function memory leak

    gocv.NewMat ToImage function memory leak

    gocv.NewMat ToImage function memory leak

    Description

    func (od *OpenCVDecoder) ReadJpeg() ([]byte, error) {
    	img := gocv.NewMat()
    	defer func() {
    		err := img.Close()
    		fmt.Println("ReadJpeg err :",err)
    		//runtime.GC()
    		//fmt.Println("read gc")
    	}()
    	if ok := od.vc.Read(&img); !ok {
    		return nil, nil
    	}
    
    	if img.Empty() {
    		return nil, nil
    	}
    	_, err := img.ToImage()
    	if err != nil {
    		return nil, err
    	}
    	//i, err := ImageToJpeg(iimg)
    	return nil,nil
    }
    
    

    iimg variable not release.i must use runtime.GC(),but it didn't work well also.i think img.Close() dosen't work.

    after task stop. pprof report

    (pprof) top
    Showing nodes accounting for 13.85MB, 100% of 13.85MB total
          flat  flat%   sum%        cum   cum%
        7.91MB 57.13% 57.13%     7.91MB 57.13%  image.NewRGBA
        5.94MB 42.87%   100%     5.94MB 42.87%  gocv.io/x/gocv._Cfunc_GoBytes
    
    (pprof) list ToImage
    Total: 13.85MB
    ROUTINE ======================== gocv.io/x/gocv.(*Mat).ToImage in /Users/x/go/pkg/mod/gocv.io/x/[email protected]/core.go
             0    13.85MB (flat, cum)   100% of Total
             .          .    753:   }
             .          .    754:
             .          .    755:   width := m.Cols()
             .          .    756:   height := m.Rows()
             .          .    757:   step := m.Step()
             .     5.94MB    758:   data := m.ToBytes()
             .          .    759:   channels := m.Channels()
             .          .    760:
             .          .    761:   if t == MatTypeCV8UC1 {
             .          .    762:           img := image.NewGray(image.Rect(0, 0, width, height))
             .          .    763:           c := color.Gray{Y: uint8(0)}
             .          .    764:
             .          .    765:           for y := 0; y < height; y++ {
             .          .    766:                   for x := 0; x < width; x++ {
             .          .    767:                           c.Y = uint8(data[y*step+x])
             .          .    768:                           img.SetGray(x, y, c)
             .          .    769:                   }
             .          .    770:           }
             .          .    771:
             .          .    772:           return img, nil
             .          .    773:   }
             .          .    774:
             .     7.91MB    775:   img := image.NewRGBA(image.Rect(0, 0, width, height))
             .          .    776:   c := color.RGBA{
             .          .    777:           R: uint8(0),
             .          .    778:           G: uint8(0),
             .          .    779:           B: uint8(0),
             .          .    780:           A: uint8(255),
    
    

    Steps to Reproduce

    Your Environment

    • Operating System and version: macOS
    • OpenCV version used: 4.5.0
    • How did you install OpenCV? brew install
    • GoCV version used: 0.25.0
    • Go version: 1.15.x
    • Did you run the env.sh or env.cmd script before trying to go run or go build? no
    bug 
    opened by snailpet 18
  • Tracking

    Tracking

    an attempt to wrap the tracking module from opencv_contrib

    W I P , rfc.

    this is making heavy use of c++ / go interfaces.

    Tracker_Init() and Tracker_Update() only need to be implemented once (in c++), and can be reused for any go implentation of the Tracker interface, saving a ton of boilerplate code

    if we'd use interfaces more often, properly, e.g, there'd be no need to do this again and again , and also have all this boilerplate repetition here and here and so on ..

    @willdurand , may i challenge you / pick your mind on this idea, too ?

    (it still needs a wrapper function on the go side, with the correct implementation type as self, to satisfy the go interface, but all we need to do there is to extract the C.Tracker from the go type, and pass it on to the shared c++ wrapper)

    also tests can be rigorously simplified, if all we need to do is pass a different implementation instance to the same base test

    some things did not make it:

    • GOTURN: needs a XXXmb pre-trained dnn, can't be tested without (throws exception) * CSRT: only available in 3.4.1 .. i'll just add it
    • MultiTracker: i've made an attempt, but there are problems. i'll leave the code in comments (for now), maybe someone has an idea. a: i see no proper way to add new tracker instances to it. the way i tried, worked on my win box, but throws an exception on travis. it's also somewhat unclear, how & when to Close() the added trackers b: i'm unable to release a C.struct_RECTS in cgo, (can't access Rects_Close somehow) c: gocv.toRectangles(ret) would be very useful here, but it's private in gocv all in all, opencv's MultiTracker is just a shallow wrapper around vector<Ptr<Tracker>>, maybe we're better off, building a mock class in pure go ?
    opened by berak 18
  • https://github.com/opencv/opencv/archive/4.0.0.tar.gz not found

    https://github.com/opencv/opencv/archive/4.0.0.tar.gz not found

    brew install hybridgroup/tools/opencv

    Description

    brew install hybridgroup/tools/opencv

    url: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 Error: Failed to download resource "opencv" Download failed: https://github.com/hybridgroup/homebrew-tools/releases/download/v0.10.1/opencv-4.0.0.high_sierra.bottle.tar.gz Warning: Bottle installation failed: building from source. ==> Downloading https://github.com/opencv/opencv/archive/4.0.0.tar.gz ==> Downloading from https://codeload.github.com/opencv/opencv/tar.gz/4.0.0

    curl: (22) The requested URL returned error: 404 Not Found

    Steps to Reproduce

    Your Environment

    • Operating System and version:
    • OpenCV version used:
    • How did you install OpenCV?
    • GoCV version used:
    • Go version:
    • Did you run the env.sh or env.cmd script before trying to go run or go build?
    documentation 
    opened by 137-rick 17
  • Memory leak in SIFT?

    Memory leak in SIFT?

    Hello there. I have one really strange problem with SIFT detector. I use it in our service and seems like there is memory leak. I use method DetectAndCompute. When I looked at code I found that defer KeyPoints_Close is commented. I was able to make new test binding KeyPoints_Close2 and free memory, but it didn't solve my problem. I have no clue how to reproduce it without using service. I mean simple application doesn't cause such big memory consumption.

    For example here is some code:

    func TestSift(t *testing.T) {
    	gray := gocv.IMRead("path_to_image", gocv.IMReadGrayScale)
    
    	sift := contrib.NewSIFT()
    	defer sift.Close()
    
    	res := make([]point, 0) //this is used as result in service's code.
    	for iter := 0; iter < 50; iter++ {
    		mask := gocv.NewMat()
    		defer mask.Close()
    		k, d := sift.DetectAndCompute(gray, mask)
    		defer d.Close()
    
    		for i, v := range k {
    			var tmp []float64
    			for j := 0; j < d.Cols(); j++ {
    				tmp = append(tmp, float64(d.GetFloatAt(i, j)))
    			}
    			res = append(res, point{keypoint: v, descriptor: tmp})
    		}
    	}
    	utils.ShowImage(gray) //This function just shows image in new window. 
    }
    

    Similar code is used in my service and I have crashes (because of memory problem). Interesting thing - using BRISK (for example) fixes this problem, but using SURF - not.

    I wasn't able to find significant difference between BRISK and SIFT bindings, so maybe there is another problem. I have C++ application and it hasn't such problem, so maybe there is some golang specific things.

    I tried to use pprof, but without any luck (But maybe I didn't use it in right way). Valgrind also shows that there is no memory issues.

    I just have no clue what's happening there. Top shows, that memory usage increases by ~300Mb after each call. Does anybody face this problem?

    bug 
    opened by Lezh1k 17
  • Install issue .... `dnn.cpp:119:102: warning: passing NULL to non-pointer argument 1`

    Install issue .... `dnn.cpp:119:102: warning: passing NULL to non-pointer argument 1`

    Description

    1. I followed the readme to install opencv.
    2. when I finished the install step ... I got this issue...

    Does anyone know what is it means?

    # gocv.io/x/gocv
    dnn.cpp: In function 'cv::Mat* Net_BlobFromImage(Mat, double, Size, Scalar, bool, bool)':
    dnn.cpp:119:102: warning: passing NULL to non-pointer argument 1 of 'cv::Scalar_<_Tp>::Scalar_(_Tp) [with _Tp = double]' [-Wconversion-null]
             return new cv::Mat(cv::dnn::blobFromImage(*image, scalefactor, sz, NULL, swapRB, crop, ddepth));
    

    and then, when I run the gocv, this issue always has happened.

    Your Environment

    PRETTY_NAME="Debian GNU/Linux 10 (buster)"
    NAME="Debian GNU/Linux"
    VERSION_ID="10"
    VERSION="10 (buster)"
    VERSION_CODENAME=buster
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
    
    • Operating System and version: debian
    • OpenCV version used: opencv lib version: 4.2.0
    • How did you install OpenCV? use makefile
    • GoCV version used: gocv version: 0.22.0
    • Go version: go version go1.13.1 linux/amd64
    • Did you run the env.sh or env.cmd script before trying to go run or go build? No
    question 
    opened by jhaoheng 16
  • NewMatFromBytes directly uses an unsafe pointer to the []byte, but no reference preventing garbage collection

    NewMatFromBytes directly uses an unsafe pointer to the []byte, but no reference preventing garbage collection

    Description

    The current NewMatFromBytes (in gocv 0.15) does not copy the data from the slice but instead uses an unsafe pointer to the data when initializing the OpenCV Mat. Furthermore, the gocv Mat maintains no reference or anything to this data to prevent that slice from being garbage collected (the relationship between the Mat and the byte slice may not even be picked up by the escape analysis -- perhaps the byte slices are being allocated on the stack!).

    I don't know if this was expected behavior or not, but I was caught off guard! If this is working as designed, kindly leave a few notes in the documentation for NewMatFromBytes.

    My workaround for now is to clone the Mat after calling NewMatFromBytes (before the []byte goes out of scope).

    Steps to Reproduce

    Here is a test case that reproduces the strange problems I was experiencing (Mat's getting overridden after the byte slice is out of scope).

    import (
    	"crypto/rand"
    	"testing"
    
    	"github.com/stretchr/testify/require"
    	"gocv.io/x/gocv"
    )
    
    // Equal returns whether the images are equal.
    func Equal(img1, img2 gocv.Mat) bool {
    	eqMat := gocv.NewMat()
    	gocv.Compare(img1, img2, &eqMat, gocv.CompareNE)
    	count := gocv.CountNonZero(eqMat)
    	eqMat.Close()
    	return count == 0
    }
    
    func TestMatFromBytes(t *testing.T) {
    	size := 500
    	var img, imgCloned gocv.Mat
    	var err error
    
    	makeImg := func() {
    		b := make([]byte, size*size)
    		_, err = rand.Read(b)
    		img, err = gocv.NewMatFromBytes(size, size, gocv.MatTypeCV8U, b)
    		require.NoError(t, err)
    		imgCloned = img.Clone()
    	}
    
    	useMemory := func() {
    		b := make([]byte, size*size)
    		_, err = rand.Read(b)
    	}
    
    	makeImg()
    
    	// This assertion will pass.
    	require.True(t, Equal(img, imgCloned))
    	for i := 0; i < 100; i++ {
    		useMemory()
    	}
    
    	// This assertion will fail!
    	require.True(t, Equal(img, imgCloned))
    }
    
    

    Your Environment

    • Operating System and version: Mac OSX 10.13.6
    • OpenCV version used: 3.4.2
    • How did you install OpenCV? (homebrew)
    • GoCV version used: 0.15.0
    • Go version: 1.10.3
    • Did you run the env.sh or env.cmd script before trying to go run or go build? (N/A?)

    P.S. OpenCV in go is awesome and I look forward to this project becoming mature! Thanks for all the work you guys do!

    bug 
    opened by dougnd 16
  • Detect blurry images

    Detect blurry images

    Description

    I am trying to detect blurry images according to this Python example

    func main() {
    	img := gocv.IMRead("dog.webp", gocv.IMReadColor)
    	defer img.Close()
    
    	gray := gocv.NewMat()
    	defer gray.Close()
    
    	gocv.CvtColor(img, &gray, gocv.ColorBGRToGray)
    
    	blur := gocv.NewMat()
    	defer blur.Close()
    
    	gocv.Laplacian(gray, &blur, gocv.MatTypeCV64F, 1, 1, 0, gocv.BorderDefault)
    
    	meanStdDev := gocv.NewMat()
    	defer meanStdDev.Close()
    
    	stdDev := gocv.NewMat()
    	defer stdDev.Close()
    
    	gocv.MeanStdDev(blur, &meanStdDev, &stdDev)
    }
    

    How can I get variance out of meanStdDev or stdDev? I know this code is pretty much ugly. :D

    Your Environment

    • Operating System and version: Linux Mint 20.3 Una
    • OpenCV version used: 4.6.0
    • How did you install OpenCV? By instructions from this repository.
    • GoCV version used: 0.31.0
    • Go version: 1.19.3
    • Did you run the env.sh or env.cmd script before trying to go run or go build? No, my build works.
    opened by acim 2
  • imgcodecs: Add IMDecodeIntoMat to reduce heap allocations

    imgcodecs: Add IMDecodeIntoMat to reduce heap allocations

    This PR adds imdecode to mat this function is overloaded and currently gocv only supports new mat.

    I am completely 🆕 to cgo and believe I might have messed up here:

    Mat Image_IMDecodeInToMat(ByteArray buf, int flags, Mat img) {
        std::vector<uchar> data(buf.data, buf.data + buf.length);
        cv::Mat imgOut = cv::imdecode(data, flags, img);
        return new cv::Mat(imgOut);
    }
    

    Will try to read up further but would be awesome with some help 🆘 on this. Thanks 🎉

    opened by NikeNano 0
  • [feature request] PaddleOCR integration

    [feature request] PaddleOCR integration

    Is it possible to integrate PaddleOCR into this project ? It is probably the best general purpose OCR so far. I am sure it will help a lot, though I found this job is beyond my reach .

    opened by c1ngular 0
  • Changed the libdc1394 dependencies in Makefile for Ubuntu 22.04

    Changed the libdc1394 dependencies in Makefile for Ubuntu 22.04

    The original dependency (libdc1394-22) is outdated in Ubuntu 22.04 LTS. This fix just changes the dependency to be on the libdc1394 package itself, not the specific version.

    This fix is from the github issue #1020

    opened by asbjorn 2
  • videocaptureproperties syntax help

    videocaptureproperties syntax help

    Description

    I am using a Rasberry PI HQ camera but the resolution is to high for the stream to open as it states Failed to allocate required memory. error below.

    I am trying to set the videocaptureproperties; width, height and FPS to reduce the resolution but for the life of me I cant' get the syntax correct, call me a noob or a knob either or but some help with an example would be most helpful to understand how to apply it into my project.

    I also wondered instead of calling the webcam and device (0) would it not be better to call the video camera directly from the API V4L2?

    type VideoCaptureProperties int

    const (

    // VideoCaptureFrameWidth is width of the frames in the video stream.
    VideoCaptureFrameWidth VideoCaptureProperties = 3
    
    // VideoCaptureFrameHeight controls height of frames in the video stream.
    VideoCaptureFrameHeight VideoCaptureProperties = 4
    
    // VideoCaptureFPS controls capture frame rate.
    VideoCaptureFPS VideoCaptureProperties = 5
    

    )

    Or do I use this?

    An example of the code calling the camera and then setting the parameters would be most helpful, Thank you.

    CURRENT ERROR

    o run ./cmd/facedetect/main.go 0 data/haarcascade_frontalface_default.xml [ WARN:[email protected]] global /home/katelynn/opencv/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory. [ WARN:[email protected]] global /home/katelynn/opencv/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline [ WARN:[email protected]] global /home/katelynn/opencv/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created Start reading device: 0 Device closed: 0

    Steps to Reproduce

    Your Environment

    • Operating System and version:
    • OpenCV version used: 4.60
    • How did you install OpenCV? Install from source. working perfectly
    • GoCV version used: Latest
    • Go version: 1.19.3
    • Did you run the env.sh or env.cmd script before trying to go run or go build? NO
    opened by longwm 0
  • CascadeClassifier::detectMultiScale levelWeights & rejectLevels support?

    CascadeClassifier::detectMultiScale levelWeights & rejectLevels support?

    Any chance of adding support for the following openCV detectMultiScale function that returns the levelWeights & rejectLevels for a cascade detection? This would be very helpful. Tnx.

    void detectMultiScale (InputArray image, std::vector< Rect > &objects, std::vector< int > &rejectLevels, std::vector< double > &levelWeights, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size(), bool outputRejectLevels=false)

    https://docs.opencv.org/3.4/d1/de5/classcv_1_1CascadeClassifier.html

    opened by rob-spotter 0
Releases(v0.31.0)
  • v0.31.0(Jun 7, 2022)

    • all
      • update to OpenCV 4.6.0
    • build
      • Switch to Github Actions for Linux CI build
      • Use go -tags static when verifying static build
    • core
      • Add Mat.ElemSize (#964)
      • avoid index out of range panic in NewPointsVectorFromPoints
    • video
      • add findTransformECC function
    • contrib/ximgproc
      • add PeiLinNormalization() function
      • add anisotropicDiffusion() function
      • implement edgePreservingFilter()
      • implement niBlackThreshold and thinning filters
    Source code(tar.gz)
    Source code(zip)
  • v0.30.0(Mar 14, 2022)

    • 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
    Source code(tar.gz)
    Source code(zip)
  • v0.29.0(Nov 8, 2021)

    • all
      • update to OpenCV 4.5.4
    • build
      • add static build ability on windows
      • use tbb for all builds for CPU accelerated operations
    • cuda
      • implement a bunch of per-element operations
      • add get/set/reset device functions
      • add NewGpuMatWithSize() to preallocate device memory
      • Reshape() returns a new GpuMat with the changed data
      • correct use of Stream by adding WaitForCompletion() and passing pre-allocated GpuMats
    • docs
      • update ROADMAP from recent contributions
    • videoio
      • Fix open video capture with api test (#895)
    • calib3d
      • added EstimateAffine2D
      • findChessboardCornersSB
    • aruco
      • added many functions as part of initial implementation
    Source code(tar.gz)
    Source code(zip)
  • v0.28.0(Jul 19, 2021)

    • all
      • update to OpenCV 4.5.3
      • make task and build tag for static build of OpenCV/GoCV on Linux
      • add Makefile tasks for OpenCV install on Nvidia Jetson
      • add gotest for more colorful test output running tests from containers
    • build
      • correcting output format for code coverage report
      • enforce rule that all Go code is correctly formatted
      • remove codecov
    • core
      • add NewPointVectorFromMat() and NewPoint2fVectorFromMat() functions
      • Fix possible MatProfile race by ordering remove before free.
    • cuda
      • add core functions for GpuMat like Cols(), Rows(), and Type()
      • initial implementation for the Flip function
    • docs
      • update ROADMAP from recent contributions
    • examples
      • correct list of examples and fix comment
    • features2d
      • Add NewORBWithParams
    • tracking
      • change MOSSE to KCF
    • highgui
      • Add function CreateTrackbarWithValue to Window type.
    • imgcodec
      • optimize IMEncode avoiding multiple data copies.
    • imgproc
      • Add CircleWithParams function
      • Add DilateWithParams() function (#827)
      • Add EllipseWithParams function
      • Add FillPolyWithParams function
      • Add PointPolygonTest function
      • Add RectangleWithParams function
    • photo
      • add MergeMertens, AlignMTB and Denoising function (#848)
    • xphoto
      • Add Xphoto contrib (#844)
    Source code(tar.gz)
    Source code(zip)
  • v0.27.0(Apr 9, 2021)

    • all
      • update to OpenCV 4.5.2
    • core
      • add Append() to PointsVector/PointVector
      • add cv::RNG
      • add implementation for Point2fVector
      • add rand functions
      • add test coverage for PointsVector
      • create new PointsVector/PointVector wrappers to avoid repetitive memory copying for seeming innocent operations involving slices of image.Point
      • test coverage for Point2f
      • use PointVector for everything that we can to speed up pipeline when passing around Point vectors
      • use enum instead of int for Invert Method
    • cuda
      • adding HoughLinesDetector and HoughSegmentDetector
      • adding tests for the CannyEdgeDetector
      • some refactoring of the API
      • adding dockerfiles for OpenCV 4.5.2 with CUDA 11.2
      • add GaussianFilter
      • correct signature and test for Threshold
      • implement SobelFilter
      • move arithm module functions into correct location
      • rename files to get rid of so many cudas
      • add abs function implementation
    • dnn
      • increase test coverage
    • docker
      • make all Dockerfiles names/tags more consistent
    • docs
      • add CUDA functions that need implementation to ROADMAP
      • remove invalid sections and add some missing functions from ROADMAP
    • imgproc
      • Add FindContoursWithParams function
      • Add ToImageYUV and ToImageYUVWithParams
    • make
      • add make task to show changelog for next release
    • wechat_qrcode
      • disable module in Windows due to linker error
    Source code(tar.gz)
    Source code(zip)
  • v0.26.0(Jan 11, 2021)

    • all
      • update to OpenCV 4.5.1
    • core
      • add Matrix initializers: eye, ones, zeros (#758)
      • add multidimensional mat creation
      • add ndim mat constructor
      • added accumulators
      • added norm call with two mats (#600)
      • keep a reference to a []byte that backs a Mat. (#755)
      • remove guard for DataPtrUint8 since any Mat can be treated an Uint8
      • add Mat IsContinuous() function, and ensure that any Mat data pointers used to create Go slices only apply to continuous Mats
      • fix buffer size for Go strings for 32-bit operating systems
    • build
      • bring back codecov.io
    • calib3d
      • correctly close mat after test
    • dnn
      • add ReadNetFromONNX and ReadNetFromONNXBytes (#760)
      • increase test coverage
    • docker
      • dockerfiles for opencv gpu builds
    • docs
      • corrected links to CUDA and OpenVINO
      • list all unimplemented functions in photo module
      • replace GoDocs with pkg docs
      • update ROADMAP from recent contributions
    • imgproc
      • add test coverage for GetTextSizeWithBaseline()
      • close all Mats even those based on memory slices
      • close Mat to avoid memory leak in ToImage()
      • refactoring of ToImage and ImageToMatXX functions
    • openvino
      • fix dldt repo in makefile for openvino
    • os
      • adding gcc-c++ package to rpm deps
    • photo
      • add SeamlessClone function
    • profile
      • add created mats in Split and ForwardLayers to profile (#780)
    Source code(tar.gz)
    Source code(zip)
  • v0.25.0(Oct 21, 2020)

    • all
      • update to opencv release 4.5.0
    • build
      • add file dependencies needed for DNN tests
      • add verbose output for tests on CircleCI
      • also run unit tests on non-free algorithms. YMMV.
      • fix build with cuda
      • remove Travis and switch to CircleCI using Docker based builds
      • update CI builds to Go 1.15
    • core
      • add mixChannels() method to Mat (#746)
      • Add toGoStrings helper
      • support ConvertToWithParams method
    • dnn
      • Add NMSBoxes function (#736)
      • Added ability to load Torch file. Tested features for extracting 128d vectors
      • fix using wrong type for unconnectedlayertype
      • use default ddepth for conversions to blob from image as recommended by @berak
    • docker
      • use separate dockerfile for opencv to avoid massive rebuild
    • docs
      • add recent contributions to ROADMAP and also add cuda functions still in need of implementation
      • display CircleCI badge in README
      • minor improvements to CUDA docs in READMEs
    • features2d
      • add FlannBasedMatcher
      • add drawmatches (#720)
      • fix memory leak in SIFT
    • highgui
      • refactored ROI methods
    • imgproc
      • Add option to return baseline with GetTextSizeWithBaseline
    • objdetect
      • Add QRCode DetectAndDecodeMulti
    • videoio
      • Add video capture properties and set preferred api backend (#739)
      • fix needed as discussed in golang/go issue #32479
    Source code(tar.gz)
    Source code(zip)
  • v0.24.0(Jul 30, 2020)

    • all
      • update Makefile and README
      • change constants and corresponding function signatures to have the correct types (#689)
      • replace master branch terminology with release
      • update to OpenCV 4.4.0
    • calib3d
      • add FindHomography()
      • add function EstimateAffinePartial2D()
      • add GetAffineTransform() and GetAffineTransform2f()
      • add UndistortPoints(), FisheyeUndistortPoints() and EstimateNewCameraMatrixForUndistortRectify()
    • core
      • add MultiplyWithParams
    • docs
      • add recent contributions to ROADMAP
      • create CODE_OF_CONDUCT.md
      • update copyright year
    • features2d
      • close returned Mat from SIFT algorithm
      • fix issue 707 with DrawKeyPoints
      • SIFT patent now expired so is part of main OpenCV modules
    • imgproc
      • change struct to remove GNU old-style field designator extension warning
    Source code(tar.gz)
    Source code(zip)
  • v0.23.0(Apr 13, 2020)

    • build
      • update Makefile and README
      • update to use go1.14
    • calib3d
      • add draw chessboard
    • core
      • fix memory leak in Mat.Size() and Mat.Split() (#580)
    • cuda
      • add build support
      • add cuda backend/target
      • add support for:
        • cv::cuda::CannyEdgeDetector
        • cv::cuda::CascadeClassifier Class
        • cv::cuda::HOG Class
      • remove breaking case statement
    • dnn
      • avoid parallel test runs
      • remove attempt at providing grayscale image blog conversion that uses mean adjustment
    • docker
      • docker file last command change (#505)
    • docs
      • add recent contributions to ROADMAP
    • imgproc
      • add ErodeWithParams function
      • add getGaussianKernel function
      • add Go Point2f type and update GetPerspectiveTransform() (#589)
      • add PhaseCorrelate binding (#626)
      • added Polylines feature
      • do not free contours data until after we have drawn the needed contours
      • Threshold() should return a value (#620)
    • make
      • added raspberry pi zero support to the makefile
    • opencv
      • update to OpenCV 4.3.0
    • openvino
      • add build support
    • windows
      • add cmake flag for allocator stats counter type to avoid opencv issue #16398
    Source code(tar.gz)
    Source code(zip)
  • v0.22.0(Dec 23, 2019)

    • bgsegm
      • Add BackgroundSubtractorCNT
    • calib3d
      • Added undistort function (#520)
    • core
      • add functions (singular value decomposition, multiply between matrices, transpose matrix) (#559)
      • Add new funcs (#578)
      • add setIdentity() method to Mat
      • add String method (#552)
      • MatType: add missing constants
    • dnn
      • Adding GetLayerNames()
      • respect the bit depth of the input image to set the expected output when converting an image to a blob
    • doc
      • change opencv version 3.x to 4.x
    • docker
      • use Go1.13.5 for image
    • imgcodecs
      • Fix webp image decode error (#523) imgcodecs: optimize copy of data used for IMDecode method
    • imgproc
      • Add GetRectSubPix
      • Added ClipLine
      • Added InvertAffineTransform
      • Added LinearPolar function (#524)
      • correct ksize param used for MedianBlur unit test
      • Feature/put text with line type (#527)
      • FitEllipse
      • In FillPoly and DrawContours functions, remove func() wrap to avoid memory freed before calling opencv functions. (#543)
    • objdetect
      • Add support QR codes
    • opencv
      • update to OpenCV 4.2.0 release
    • openvino
      • Add openvino async
    • test
      • Tolerate imprecise result in SolvePoly
      • Tolerate imprecision in TestHoughLines
    Source code(tar.gz)
    Source code(zip)
  • v.0.21.0(Oct 14, 2019)

    • build
      • added go clean --cache to clean target, see issue 458
    • core
      • Add KMeans function
      • added MeanWithMask function for Mats (#487)
      • Fix possible resource leak
    • cuda
      • added cudaoptflow
      • added NewGpuMatFromMat which creates a GpuMat from a Mat
      • Support for CUDA Image Warping (#494)
    • dnn
      • add BlobFromImages (#467)
      • add ImagesFromBlob (#468)
    • docs
      • update ROADMAP with all recent contributions. Thank you!
    • examples
      • face detection from image url by using IMDecode (#499)
      • better format
    • imgproc
      • Add calcBackProject
      • Add CompareHist
      • Add DistanceTransform and Watershed
      • Add GrabCut
      • Add Integral
      • Add MorphologyExWithParams
    • opencv
      • update to version 4.1.2
    • openvino
      • updates needed for 2019 R3
    • videoio
      • Added ToCodec to convert FOURCC string to numeric representation (#485)
    Source code(tar.gz)
    Source code(zip)
  • v0.20.0(May 21, 2019)

    • build
      • Use Go 1.12.x for build
      • Update to OpenCV 4.1.0
    • cuda
      • Initial cuda implementation
    • docs
      • Fix the command to install xquartz via brew/cask
    • features2d
      • Add support for SimpleBlobDetectorParams (#434)
      • Added FastFeatureDetectorWithParams
    • imgproc
      • Added function call to cv::morphologyDefaultBorderValue
    • test
      • Increase test coverage for FP16BlobFromImage()
    • video
      • Added calcOpticalFlowPyrLKWithParams
      • Addition of MOG2/KNN constructor with options
    Source code(tar.gz)
    Source code(zip)
  • v0.19.0(Mar 13, 2019)

    • build
      • Adds Dockerfile. Updates Makefile and README.
      • make maintainer tag same as dockerhub organization name
      • make sure to run tests for non-free contrib algorithms
      • update Appveyor build to use Go 1.12
    • calib3d
      • add func InitUndistortRectifyMap (#405)
    • cmd
      • correct formatting of code in example
    • core
      • Added Bitwise Operations With Masks
      • update to OpenCV4.0.1
    • dnn
      • add new backend and target types for NVIDIA and FPGA
      • Added blobFromImages in ROADMAP.md (#403)
      • Implement dnn methods for loading in-memory models.
    • docker
      • update Dockerfile to use OpenCV 4.0.1
    • docs
      • update ROADMAP from recent contributions
    • examples
      • Fixing filename in caffe-classifier example
    • imgproc
      • Add 'MinEnclosingCircle' function
      • added BoxPoints function and BorderIsolated const
      • Added Connected Components
      • Added the HoughLinesPointSet function.
      • Implement CLAHE to imgproc
    • openvino
      • remove lib no longer included during non-FPGA installations
    • test
      • Add len(kp) == 232 to TestMSER, seems this is necessary for MacOS for some reason.
    Source code(tar.gz)
    Source code(zip)
  • v0.18.0(Nov 28, 2018)

    • build
      • add OPENCV_GENERATE_PKGCONFIG flag to generate pkg-config file
      • Add required curl package to the RPM and DEBS
      • correct name for zip directory used for code download
      • Removing linking against face contrib module
      • update CI to use 4.0.0 release
      • update Makefile and Windows build command file to OpenCV 4.0.0
      • use opencv4 file for pkg-config
    • core
      • add ScaleAdd() method to Mat
    • docs
      • replace OpenCV 3.4.3 references with OpenCV 4
      • update macOS installation info to refer to new OpenCV 4.0 brew
      • Updated function documentation with information about errors.
    • examples
      • Improve accuracy in hand gesture sample
    • features2d
      • update drawKeypoints() to use new stricter enum
    • openvino
      • changes to accommodate release 2018R4
    • profile
      • add build tag matprofile to allow for conditional inclusion of custom profile
      • Add Mat profile wrapper in other areas of the library.
      • Add MatProfile.
      • Add MatProfileTest.
      • move MatProfile tests into separate test file so they only run when custom profiler active
    • test
      • Close images in tests.
      • More Closes in tests.
      • test that we are using 4.0.x version now
    • videoio
      • Return the right type and error when opening VideoCapture fails
    Source code(tar.gz)
    Source code(zip)
  • v0.17.0(Oct 9, 2018)

    • build
      • Update Makefile
      • update version of OpenCV used to 3.4.3
      • use link to OpenCV 3.4.3 for Windows builds
    • core
      • add mulSpectrums wrapper
      • add PolarToCart() method to Mat
      • add Reduce() method to Mat
      • add Repeat() method to Mat
      • add Solve() method to Mat
      • add SolveCubic() method to Mat
      • add SolvePoly() method to Mat
      • add Sort() method to Mat
      • add SortIdx() method to Mat
      • add Trace() method to Mat
      • Added new MatType
      • Added Phase function
    • dnn
      • update test to match OpenCV 3.4.3 behavior
    • docs
      • Add example of how to run individual test
      • adding instructions for installing pkgconfig for macOS
      • fixed GOPATH bug.
      • update ROADMAP from recent contributions
    • examples
      • add condition to handle no circle found in circle detection example
    • imgcodecs
      • Added IMEncodeWithParams function
    • imgproc
      • Added Filter2D function
      • Added fitLine function
      • Added logPolar function
      • Added Remap function
      • Added SepFilter2D function
      • Added Sobel function
      • Added SpatialGradient function
    • xfeatures2d
      • do not run SIFT test unless OpenCV was built using OPENCV_ENABLE_NONFREE
      • do not run SURF test unless OpenCV was built using OPENCV_ENABLE_NONFREE
    Source code(tar.gz)
    Source code(zip)
  • v0.16.0(Aug 29, 2018)

    • build
      • add make task for Raspbian install with ARM hardware optimizations
      • use all available cores to compile OpenCV on Windows as discussed in issue #275
      • download performance improvements for OpenCV installs on Windows
      • correct various errors and issues with OpenCV installs on Fedora and CentOS
    • core
      • correct spelling error in constant to fix issue #269
      • implemented & added test for Mat.SetTo
      • improve Multiply() GoDoc and test showing Scalar() multiplication
      • mutator functions for Mat add, subtract, multiply, and divide for uint8 and float32 values.
    • dnn
      • add FP16BlobFromImage() function to convert an image Mat to a half-float aka FP16 slice of bytes
    • docs
      • fix a varible error in example code in README
    Source code(tar.gz)
    Source code(zip)
  • 0.15.0(Aug 2, 2018)

    • build
      • add max to make -j
      • improve path for Windows to use currently configured GOPATH
    • core
      • Add Mat.DataPtr methods for direct access to OpenCV data
      • Avoid extra copy in Mat.ToBytes + code review feedback
    • dnn
      • add test coverage for ParseNetBackend and ParseNetTarget
      • complete test coverage
    • docs
      • minor cleanup of language for install
      • use chdir instead of cd in Windows instructions
    • examples
      • add 'hello, video' example to repo
      • add HoughLinesP example
      • correct message on device close to match actual event
      • small change in display message for when file is input source
      • use DrawContours in motion detect example
    • imgproc
      • Add MinAreaRect() function
    • test
      • filling test coverage gaps
    • videoio
      • add test coverage for OpenVideoCapture
    Source code(tar.gz)
    Source code(zip)
  • 0.14.0(Jul 5, 2018)

    • build
      • Add -lopencv_calib3d341 to the linker
      • auto-confirm on package installs from make deps command
      • display PowerShell download status for OpenCV files
      • obtain caffe test config file from new location in Travis build
      • remove VS only dependencies from OpenCV build, copy caffe test config file from new location
      • return back to GoCV directory after OpenCV install
      • update for release of OpenCV v3.4.2
      • use PowerShell for scripted OpenCV install for Windows
      • win32 version number has not changed yet
    • calib3d
      • Add Calibrate for Fisheye model(WIP)
    • core
      • add GetTickCount function
      • add GetTickFrequency function
      • add Size() and FromPtr() methods to Mat
      • add Total method to Mat
      • Added RotateFlag type
      • correct CopyTo to use pointer to Mat as destination
      • functions converting Image to Mat
      • rename implementation to avoid conflicts with Windows
      • stricter use of reflect.SliceHeader
    • dnn
      • add backend/device options to caffe and tensorflow DNN examples
      • add Close to Layer
      • add first version of dnn-pose-detection example
      • add further comments to object detection/tracking DNN example
      • add GetPerfProfile function to Net
      • add initial Layer implementation alongside enhancements to Net
      • add InputNameToIndex to Layer
      • add new functions allowing DNN backends such as OpenVINO
      • additional refactoring and comments in dnn-pose-detection example
      • cleanup DNN face detection example
      • correct const for device targets to be called Target
      • correct test that expected init slice with blank entries
      • do not init slice with blank entries, since added via append
      • further cleanup of DNN face detection example
      • make dnn-pose-detection example use Go channels for async operation
      • refactoring and additional comments for object detection/tracking DNN example
      • refine comment in header for style transfer example
      • working style transfer example
      • added ForwardLayers() to accomodate models with multiple output layers
    • docs
      • add scripted Windows install info to README
      • Added a sample gocv workflow contributing guideline
      • mention docker image in README.
      • mention work in progress on Android
      • simplify and add missing step in Linux installation in README
      • update contributing instructions to match latest version
      • update ROADMAP from recent calib3d module contribution
      • update ROADMAP from recent imgproc histogram contribution
    • examples
      • cleanup header for caffe dnn classifier
      • show how to use either Caffe or Tensorflow for DNN object detection
      • further improve dnn samples
      • rearrange and add comments to dnn style transfer example
      • remove old copy of pose detector
      • remove unused example
    • features2d
      • free memory allocation bug for C.KeyPoints as pointed out by @tzununbekov
      • Adding opencv::drawKeypoints() support
    • imgproc
      • add equalizeHist function
      • Added opencv::calcHist implementation
    • openvino
      • add needed environment config to execute examples
      • further details in README explaining how to use
      • remove opencv contrib references as they are not included in OpenVINO
    • videoio
      • Add OpenVideoCapture
      • Use gocv.VideoCaptureFile if string is specified for device.
    Source code(tar.gz)
    Source code(zip)
  • 0.13.0(May 29, 2018)

    • build
      • Add cgo directives to contrib
      • contrib subpackage also needs cpp 11 or greater for a warning free build on Linux
      • Deprecate env scripts and update README
      • Don't set --std=c++1z on non-macOS
      • Remove CGO vars from CI and correct Windows cgo directives
      • Support pkg-config via cgo directives
      • we actually do need cpp 11 or greater for a warning free build on Linux
    • docs
      • add a Github issue template to project
      • provide specific examples of using custom environment
    • imgproc
      • add HoughLinesPWithParams() function
    • openvino
      • add build tag specific to openvino
      • add roadmap info
      • add smoke test for ie
    Source code(tar.gz)
    Source code(zip)
  • 0.12.0(May 24, 2018)

    • build
      • convert to CRLF
      • Enable verbosity for travisCI
      • Further improvements to Makefile
    • core
      • Add Rotate, VConcat
      • Adding InScalarRange and NewMatFromScalarWithSize functions
      • Changed NewMatFromScalarWithSize to NewMatWithSizeFromScalar
      • implement CheckRange(), Determinant(), EigenNonSymmetric(), Min(), and MinMaxIdx() functions
      • implement PerspectiveTransform() and Sqrt() functions
      • implement Transform() and Transpose() functions
      • Make toByteArray safe for empty byte slices
      • Renamed InScalarRange to InRangeWithScalar
    • docs
      • nicer error if we can't read haarcascade_frontalface_default
      • correct some ROADMAP links
      • Fix example command.
      • Fix executable name in help text.
      • update ROADMAP from recent contributions
    • imgproc
      • add BoxFilter and SqBoxFilter functions
      • Fix the hack to convert C arrays to Go slices.
    • videoio
      • Add isColor to VideoWriterFile
      • Check numerical parameters for gocv.VideoWriterFile
      • CodecString()
    • features2d
      • add BFMatcher
    • img_hash
      • Add contrib/img_hash module
      • add GoDocs for new img_hash module
      • Add img-similarity as an example for img_hash
    • openvino
      • adds support for Intel OpenVINO toolkit PVL
      • starting experimental work on OpenVINO IE
      • update README files for Intel OpenVINO toolkit support
      • WIP on IE can load an IR network
    Source code(tar.gz)
    Source code(zip)
  • 0.11.0(Mar 26, 2018)

    • build
      • Add astyle config
      • Astyle cpp/h files
      • remove duplication in Makefile for astyle
    • core
      • Add GetVecfAt() function to Mat
      • Add GetVeciAt() function to Mat
      • Add Mat.ToImage()
      • add MeanStdDev() method to Mat
      • add more functions
      • Compare Mat Type directly
      • further cleanup for GoDocs and enforce type for convariance operations
      • Make borderType in CopyMakeBorder be type BorderType
      • Mat Type() should return MatType
      • remove unused convenience functions
      • use Mat* to indicate when a Mat is mutable aka an output parameter
    • dnn
      • add a ssd sample and a GetBlobChannel helper
      • added another helper func and a pose detection demo
    • docs
      • add some additional detail about adding OpenCV functions to GoCV
      • updates to contribution guidelines
      • fill out complete list of needed imgproc functions for sections that have work started
      • indicate that missing imgproc functions need implementation
      • mention the WithParams patterns to be used for functions with default params
      • update README for the Mat* based API changes
      • update ROADMAP for recent changes especially awesome recent core contributions from @berak
    • examples
      • Fix tf-classifier example
      • move new DNN advanced examples into separate folders
      • Update doc for the face contrib package
      • Update links in caffe-classifier demo
      • WIP on hand gestures tracking example
    • highgui
      • fix constant in NewWindow
    • imgproc
      • Add Ellipse() and FillPoly() functions
      • Add HoughCirclesWithParams() func
      • correct output Mat to for ConvexHull()
      • rename param being used for Mat image to be modified
    • tracking
      • add support for TrackerMIL, TrackerBoosting, TrackerMedianFlow, TrackerTLD, TrackerKCF, TrackerMOSSE, TrackerCSRT trackers
      • removed mutitracker, added Csrt, rebased
      • update GoDocs and minor renaming based on gometalint output
    Source code(tar.gz)
    Source code(zip)
  • 0.10.0(Mar 5, 2018)

    • build
      • install unzip before build
      • overwrite when unzipping file to install Tensorflow test model
      • use -DCPU_DISPATCH= flag for build to avoid problem with disabled AVX on Windows
      • update unzipped file when installing Tensorflow test model
    • core
      • add Compare() and CountNonZero() functions
      • add getter/setter using optional params for multi-dimensional Mat using row/col/channel
      • Add mat subtract function
      • add new toRectangle function to DRY up conversion from CRects to []image.Rectangle
      • add split subtract sum wrappers
      • Add toCPoints() helper function
      • Added Mat.CopyToWithMask() per #47
      • added Pow() method
      • BatchDistance BorderInterpolate CalcCovarMatrix CartToPolar
      • CompleteSymm ConvertScaleAbs CopyMakeBorder Dct
      • divide, multiply
      • Eigen Exp ExtractChannels
      • operations on a 3d Mat are not same as a 2d multichannel Mat
      • resolve merge conflict with duplicate Subtract() function
      • run gofmt on core tests
      • Updated type for Mat.GetUCharAt() and Mat.SetUCharAt() to reflect uint8 instead of int8
    • docs
      • update ROADMAP of completed functions in core from recent contributions
    • env
      • check loading resources
      • Add distribution detection to deps rule
      • Add needed environment variables for Linux
    • highgui
      • add some missing test coverage on WaitKey()
    • imgproc
      • Add adaptive threshold function
      • Add pyrDown and pyrUp functions
      • Expose DrawContours()
      • Expose WarpPerspective and GetPerspectiveTransform
      • implement ConvexHull() and ConvexityDefects() functions
    • opencv
      • update to OpenCV version 3.4.1
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Feb 14, 2018)

    • bugfix
      • correct several errors in size parameter ordering
    • build
      • add missing opencv_face lib reference to env.sh
      • Support for non-brew installs of opencv on Darwin
    • core
      • add Channels() method to Mat
      • add ConvertTo() and NewMatFromBytes() functions
      • add Type() method to Mat
      • implement ConvertFp16() function
    • dnn
      • use correct size for blob used for Caffe/Tensorflow tests
    • docs
      • Update copyright date and Apache 2.0 license to include full text
    • examples
      • cleanup mjpeg streamer code
      • cleanup motion detector comments
      • correct use of defer in loop
      • use correct size for blob used for Caffe/Tensorflow examples
    • imgproc
      • Add cv::approxPolyDP() bindings.
      • Add cv::arcLength() bindings.
      • Add cv::matchTemplate() bindings.
      • correct comment and link for Blur function
      • correct docs for BilateralFilter()
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Jan 24, 2018)

    • core
      • add ColorMapFunctions and their test
      • add Mat ToBytes
      • add Reshape and MinMaxLoc functions
      • also delete points
      • fix mistake in the norm function by taking NormType instead of int as parameter
      • SetDoubleAt func and his test
      • SetFloatAt func and his test
      • SetIntAt func and his test
      • SetSCharAt func and his test
      • SetShortAt func and his test
      • SetUCharAt fun and his test
      • use correct delete operator for array of new, eliminates a bunch of memory leaks
    • dnn
      • add support for loading Tensorflow models
      • adjust test for Caffe now that we are auto-cropping blob
      • first pass at adding Caffe support
      • go back to older function signature to avoid version conflicts with Intel CV SDK
      • properly close DNN Net class
      • use approx. value from test result to account forr windows precision differences
    • features2d
      • implement GFTTDetector, KAZE, and MSER algorithms
      • modify MSER test for Windows results
    • highgui
      • un-deprecate WaitKey function needed for CLI apps
    • imgcodec
      • add fileExt type
    • imgproc
      • add the norm wrapper and use it in test for WarpAffine and WarpAffineWithParams
      • GetRotationMatrix2D, WarpAffine and WarpAffineWithParams
      • use NormL2 in wrap affine
    • pvl
      • add support for FaceRecognizer
      • complete wrappers for all missing FaceDetector functions
      • update instructions to match R3 of Intel CV SDK
    • docs
      • add more detail about exactly which functions are not yet implememented in the modules that are marked as 'Work Started'
      • add refernece to Tensorflow example, and also suggest brew upgrade for MacOS
      • improve ROADMAP to help would-be contributors know where to get started
      • in the readme, explain compiling to a static library
      • remove many godoc warnings by improving function descriptions
      • update all OpenCV 3.3.1 references to v3.4.0
      • update CGO_LDFLAGS references to match latest requirements
      • update contribution guidelines to try to make it more inviting
    • examples
      • add Caffe classifier example
      • add Tensorflow classifier example
      • fixed closing window in examples in infinite loop
      • fixed format of the examples with gofmt
    • test
      • add helper function for test : floatEquals
      • add some attiribution from test function
      • display OpenCV version in case that test fails
      • add round function to allow for floating point accuracy differences due to GPU usage.
    • build
      • improve search for already installed OpenCV on MacOS
      • update Appveyor build to Opencv 3.4.0
      • update to Opencv 3.4.0
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Dec 16, 2017)

    • core
      • correct Merge implementation
    • docs
      • change wording and formatting for roadmap
      • update roadmap for a more complete list of OpenCV functionality
      • sequence docs in README in same way as the web site, aka by OS
      • show in README that some work was done on contrib face module
    • face
      • LBPH facerecognizer bindings
    • highgui
      • complete implementation for remaining API functions
    • imgcodecs
      • add IMDecode function
    • imgproc
      • elaborate on HoughLines & HoughLinesP tests to fetch a few individual results
    • objdetect
      • add GroupRectangles function
    • xfeatures2d
      • add SIFT and SURF algorithms from OpenCV contrib
      • improve description for OpenCV contrib
      • run tests from OpenCV contrib
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Nov 25, 2017)

    • core
      • Add cv::LUT binding
    • examples
      • do not try to go fullscreen, since does not work on OSX
    • features2d
      • add AKAZE algorithm
      • add BRISK algorithm
      • add FastFeatureDetector algorithm
      • implement AgastFeatureDetector algorithm
      • implement ORB algorithm
      • implement SimpleBlobDetector algorithm
    • osx
      • Fix to get the OpenCV path with "brew info".
    • highgui
      • use new Window with thread lock, and deprecate WaitKey() in favor of Window.WaitKey()
      • use Window.WaitKey() in tests
    • imgproc
      • add tests for HoughCircles
    • pvl
      • use correct Ptr referencing
    • video
      • use smart Ptr for Algorithms thanks to @alalek
      • use unsafe.Pointer for Algorithm
      • move tests to single file now that they all pass
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Nov 20, 2017)

    • core
      • add TermCriteria for iterative algorithms
    • imgproc
      • add CornerSubPix() and GoodFeaturesToTrack() for corner detection
    • objdetect
      • add DetectMultiScaleWithParams() for HOGDescriptor
      • add DetectMultiScaleWithParams() to allow override of defaults for CascadeClassifier
    • video
      • add CalcOpticalFlowFarneback() for Farneback optical flow calculations
      • add CalcOpticalFlowPyrLK() for Lucas-Kanade optical flow calculations
    • videoio
      • use temp directory for Windows test compat.
    • build
      • enable Appveyor build w/cache
    • osx
      • update env path to always match installed OpenCV from Homebrew
    Source code(tar.gz)
    Source code(zip)
  • v0.4.2(Nov 8, 2017)

    • core
      • Added cv::mean binding with single argument
      • fix the write-strings warning
      • return temp pointer fix
    • examples
      • add counter example
      • add motion-detect command
      • correct counter
      • remove redundant cast and other small cleanup
      • set motion detect example to fullscreen
      • use MOG2 for continous motion detection, instead of simplistic first frame only
    • highgui
      • ability to better control the fullscreen window
    • imgproc
      • add BorderType param type for GaussianBlur
      • add BoundingRect() function
      • add ContourArea() function
      • add FindContours() function along with associated data types
      • add Laplacian and Scharr functions
      • add Moments() function
      • add Threshold function
    • pvl
      • add needed lib for linker missing in README
    • test
      • slightly more permissive version test
    • videoio
      • Add image compression flags for gocv.IMWrite
      • Fixed possible looping out of compression parameters length
      • Make dedicated function to run cv::imwrite with compression parameters
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Oct 19, 2017)

    • docs
      • Correct Windows build location from same @jpfarias fix to gocv-site
    • core
      • Add Resize
      • Add Mat merge and Discrete Fourier Transform
      • Add CopyTo() and Normalize()
      • Implement various important Mat logical operations
    • video
      • BackgroundSubtractorMOG2 algorithm now working
      • Add BackgroundSubtractorKNN algorithm from video module
    • videoio
      • Add VideoCapture::get
    • imgproc
      • Add BilateralFilter and MedianBlur
      • Additional drawing functions implemented
      • Add HoughCircles filter
      • Implement various morphological operations
    • highgui
      • Add Trackbar support
    • objdetect
      • Add HOGDescriptor
    • build
      • Remove race from test on Travis, since it causes CGo segfault in MOG2
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Oct 14, 2017)

    • Switch to use custom package import domain gocv.io/x/gocv
    • Complete all instructions for installation use on Ubuntu/Arch Linux, OS X, and Windows 10
    Source code(tar.gz)
    Source code(zip)
Owner
The Hybrid Group
The software company that makes your hardware work.
The Hybrid Group
使用 Golang+Chrome+OpenCV 破解腾讯滑块验证码

一、背景 滑块验证码是一项人机识别技术,操作简单,真人体验好,机器识别效果也不差,可以有效防止脚本做任务,增加机器脚本薅羊毛的难度。但其破解也相对简单,这里演示一个Demo,以了解。通过 OpenCV 匹配找出滑块位置,计算出滑动距离,然后模拟 js 鼠标事件,在 Chrome 控制台执行脚本,完成

Omigo 57 Nov 15, 2022
Convert images to computer generated art using delaunay triangulation.

▲ Triangle is a tool for generating triangulated image using delaunay triangulation. It takes a source image and converts it to an abstract image comp

Endre Simo 2k Nov 30, 2022
📸 Clean your image folder using perceptual hashing and BK-trees using Go!

Image Cleaner ?? ?? ➡ ?? This tool can take your image gallery and create a new folder with image-alike-cluster folders. It uses a perceptual image ha

lord_santanna 8 Oct 8, 2022
Go package captcha implements generation and verification of image and audio CAPTCHAs.

Package captcha ⚠️ Warning: this captcha can be broken by advanced OCR captcha breaking algorithms. import "github.com/dchest/captcha" Package captch

Dmitry Chestnykh 1.7k Nov 26, 2022
Go package for decoding and encoding TARGA image format

tga tga is a Go package for decoding and encoding TARGA image format. It supports RLE and raw TARGA images with 8/15/16/24/32 bits per pixel, monochro

Sigrid Solveig Haflínudóttir 32 Sep 26, 2022
asciigrid is a Go package that implements decoder and encoder for the Esri ASCII grid format, also known as ARC/INFO ASCII GRID.

asciigrid asciigrid is a Go package that implements decoder and encoder for the Esri ASCII grid format, also known as ARC/INFO ASCII GRID. Install go

Ahmet Artu Yildirim 1 Jul 3, 2022
Pbm - Package ppm implements a Portable Bit Map (PBM) image decoder and encoder written in Go

Package pbm import "github.com/slashformotion/pbm" Package pbm implements a Portable Bit Map (PBM) image decoder and encoder. The supported image col

slashformotion 0 Jan 5, 2022
go-pix is a Go library for generating Pix transactions using Copy and Paste or QR codes. 💳 💰

go-pix go-pix is a Go library for generating Pix transactions using Copy and Paste or QR codes.

Jonnas Fonini 63 Sep 12, 2022
A Pong clone made from scratch with Go and C using OpenGL 3.3

Go-Pong A Pong video game clone made with Go lang and OpenGL 3.3 using C. Gameplay Offline Key bindings are 'w' and 's' for the left player and 'up ar

Mohammad Issawi 33 Feb 10, 2022
Human-friendly Go module that builds and prints directory trees using ASCII art

Human-friendly Go module that builds and prints directory trees using ASCII art.

Vadym Borodin 5 Oct 11, 2022
A pure Go package for coordinate transformations.

WGS84 A pure Go package for coordinate transformations. go get github.com/wroge/wgs84 Usage east, north, h := wgs84.LonLat().To(wgs84.ETRS89UTM(32)).R

Malte Wrogemann 91 Oct 25, 2022
Go package for fast high-level image processing powered by libvips C library

bimg Small Go package for fast high-level image processing using libvips via C bindings, providing a simple programmatic API. bimg was designed to be

Tom 2.1k Nov 23, 2022
Go bindings for GStreamer (retired: currently I don't use/develop this package)

Retired. I don't use/develop this package anymore. Go bindings for GStreamer at a very early stage of maturity. This package is based on GLib bindings

Michał Derkacz 166 Nov 10, 2022
Imaging is a simple image processing package for Go

Imaging Package imaging provides basic image processing functions (resize, rotate, crop, brightness/contrast adjustments, etc.). All the image process

Grigory Dryapak 4.5k Nov 27, 2022
Go Perceptual image hashing package

goimagehash Inspired by imagehash A image hashing library written in Go. ImageHash supports: Average hashing Difference hashing Perception hashing Wav

Dong-hee Na 551 Nov 22, 2022
generativeart is a Go package to generate many kinds of generative art.

generativeart is a Go package to generate many kinds of generative art. The goal is to collect some excellent generative art (implemented in R or Processing), and rewrite them in Go again

null 818 Nov 28, 2022
golang package to find the K most dominant/prominent colors in an image

prominentcolor Find the K most dominant colors in an image The Kmeans function returns the K most dominant colors in the image, ordered in the order o

Carl 139 Nov 7, 2022
openGL Have Fun - A Go package that makes life with OpenGL enjoyable.

glhf openGL Have Fun - A Go package that makes life with OpenGL enjoyable. go get github.com/faiface/glhf Main features Garbage collected OpenGL obje

Michal Štrba 249 Nov 14, 2022
p5 is a simple package that provides primitives resembling the ones exposed by p5js.org

p5 p5 is a simple package that provides primitives resembling the ones exposed by the p5/processing library. License p5 is released under the BSD-3 li

null 112 Oct 30, 2022