https://github.com/vcaesar/gcv
Go robot OpenCV function
https://github.com/vcaesar/gcv
go gocv golang opencv robot
Last synced: 11 months ago
JSON representation
Go robot OpenCV function
- Host: GitHub
- URL: https://github.com/vcaesar/gcv
- Owner: vcaesar
- License: bsd-3-clause
- Created: 2021-10-09T13:30:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-07T20:45:10.000Z (about 1 year ago)
- Last Synced: 2025-06-07T21:18:55.686Z (about 1 year ago)
- Topics: go, gocv, golang, opencv, robot
- Language: Go
- Homepage:
- Size: 70.3 KB
- Stars: 20
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# gcv
[](https://github.com/vcaesar/gcv/commits/master)
[](https://travis-ci.org/vcaesar/gcv)
[](https://circleci.com/gh/vcaesar/gcv)
[](https://codecov.io/gh/vcaesar/gcv)
[](https://goreportcard.com/report/github.com/vcaesar/gcv)
[](https://godoc.org/github.com/vcaesar/gcv)
[](https://github.com/vcaesar/gcv/releases/latest)
## Install
You should make sure Golang, GCC, and [OpenCV](https://gocv.io/getting-started/linux/) installed correctly before starting.
## Use
```go
package main
import (
"fmt"
"github.com/go-vgo/robotgo"
"github.com/vcaesar/gcv"
)
func main() {
img, _ := robotgo.CaptureImg()
img1, _ := robotgo.CaptureImg(18, 4, 20, 20)
rs := gcv.FindAllImg(img1, img)
fmt.Println("find: ", rs[0].TopLeft.Y, rs[0].Rects.TopLeft.X, rs[0].ImgSize.H)
fmt.Println("find: ", rs)
m1, _ := gcv.ImgToMat(img)
m2, _ := gcv.ImgToMat(img1)
rs = gcv.FindAllTemplate(m1, m2, 0.8)
fmt.Println("find: ", rs)
}
```