Documentation ¶
Overview ¶
hocr contains structures and functions for parsing and analysing hocr files
Index ¶
- func BoxCoords(s string) ([4]int, error)
- func GetAvgConf(hocrfn string) (float64, error)
- func GetLineBasics(hocrfn string) (line.Details, error)
- func GetLineDetails(hocrfn string) (line.Details, error)
- func GetLineDetailsCustomImg(hocrfn string, imgfn string) (line.Details, error)
- func GetText(hocrfn string) (string, error)
- func GetWordConfs(hocrfn string) ([]float64, error)
- func LineText(l OcrLine) string
- type Hocr
- type OcrChar
- type OcrLine
- type OcrWord
- type Page
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAvgConf ¶
GetAvgConf calculates the average confidence of a hOCR file from confidences embedded in each word
func GetLineBasics ¶
GetLineBasics parses a hocr file and returns a corresponding line.Details, without any image extracts
func GetLineDetails ¶
GetLineDetails parses a hocr file and returns a corresponding line.Details, including image extracts for each line
func GetLineDetailsCustomImg ¶ added in v0.1.4
GetLineDetailsCustomImg is a variant of GetLineDetails that uses a provided image path for line image extracts, rather than the image name embedded in the .hocr
func GetText ¶
GetText parses a hOCR file and extracts the text from it
func GetWordConfs ¶
GetWordConfs is a utility function that parses a hocr file and returns an array containing the confidences of each word therein