https://github.com/vcaesar/gcv
Go robot OpenCV function
https://github.com/vcaesar/gcv
go gocv golang opencv robot
Last synced: 4 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 (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T18:30:27.000Z (4 months ago)
- Last Synced: 2025-03-10T19:38:13.468Z (4 months ago)
- Topics: go, gocv, golang, opencv, robot
- Language: Go
- Homepage:
- Size: 49.8 KB
- Stars: 19
- Watchers: 2
- Forks: 6
- Open Issues: 3
-
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 mainimport (
"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)
}
```