API: internal/testharness

Back to API Index

Legend: Type, Function, Method

Package: package testharness // import "github.com/smysnk/sikuligo/internal/testharness"

Symbol Index

Types

Functions

Methods

Declarations

Types

Type CompareOptions

Type ExpectedMatch

Type GoldenCase

Functions

Function AlmostEqual

Function CompareMatches

Function MatrixToGray

Function LoadCorpus

Raw Package Doc

package testharness // import "github.com/smysnk/sikuligo/internal/testharness"


FUNCTIONS

func AlmostEqual(a, b, tol float64) bool
func CompareMatches(got []core.MatchCandidate, want []ExpectedMatch, opts CompareOptions) error
func MatrixToGray(rows [][]int) (*image.Gray, error)

TYPES

type CompareOptions struct {
	ScoreTolerance float64
}

type ExpectedMatch struct {
	X        int     `json:"x"`
	Y        int     `json:"y"`
	W        int     `json:"w"`
	H        int     `json:"h"`
	ScoreMin float64 `json:"score_min"`
	ScoreMax float64 `json:"score_max"`
}

type GoldenCase struct {
	Name         string          `json:"name"`
	Haystack     [][]int         `json:"haystack"`
	Needle       [][]int         `json:"needle"`
	Mask         [][]int         `json:"mask,omitempty"`
	Threshold    float64         `json:"threshold"`
	ResizeFactor float64         `json:"resize_factor"`
	MaxResults   int             `json:"max_results"`
	Expected     []ExpectedMatch `json:"expected"`
}

func LoadCorpus() ([]GoldenCase, error)