Documentation
¶
Index ¶
- Variables
- func CloseOCR()
- func CropBytes(imgBytes []byte, x1, y1, x2, y2 int) (image.Image, error)
- func CropFile(filename string, x1, y1, x2, y2 int) (image.Image, error)
- func CropImage(img image.Image, x1, y1, x2, y2 int) (image.Image, error)
- func FindColor(src image.Image, colorToFind color.Color, similarity float64) (x, y int)
- func FindColorWithOffset(src image.Image, colorToFind color.Color, offset color.Color, ...) (x, y int)
- func FindColorWithRegion(src image.Image, colorToFind color.Color, region image.Rectangle, ...) (x, y int, e error)
- func FindColorWithRegionAndOffset(src image.Image, colorToFind color.Color, offset color.Color, ...) (x, y int, e error)
- func FindImage(src image.Image, toFind image.Image) (x, y int)
- func FindTextWithBytes(imgBytes []byte) (string, error)
- func FindTextWithFile(fileName string) (string, error)
- func GetColorNum(img image.Image, colorToFind color.Color, similarity float64) (uint, error)
- func GetColorNumWithOffset(img image.Image, colorToFind color.Color, offset color.Color, ...) (uint, error)
- func GetImageSimilarity(src image.Image, compareWith image.Image, ht HashType) (float64, error)
- func HexToRGB(hex string) (c color.RGBA, e error)
- func ImageFromBytes(imgBytes []byte) (image.Image, error)
- func ImageFromFile(filename string) (image.Image, error)
- func InitOCR(language OCRLanguage)
- func IsColor(color1, color2 color.Color, similarity float64) (isColor bool)
- func IsColorWithOffset(color1, color2, offset color.Color, similarity float64) bool
- func RGBToHex(src color.Color) string
- func ResizeImageBytes(imgBytes []byte, width, height uint) (image.Image, error)
- type HashType
- type OCRLanguage
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidFormat = errors.New("invalid color format")
)
Functions ¶
func FindColorWithOffset ¶
func FindColorWithRegion ¶
func FindTextWithBytes ¶
func FindTextWithFile ¶
func GetColorNum ¶
func GetColorNumWithOffset ¶
func GetImageSimilarity ¶
func InitOCR ¶
func InitOCR(language OCRLanguage)
func IsColorWithOffset ¶
Types ¶
type HashType ¶
type HashType func(img image.Image) (*goimagehash.ImageHash, error)
var ( Perception HashType = goimagehash.PerceptionHash Difference HashType = goimagehash.DifferenceHash )
type OCRLanguage ¶
type OCRLanguage string
const ( English OCRLanguage = "eng" ChineseSimplified OCRLanguage = "chi_sim" )
Click to show internal directories.
Click to hide internal directories.