mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 19:38:48 +01:00
Kernel API OCR returns text coordinate information (#11738)
* 优化setImageOCRText接口调用 * 扩展 ocr 接口,添加 ocrJSON 返回字段 * 过滤不可见字符 * 返回的ocr文本添加空格
This commit is contained in:
parent
974f1c1183
commit
c0bd645048
5 changed files with 65 additions and 34 deletions
|
|
@ -137,13 +137,11 @@ func ocr(c *gin.Context) {
|
|||
}
|
||||
|
||||
path := arg["path"].(string)
|
||||
force := false
|
||||
if forceArg := arg["force"]; nil != forceArg {
|
||||
force = forceArg.(bool)
|
||||
}
|
||||
|
||||
ocrJSON := util.OcrAsset(path)
|
||||
ret.Data = map[string]interface{}{
|
||||
"text": util.OcrAsset(path, force),
|
||||
"text": util.GetOcrJsonText(ocrJSON),
|
||||
"ocrJSON": ocrJSON,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue