Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct { fuzzy.Matcher EdgeThreshold int // Valid values are 0 to 255 inclusive. // contains filtered or unexported fields }
Matcher is an image matching algorithm.
It extends the fuzzy.Matcher algorithm by performing edge detection using the Sobel operator[1] and ignoring any pixels that are part of an edge.
The algorithm performs the following steps:
- It applies the Sobel operator to the expected image, producing a 0 to 255 value per pixel indicating how likely it is to be part of an edge.
- It zeroes-out any (x,y) coordinates on *both* images where the aforementioned value exceeds EdgeThreshold. Note that this assumes both images are of equal size.
- It passes the two resulting images to the fuzzy.Matcher algorithm (using parameters MaxDifferentPixels, PixelDeltaThreshold, PixelPerChannelDeltaThreshold and IgnoredBorderThickness) and returns its return value.
[1] https://en.wikipedia.org/wiki/Sobel_operator
func (*Matcher) ActualImageWithEdgesRemoved ¶
ActualImageWithEdgesRemoved returns the right image from the last Match method call with its edges removed.
func (*Matcher) ExpectedImageWithEdgesRemoved ¶
ExpectedImageWithEdgesRemoved returns the left image from the last Match method call with its edges removed.
func (*Matcher) SobelOutput ¶
SobelOutput returns an image with the output of applying the Sobel operator to the expected image from the last Match method call.
Click to show internal directories.
Click to hide internal directories.