guia2_ext_opencv

package module
v0.0.0-...-60be30a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 6 Imported by: 0

README

guia2-ext-opencv

electricbubble/guia2 的图片匹配扩展库。

安装

必须先安装好 OpenCV,安装步骤可参考 hybridgroup/gocv:

  • macOS 建议直接用 Homebrew 安装
go get github.com/electricbubble/guia2-ext-opencv

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugMode

type DebugMode int
const (
	// DmOff no output
	DmOff DebugMode = iota
	// DmEachMatch output matched and mismatched values
	DmEachMatch
	// DmNotMatch output only values that do not match
	DmNotMatch
)

type DriverExt

type DriverExt struct {

	// scale     float64
	MatchMode TemplateMatchMode
	Threshold float64
	// contains filtered or unexported fields
}

func Extend

func Extend(driver *guia2.Driver, threshold float64, matchMode ...TemplateMatchMode) (dExt *DriverExt, err error)

Extend 获得扩展后的 Driver, 并指定匹配阀值, 默认匹配模式为 TmCcoeffNormed, 默认关闭 OpenCV 匹配值计算后的输出

func (*DriverExt) Debug

func (dExt *DriverExt) Debug(dm DebugMode)

func (*DriverExt) Drag

func (dExt *DriverExt) Drag(pathname string, toX, toY int, steps ...int) (err error)

func (*DriverExt) DragFloat

func (dExt *DriverExt) DragFloat(pathname string, toX, toY float64, steps ...int) (err error)

func (*DriverExt) DragOffset

func (dExt *DriverExt) DragOffset(pathname string, toX, toY int, xOffset, yOffset float64, steps ...int) (err error)

func (*DriverExt) DragOffsetFloat

func (dExt *DriverExt) DragOffsetFloat(pathname string, toX, toY, xOffset, yOffset float64, steps ...int) (err error)

func (*DriverExt) FindImageRectInUIKit

func (dExt *DriverExt) FindImageRectInUIKit(search string) (x, y, width, height float64, err error)

func (*DriverExt) OnlyOnceMatchMode

func (dExt *DriverExt) OnlyOnceMatchMode(matchMode TemplateMatchMode) (newExt *DriverExt)

func (*DriverExt) OnlyOnceThreshold

func (dExt *DriverExt) OnlyOnceThreshold(threshold float64) (newExt *DriverExt)

func (*DriverExt) Swipe

func (dExt *DriverExt) Swipe(pathname string, toX, toY int) (err error)

func (*DriverExt) SwipeDown

func (dExt *DriverExt) SwipeDown(pathname string, distance ...float64) (err error)

func (*DriverExt) SwipeDownOffset

func (dExt *DriverExt) SwipeDownOffset(pathname string, xOffset, yOffset float64, distance ...float64) (err error)

func (*DriverExt) SwipeFloat

func (dExt *DriverExt) SwipeFloat(pathname string, toX, toY float64) (err error)

func (*DriverExt) SwipeLeft

func (dExt *DriverExt) SwipeLeft(pathname string, distance ...float64) (err error)

func (*DriverExt) SwipeLeftOffset

func (dExt *DriverExt) SwipeLeftOffset(pathname string, xOffset, yOffset float64, distance ...float64) (err error)

func (*DriverExt) SwipeOffset

func (dExt *DriverExt) SwipeOffset(pathname string, toX, toY int, xOffset, yOffset float64) (err error)

func (*DriverExt) SwipeOffsetFloat

func (dExt *DriverExt) SwipeOffsetFloat(pathname string, toX, toY, xOffset, yOffset float64) (err error)

func (*DriverExt) SwipeRight

func (dExt *DriverExt) SwipeRight(pathname string, distance ...float64) (err error)

func (*DriverExt) SwipeRightOffset

func (dExt *DriverExt) SwipeRightOffset(pathname string, xOffset, yOffset float64, distance ...float64) (err error)

func (*DriverExt) SwipeUp

func (dExt *DriverExt) SwipeUp(pathname string, distance ...float64) (err error)

func (*DriverExt) SwipeUpOffset

func (dExt *DriverExt) SwipeUpOffset(pathname string, xOffset, yOffset float64, distance ...float64) (err error)

func (*DriverExt) Tap

func (dExt *DriverExt) Tap(pathname string) error

func (*DriverExt) TapOffset

func (dExt *DriverExt) TapOffset(pathname string, xOffset, yOffset float64) (err error)

type TemplateMatchMode

type TemplateMatchMode int

TemplateMatchMode is the type of the template matching operation.

const (
	// TmSqdiff maps to TM_SQDIFF
	TmSqdiff TemplateMatchMode = iota
	// TmSqdiffNormed maps to TM_SQDIFF_NORMED
	TmSqdiffNormed
	// TmCcorr maps to TM_CCORR
	TmCcorr
	// TmCcorrNormed maps to TM_CCORR_NORMED
	TmCcorrNormed
	// TmCcoeff maps to TM_CCOEFF
	TmCcoeff
	// TmCcoeffNormed maps to TM_CCOEFF_NORMED
	TmCcoeffNormed
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL