• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go bindings for OpenCV1.1 (Dev/Zero Dependencies).

Go bindings for OpenCV1.1

PkgDoc: http://godoc.org/github.com/chai2010/opencv

Install

Install GCC or MinGW (download here) at first, and then run these commands:

  1. go get -d github.com/chai2010/opencv
  2. go generate and go install
  3. go run hello.go

Notes

If use TDM-GCC, and build error like this:

c:\tdm-gcc-64\x86_64-w64-mingw32\include\aviriff.h:3:25: error: 'refer' does not
 name a type
 * No warranty is given; refer to the file DISCLAIMER within this package.
 ...

You need fix the C:\TDM-GCC-64\x86_64-w64-mingw32\include\aviriff.h header first:

** // fixit: ** -> /**
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/

Example

// Copyright 2014 <chaishushan{AT}gmail.com>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/chai2010/opencv"
)

func main() {
	filename := "./testdata/lena.jpg"
	if len(os.Args) == 2 {
		filename = os.Args[1]
	}

	image := opencv.LoadImage(filename)
	if image == nil {
		log.Fatalf("LoadImage %s failed!", filename)
	}
	defer image.Release()

	win := opencv.NewWindow("Go-OpenCV")
	defer win.Destroy()

	win.SetMouseCallback(func(event, x, y, flags int) {
		fmt.Printf("event = %d, x = %d, y = %d, flags = %d\n",
			event, x, y, flags,
		)
	})
	win.CreateTrackbar("Thresh", 1, 100, func(pos int) {
		fmt.Printf("pos = %d\n", pos)
	})

	win.ShowImage(image)
	opencv.WaitKey(0)
}

Screenshots

Edge

Inpaint

Video Player

Cameras

BUGS

Report bugs to [email protected].

Thanks!

More Repositories

1

advanced-go-programming-book

📚 《Go语言高级编程》开源图书,涵盖CGO、Go汇编语言、RPC实现、Protobuf插件实现、Web框架实现、分布式系统等高阶主题(完稿)
Handlebars
18,653
star
2

go-ast-book

📚 《Go语言定制指南》(原名:Go语法树入门/开源免费图书/Go语言进阶/掌握抽象语法树/Go语言AST)
Go
5,233
star
3

awesome-wasm-zh

WebAssembly(wasm)资源精选
WebAssembly
976
star
4

webp

WebP decoder and encoder for Go (Zero Dependencies).
Go
447
star
5

gopherchina2018-cgo-talk

📖 GopherChina2018: 深入CGO编程 - 最新修订
JavaScript
334
star
6

ptyy

莆田医院: 莆田系 野鸡医院 查询 (iOS/Swift/Go/Ruby/)
Go
153
star
7

pbgo

💻 pbgo is a mini RPC/REST/Grpc-Gateway framework based on Protobuf
Go
120
star
8

guetzli-go

Guetzli perceptual JPEG encoder for Go (Zero Dependencies).
Go
86
star
9

cgo

golang cgo helper
Go
82
star
10

gettext-go

🆎 GNU gettext for Go (Imported By Kubernetes)
Go
82
star
11

tinylang

Tiny玩具语言(Go语言实现/包含Tiny编译器/CASL汇编器/COMET虚拟机/调试器/支持WebAssembly/LLVM)
Go
67
star
12

protorpc

prtorpc(2013-2021): Google Protocol Protobufs RPC for Go.
Go
61
star
13

notepadplus-go

notepad++ support Go language and Go assembly language (Windows).
55
star
14

wasm-book-code

WebAssembly标准入门 代码
JavaScript
54
star
15

tiff

Rich TIFF/BigTIFF/GeoTIFF decoder/encoder for Go (Pure Go/Zero Dependencies)
Go
50
star
16

errors

Go errors process, support error code, caller info, json format and wraped error.
Go
40
star
17

gotlang

🐶🐶🐶 狗头语言(gotlang) 🐶🐶🐶
Go
38
star
18

base60

base60: 天干地支编码: 乙丑癸巳甲寅己亥丁卯甲申丁未甲午己巳
Go
35
star
19

notepadplus-protobuf

notepad++ support Protobuf (Windows).
32
star
20

libfacedetection-go

libfacedetection binding for Go
C++
32
star
21

guetzli-js

Guetzli for NodeJS/Browser
C++
28
star
22

calculator

基于flex&goyacc实现的计算器
Go
28
star
23

leetcode-go

💻LeetCode练习, Go语言版本
Go
24
star
24

coder-books

📚 码农相关的经典图书收集
21
star
25

bpg

BPG decoder for Go (Zero Dependencies).
Go
20
star
26

ugo-rs

µGo编程语言(Rust版本) - 试验场
Rust
20
star
27

qrcode

QR code encoder/decoder
Go
18
star
28

defer

Go's defer operator for C++
C++
16
star
29

notepadplus-typescript

notepad++ support TypeScript (Windows).
TypeScript
14
star
30

chai2010.github.io

📖 chai2010 的博客
JavaScript
13
star
31

asmgo-talk

Go汇编语言简介
JavaScript
12
star
32

gopl-notes-zh

📚 Go语言圣经读书笔记
Makefile
11
star
33

awesome-cue-zh

📚 CUE配置语言资源精选(欢迎投稿)
Go
11
star
34

cache

LevelDB style LRU cache for Go, support non GC object.
Go
11
star
35

im4corner

Google输入法四角号码扩展
Lua
10
star
36

qml

Qt/QML for Golang (fork from go-qml/qml.v1), Qt/MSVC with Win32/Win64.
Go
10
star
37

protorpc.cxx

This package provides C++ Protobuf-RPC support.
C++
10
star
38

lucky-star

幸运之星: 公平公正的抽奖算法
Go
9
star
39

glua-strings

Go strings package for gopher-lua
Go
8
star
40

bzip2

bzip2 compression for Go
Go
8
star
41

ethutil

♦Ξ♦ 以太坊工具箱(零第三方库依赖) ♦Ξ♦
Go
7
star
42

mdbook-go

mdBook: Go语言迷你版本
CSS
6
star
43

logger

Package logger implements a simple level logging package.
Go
6
star
44

ditaa-docker

docker container for ditaa
Makefile
6
star
45

jsonv

Get Value from JSON
Go
6
star
46

wqy-microhei-go

Go语言文泉驿微米黑字体
Go
5
star
47

glua-helper

GopherLua helper function
Go
5
star
48

FGPTL

FUCK GPT License(GPT 禁止协议)
5
star
49

goapp-in-docker

Building Minimal Docker Containers for Go App
Go
5
star
50

chai2010

4
star
51

protorpc3-cxx

This package provides C++ Protobuf3-RPC support.
C++
4
star
52

wc

基于flex实现的wc命令, 单词计数
Go
4
star
53

jsonmap

Map for json/struct/key-value-db
Go
4
star
54

assert

Assert for Go1.9+
Go
4
star
55

builtin

Provides some usefull functions for Go.
Go
4
star
56

wa-example-p5

凹语言P5儿童编程 p5.wa is a friendly tool for learning to code and make art.
JavaScript
4
star
57

kusion-cookbook

📚 KusionStack云原生八卦
3
star
58

talks

my talk slides
CSS
3
star
59

pbgo-grpc

pbgo grpc/rest examples
Go
3
star
60

ethrpc

♦Ξ♦ 以太坊轻量级RPC客户端(开发中) ♦Ξ♦
Go
3
star
61

spacestring

space string contains more than 1 space characters
Go
3
star
62

brainfuck

brainfuck VM
Go
3
star
63

wa-example-magnifying-glass

凹语言实现放大镜
JavaScript
3
star
64

vscode-extdev-book

📚 《VS Code 插件开发》
Makefile
3
star
65

emscripten-talk

Emscripten简介
JavaScript
2
star
66

theia-ide-book

📚 TheiaIDE参考手册
2
star
67

protoc

protoc wrap, support `go get`
C++
2
star
68

version

get go-app version
Go
2
star
69

ini

INI configuration file parser
Go
2
star
70

vimpinyin

Vim拼音输入法
Lua
2
star
71

cc-mini-test

C++ Mini UnitTest and Benchmark Library
C++
2
star
72

wa-example-canvas

凹语言Canvas例子
JavaScript
2
star
73

wa-example-life

凹语言生命游戏例子
JavaScript
2
star
74

template

template helper
Go
2
star
75

ibox-docker

docker工具箱
Dockerfile
1
star
76

rust-base60

encodes and decodes base60 as bytes or utf8
Rust
1
star
77

ghutil

ghutil
Go
1
star
78

ArduinoMegaRTOS

FreeRTOS on Arduino Mega
C
1
star
79

lzfse-go

LZFSE decoder and encoder for Go (Zero Dependencies).
C
1
star
80

bench

Go
1
star
81

xmc-builder

xmc-builder
Dockerfile
1
star
82

protoc-gen-grpc-plugins

1
star
83

etcd-docker

etcd docker image
Makefile
1
star
84

etcdfs

(WIP)virtual file system on etcd
Go
1
star
85

image

Package image implements a basic 2-D image library.
Go
1
star
86

libconfd

mini confd lib, based on confd/memkv/secconf/logger
Go
1
star
87

wat-go

wat-go: WebAssembly文本格式工具
Go
1
star
88

static-public

静态数据,以github-pages发布
JavaScript
1
star