一、OCR文字识别
Step1:安装tesseract
tesseract 是一个开源的OCR引擎,最初是由惠普公司开发用来作为其平板扫描仪的OCR引擎,2005年惠普将其开源出来,之后google接手负责维护。目前稳定的版本是3.0。4.0版本加入了基于LSTM的神经网络技术,中文字符识别准确率有所提高。
sudo add-apt-repository ppa:alex-p/tesseract-ocr
sudo apt-get update 
sudo apt-get install tesseract-ocr 
 
Step2:安装中文包
中文包下载路径, 下载完成并解压后,将解压文件中的*.traineddata 相关文件拷贝到 usr/share/tesseract-ocr/4.00/tessdata/ 路径下,然后继续安装;
Step3:安装截图等功能包
sudo apt-get install gnome-screenshot
sudo apt-get install xclip
sudo apt-get install imagemagick
 
Step4:制作shell文件
在Step2 中有一个 OCR.txt 文件,拷贝为 ocr.sh文件,如下所示:
#!/bin/env bash 
# Dependencies: tesseract-ocr imagemagick gnome-screenshot xclip
#Name: OCR Picture
#Author:andrew
#Fuction: take a screenshot and OCR the letters in the picture
#Path: /home/Username/...
#Date: 2020-02-10
#you can only scan one character at a time
SCR="/home/Username/Documents/temp"
####take a shot what you wana to OCR to text
gnome-screenshot -a -f $SCR.png
####increase the png
mogrify -modulate 100,0 -resize 400% $SCR.png 
#should increase detection rate
####OCR by tesseract
tesseract $SCR.png $SCR &> /dev/null -l eng+chi1
####get the text and copy to clipboard
cat $SCR.txt | xclip -selection clipboard
exit
 

 注意:将文件中SCR="路径那里替换成你想要存放截图以及识别结果txt文档的路径
设置快捷键
在 设置  
     
      
       
       
         → 
        
       
      
        \rightarrow 
       
      
    → 键盘中添加自定义快捷键,如下所示,设置完成后按F4即可直接截图识别。
 
二、Latex公式识别
方案一:官网直接下载linux版本
官网直接下载linux版本,然后找到该文件,右键属性,勾选允许作为执行程序。官网链接
 
方案二:snap安装
cd ~/Downloads
wget https://download.mathpix.com/linux/Mathpix_Snipping_Tool-x86_64.v03.00.0050.AppImage -O Mathpix_Snipping_Tool.AppImage
chmod 777 ./Mathpix_Snipping_Tool.AppImage
./Mathpix_Snipping_Tool.AppImage
                



![2023年中国旋挖钻机市场销量、竞争格局及行业发展趋势分析[图]](https://img-blog.csdnimg.cn/img_convert/4f55bc9c7096acd20587aee00dc02209.png)













