sudo apt install tesseract-ocr
sudo apt install libtesseract-dev
sudo apt install tesseract-ocr-chi-sim
//可以查看包含的语言包
tesseract --list-langs
golang库的地址
https://github.com/otiai10/gosseract
go代码
package main
import (
"fmt"
"github.com/otiai10/gosseract/v2"
)
func main() {
client := gosseract.NewClient()
defer client.Close()
client.SetImage("/mnt/go/ocr/1.jpg")
client.SetLanguage("chi_sim")
text, _ := client.Text()
fmt.Println(text)
}
感觉上识别率不是很高,将就用下