Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lookup ¶
type Lookup struct {
// contains filtered or unexported fields
}
Lookup implements a image search algorithm based on Normalized Cross Correlation. For an overview of the algorithm, see http://www.fmwconcepts.com/imagemagick/similar/index.php
func NewLookup ¶
NewLookup creates a Lookup object. Lookup objects created by these function will do a gray scale search of the templates. Note that if the image or any template is not GrayScale, it will be converted automatically. This could cause some performance hits
func NewLookupColor ¶
NewLookupColor creates a Lookup object that works with all color channels of the image (RGB). Keep in mind that Lookup objects created with this function can only accept color templates as parameters to the FindAll method
func (*Lookup) FindAllInRect ¶
func (l *Lookup) FindAllInRect(template image.Image, rect image.Rectangle, threshold float64) ([]GPoint, error)
FindAllInRect searches for all occurrences of template only inside a part of the image. This can be used to speed up the search if you know the region of the image that the template should appear in.
type OCR ¶
type OCR struct {
// contains filtered or unexported fields
}
OCR implements a simple OCR based on the Lookup functions. It allows multiple fontsets, just call LoadFont for each fontset.
If you need to encode special symbols use UNICODE in the file name. For example if you need to have '\' character (which is prohibited in the path and file name) specify %2F.png as a image symbol name.
Sometimes you need to specify two different image for one symbol (if image / font symbol vary too much). To do so add unicode ZERO WIDTH SPACE symbol (%E2%80%8B) to the filename. Ex: %2F%E2%80%8B.png will produce '/' symbol as well.
func NewOCR ¶
NewOCR creates a new OCR instance, that will use the given threshold. You can optionally parallelize the processing by specifying the number of threads to use. The optimal number varies and depends on your use case (size of fontset x size of image). Default is use only one thread