Skip to content

vcaesar/gcv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcv

Build Status Build Status CircleCI Status codecov Go Report Card GoDoc Release

Install

You should make sure Golang, GCC, and OpenCV installed correctly before starting.

Use

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)
}