为什么要这个功能

工作中会经常遇到需要识别一个图片中的文本内容,需要快速的OCR识别,从而提高工作效率;

如何实现

snipaste + pngpaste + tesseract

安装流程与使用

安装 pngpaste 和 tesseract 需要预先安装brew,国内安装brew可以参考brew官网直接执行/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"需要代理,且不一定一次成功,如果失败的话,需要多执行几次;

安装完brew后,需要更新brew brew udpate --verbose, 如果遇到fatal: Could not resolve HEAD to a revision , 进入到出问题的目录(笔者是/opt/homebrew/Library/Taps/homebrew/homebrew-core目录),手动拉取代码

git fetch --prune origin
git pull --rebase origin master

成功之后,还需要设置brew的仓库镜像,可参考清华大学镜像

export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"

之后就可以安装pngpaste 和 tesseract,创建别名alias pocr='pngpaste - | tesseract stdin stdout',然后就可以进行截图,之后输入pocr解析图片内容了

最新文章

  1. JS魔法堂:不完全国际化&本地化手册 之 拓展篇
  2. centos 7.0 安装nginx 1.117
  3. 如何用Dummy实例执行数据库的还原和恢复
  4. [转] 《ES6标准入门》读书笔记
  5. final发布视频
  6. PHPExcel使用体会
  7. a[1000][1000]程序崩溃
  8. python (11)文件的读写 按行读文件
  9. oracle行列转换函数的使用
  10. HibernateTemplate 查询
  11. mongoDb c driver
  12. 工具-Quick time播放器
  13. Equilibrium point
  14. Redis与数据库同步问题
  15. python基于函数替换的热更新原理介绍
  16. 自己配置 vue 项目 知识体系(自己写脚手架 类似 vue-cli )
  17. centos7救援模式--单机模式(单用户模式)
  18. LG2634 [国家集训队]聪聪可可
  19. centos:时间同步
  20. MariaDB管理系统

热门文章

  1. 子路由path路径带 ‘/‘与不带
  2. MogDB 学习笔记之 -- 索引失效
  3. linux上安装python3(yum方式)
  4. Educational Codeforces Round 138 (Rated for Div. 2) - D. Counting Arrays
  5. Head_First_Python(中文版)值得花时间读的一本书
  6. 洛谷P8924题解
  7. Cinder 对接本地LVM存储
  8. Centos 7.9 部署Kubernetes集群 (基于containerd 运行时)
  9. 用CImage加载内存里的Image(转)
  10. vxWidgets(一):初识