Kernel API OCR returns text coordinate information (#11738)

* 优化setImageOCRText接口调用

* 扩展 ocr 接口,添加 ocrJSON 返回字段

* 过滤不可见字符

* 返回的ocr文本添加空格
This commit is contained in:
崮生 2024-06-16 22:55:22 +08:00 committed by GitHub
parent 974f1c1183
commit c0bd645048
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 65 additions and 34 deletions

View file

@ -33,7 +33,7 @@ func autoOCRAssets() {
assets := getUnOCRAssetsAbsPaths()
if 0 < len(assets) {
for i, assetAbsPath := range assets {
text := util.Tesseract(assetAbsPath)
text := util.GetOcrJsonText(util.Tesseract(assetAbsPath))
p := strings.TrimPrefix(assetAbsPath, assetsPath)
p = "assets" + filepath.ToSlash(p)
util.SetAssetText(p, text)