GoCV in Windows 10 [Part 1 : Install] πŸ’»

Nonpavit Detbun πŸ”‹πŸΊ
3 min readSep 29, 2018

Step 1: Installing Go language

Download setup and install Go from binary release through this link.

Step 2: Installing GoCV packages

After installing Go language it will enable to run Go programs in the operating system. Now run the following command to get GoCV packages.

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

The relevant packages will be download to the src directory which is located in the Go directory.

Step 3: Installing MinGW-W64

online installing Setup file should be downloaded from this link.

In the setup 7.3.0 version should be selected and select 64-bit architecture. then select β€œposix” from thread options and select β€œseh” from exceptions handling options.

leave the default location to be installed it. particular bin path of MinGW-W64 is needed to be added in the system path after installation is done.

Step 4: Installing CMake

Download CMake binary installer from this link and install it to default location it mentions.

After installing it, check the system path whether it is included bin path of CMake. if not add it.

Step 5: Installing OpenCV 3.4.2 and OpenCV Contrib Modules

First, run the command prompt and run the following.

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

there is a .cmd file which will install all the required packages. so run it as following inside the directory.

win_build_opencv.cmd

It will take about 1 hour to install all the packages. After installing it, following path is needed to be added to the system path.

C:\opencv\build\install\x64\mingw\bin

Step 6: Verifying the installation

After installing all above take new command prompt and change the directory.

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

Now there is a cmd folder which contains many examples of GoCV. for the first time, we can run first program as following.

go run cmd\version\main.go

Result of the program should be returned like this.

gocv version: 0.16.0
opencv lib version: 3.4.2

if it return this, installation is successful. πŸ‘

If you need a real example πŸ™‚ You can run face detection program by using bellow commands.

Sign up to discover human stories that deepen your understanding of the world.

Nonpavit Detbun πŸ”‹πŸΊ
Nonpavit Detbun πŸ”‹πŸΊ

Written by Nonpavit Detbun πŸ”‹πŸΊ

I’m Electrical Engineering. πŸ“Ÿ I have an interest in Web App, Mobile App, IoT and Microcontroller 🧐

No responses yet

Write a response