관중석
소리 없는 아우성
'아침편지' 카테고리의 다른 글
하코다산의 스노우 몬스터 (0) | 2024.02.06 |
---|---|
자신을 보는 법 (0) | 2024.02.05 |
신비 수련 (0) | 2024.02.05 |
영혼과 영혼의 교류 (0) | 2024.02.01 |
문신을 하기 전에 (0) | 2024.01.31 |
관중석
소리 없는 아우성
하코다산의 스노우 몬스터 (0) | 2024.02.06 |
---|---|
자신을 보는 법 (0) | 2024.02.05 |
신비 수련 (0) | 2024.02.05 |
영혼과 영혼의 교류 (0) | 2024.02.01 |
문신을 하기 전에 (0) | 2024.01.31 |
천체의 음악은
밤낮으로 울리지만, 어느 정도
신비 수련을 하거나 신비적 힘을
발달시킨 상태에서만 들을 수 있습니다.
낮에는 빛이 빛으로서 우리에게 흘러 들어오고,
밤에는 흡수된 빛으로서 계속 활동하면서
천체의 음악은 밤낮으로 울립니다.
- 루돌프 슈타이너의 《천체의 음악 인간의 신비》중에서 -
* 인간의 청각은 한계가 있습니다.
아주 큰 소리도, 아주 작은 소리도 듣지 못합니다.
이른바 '가청구역'이 정해져 있는 것입니다. 그러나
수련을 하면 어느 순간, 선물처럼 청각의 경계가 무너지는
신비로운 경험을 하게 됩니다. 미처 인지하지 못했던
천체 음악을 듣게 됩니다. 마음의 소리, 양심의
소리도 듣습니다. 그때 알게 됩니다. 자신이
얼마나 두터운 벽에 갇혀 있었는지를...
자신을 보는 법 (0) | 2024.02.05 |
---|---|
관중석 소리 없는 아우성 (0) | 2024.02.05 |
영혼과 영혼의 교류 (0) | 2024.02.01 |
문신을 하기 전에 (0) | 2024.01.31 |
미래의 씨앗 (0) | 2024.01.30 |
동작대교 2024-02-02
美 샌프란서 구글 무인로보택시 웨이모에 방화…"커지는 반발감" (0) | 2024.02.14 |
---|---|
2024년 설날 TV 특선영화 (0) | 2024.02.07 |
번아웃을 방지하는 법 A to Z (1) | 2024.01.29 |
Best guns in CoD Mobile Season 1 (2024) CALL OF DUTY: MOBILE (0) | 2024.01.16 |
집안일 안 해본 티 나는 행동 (0) | 2024.01.11 |
pip install pytesseract
한글팩 : https://github.com/tesseract-ocr/tessdata/
*** 설치 할때 언어팩 선택
Python-tesseract is an optical character recognition (OCR) tool for python. That is, it will recognize and “read” the text embedded in images.
Python-tesseract is a wrapper for Google’s Tesseract-OCR Engine. It is also useful as a stand-alone invocation script to tesseract, as it can read all image types supported by the Pillow and Leptonica imaging libraries, including jpeg, png, gif, bmp, tiff, and others. Additionally, if used as a script, Python-tesseract will print the recognized text instead of writing it to a file.
Quickstart
Note: Test images are located in the tests/data folder of the Git repo.
Library usage:
from PIL import Image
import pytesseract
# If you don't have tesseract executable in your PATH, include the following:
pytesseract.pytesseract.tesseract_cmd = r'<full_path_to_your_tesseract_executable>'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
# Simple image to string
print(pytesseract.image_to_string(Image.open('test.png')))
# In order to bypass the image conversions of pytesseract, just use relative or absolute image path
# NOTE: In this case you should provide tesseract supported images or tesseract will return error
print(pytesseract.image_to_string('test.png'))
# List of available languages
print(pytesseract.get_languages(config=''))
# French text image to string
print(pytesseract.image_to_string(Image.open('test-european.jpg'), lang='fra'))
# Batch processing with a single file containing the list of multiple image file paths
print(pytesseract.image_to_string('images.txt'))
# Timeout/terminate the tesseract job after a period of time
try:
print(pytesseract.image_to_string('test.jpg', timeout=2)) # Timeout after 2 seconds
print(pytesseract.image_to_string('test.jpg', timeout=0.5)) # Timeout after half a second
except RuntimeError as timeout_error:
# Tesseract processing is terminated
pass
# Get bounding box estimates
print(pytesseract.image_to_boxes(Image.open('test.png')))
# Get verbose data including boxes, confidences, line and page numbers
print(pytesseract.image_to_data(Image.open('test.png')))
# Get information about orientation and script detection
print(pytesseract.image_to_osd(Image.open('test.png')))
# Get a searchable PDF
pdf = pytesseract.image_to_pdf_or_hocr('test.png', extension='pdf')
with open('test.pdf', 'w+b') as f:
f.write(pdf) # pdf type is bytes by default
# Get HOCR output
hocr = pytesseract.image_to_pdf_or_hocr('test.png', extension='hocr')
# Get ALTO XML output
xml = pytesseract.image_to_alto_xml('test.png')
Support for OpenCV image/NumPy array objects
import cv2
img_cv = cv2.imread(r'/<path_to_image>/digits.png')
# By default OpenCV stores images in BGR format and since pytesseract assumes RGB format,
# we need to convert from BGR to RGB format/mode:
img_rgb = cv2.cvtColor(img_cv, cv2.COLOR_BGR2RGB)
print(pytesseract.image_to_string(img_rgb))
# OR
img_rgb = Image.frombytes('RGB', img_cv.shape[:2], img_cv, 'raw', 'BGR', 0, 0)
print(pytesseract.image_to_string(img_rgb))
If you need custom configuration like oem/psm, use the config keyword.
# Example of adding any additional options
custom_oem_psm_config = r'--oem 3 --psm 6'
pytesseract.image_to_string(image, config=custom_oem_psm_config)
# Example of using pre-defined tesseract config file with options
cfg_filename = 'words'
pytesseract.run_and_get_output(image, extension='txt', config=cfg_filename)
Add the following config, if you have tessdata error like: “Error opening data file…”
# Example config: r'--tessdata-dir "C:\Program Files (x86)\Tesseract-OCR\tessdata"'
# It's important to add double quotes around the dir path.
tessdata_dir_config = r'--tessdata-dir "<replace_with_your_tessdata_dir_path>"'
pytesseract.image_to_string(image, lang='chi_sim', config=tessdata_dir_config)
Functions
Parameters
image_to_data(image, lang=None, config='', nice=0, output_type=Output.STRING, timeout=0, pandas_config=None)
CLI usage:
pytesseract [-l lang] image_file
Prerequisites:
Check the pytesseract package page for more information.
pip install pytesseract
pip install -U git+https://github.com/madmaze/pytesseract.git
git clone https://github.com/madmaze/pytesseract.git
cd pytesseract && pip install -U .
conda install -c conda-forge pytesseract
To run this project’s test suite, install and run tox. Ensure that you have tesseract installed and in your PATH.
pip install tox
tox
TIOBE Index for February 2024, Programming language top 10 (0) | 2024.02.23 |
---|---|
[python] 이미지에서 텍스트 추출하기, tesseract, OCR, 지정 폴더안의 이미지 전부 텍스트 추출하기 (0) | 2024.02.05 |
[PYTHON] 흐름대로 프로그래밍하는 Flowgorithm (1) | 2024.01.10 |
[PYTHON] 4 Ways to Solve FizzBuzz in Python (0) | 2024.01.10 |
[python] Print Calendar (0) | 2024.01.04 |
일은 남보다 먼저하고 말은 남보다 뒤에 하라 (0) | 2024.02.07 |
---|---|
경제적 안정은 생각하고, 배우고, 창조하고, 적응하는, 스스로 생산할 수 있는 힘에 있습니다 (0) | 2024.02.07 |
금이라고 다 반짝이지 않으며 (0) | 2024.01.25 |
견디는 것이 아니라견디면서 나가는 것이 중요하다-서상영, 소를 기르다- (0) | 2024.01.19 |
생각이 늙는 걸 경계하라 (0) | 2024.01.11 |
대부분의 사람들은
자신의 영혼과 직접적인 교류를 하지 않는다.
그래서 이를 가엾이 여긴 자연은, 우리가
다른 사람과 서로 사랑에 빠지게 해
조금이나마 영혼과 교류할 수 있는
기회를 주었다.
-디팩 초프라의《더 젊게 오래 사는 법》중에서-
* 사랑에 빠지면 가슴이 열립니다.
세상에게 부드러워지고 자신에게도 온화해집니다.
하늘에서 지상으로 내려와 갓 깨어난 아가처럼 예뻐지고
선해집니다. 그때 비로소 서로의 영혼을 바라볼 수
있게 됩니다. 물리적 시간이 멈추고 영혼의
시간도 멈춥니다. 다시금 더 젊어집니다.
사랑은 영혼과 영혼의 교류입니다.