ํ๋ก๊ทธ๋จ ์ด๋ฆ
์ด๋ฏธ์ง๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํ๋ก๊ทธ๋จ
์ค์น
1.
Visual c++
2.
teseract
3.
pytesseract
Visual c++
teseract
ํ๊ตญ์ด kor ํจ์น
์ค์น๋ ๊ฒฝ๋ก์ kor.traineddata ํ์ผ์ ์ ์ฅํด์ฃผ์ธ์!
C:\Program Files\Tesseract-OCR\tessdata
Plain Text
๋ณต์ฌ
pytesseract
pip install pytesseract
Python
๋ณต์ฌ
ํ๋ก๊ทธ๋จ
1
2
ํ๋กฌํํธ
๊ฐ๋จํ๊ฒ ์ด๋ฏธ์ง์์ ํ
์คํธ ์ถ์ถํ๋ ํ์ด์ฌ ํ๋ก๊ทธ๋จ ๋ง๋ค์ด์ค
Plain Text
๋ณต์ฌ
์ฝ๋
import pytesseract
from PIL import Image
# Tesseract ์คํ ํ์ผ ๊ฒฝ๋ก ์ค์
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
# ์ด๋ฏธ์ง ๋ถ๋ฌ์ค๊ธฐ
image = Image.open('text.png')
# ์ด๋ฏธ์ง์์ ํ
์คํธ ์ถ์ถ (ํ๊ตญ์ด + ์์ด)
text = pytesseract.image_to_string(image, lang='eng+kor')
# ์ถ์ถ๋ ํ
์คํธ ์ถ๋ ฅ
print(text)
Python
๋ณต์ฌ