|
| 1 | +## Introduction |
| 2 | + |
| 3 | +Image Text Extractor is a Python application that utilizes Tesseract OCR to extract text from images. This application allows users to input the path to an image file and receive the extracted text in return. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +- Python 3.x |
| 8 | +- Libraries: |
| 9 | + - `pytesseract` |
| 10 | + - `PIL` (Pillow) |
| 11 | + |
| 12 | +You can install the required libraries by running: |
| 13 | + |
| 14 | +```bash |
| 15 | + pip install pytesseract Pillow |
| 16 | +``` |
| 17 | + |
| 18 | +## Installation Instructions for All Operating Systems |
| 19 | + |
| 20 | +### Windows |
| 21 | + |
| 22 | +1. **Install Python**: |
| 23 | + |
| 24 | + - Download and install Python from the [official website](https://www.python.org/downloads/). |
| 25 | + - During installation, make sure to check the box that says "Add Python to PATH". |
| 26 | + |
| 27 | +2. **Install Tesseract OCR**: |
| 28 | + |
| 29 | + - Download the Tesseract installer from the [Tesseract GitHub releases page](https://github.com/tesseract-ocr/tesseract/releases). |
| 30 | + - Run the installer and note the installation path (usually `C:\Program Files\Tesseract-OCR`). |
| 31 | + |
| 32 | +3. **Set Tesseract Path**: |
| 33 | + |
| 34 | + - Add the Tesseract installation path to your system environment variables. |
| 35 | + - Right-click on "This PC" or "My Computer" > Properties > Advanced system settings > Environment Variables. |
| 36 | + - Under "System variables", find the `Path` variable and click Edit. Add the Tesseract path. |
| 37 | + |
| 38 | +4. **Install Required Libraries**: |
| 39 | + - Open Command Prompt and run: |
| 40 | + ```bash |
| 41 | + pip install pytesseract Pillow |
| 42 | + ``` |
| 43 | + |
| 44 | +### macOS |
| 45 | + |
| 46 | +1. **Install Homebrew** (if not already installed): |
| 47 | + |
| 48 | + - Open Terminal and run: |
| 49 | + ```bash |
| 50 | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 51 | + ``` |
| 52 | + |
| 53 | +2. **Install Python**: |
| 54 | + |
| 55 | + - Use Homebrew to install Python: |
| 56 | + ```bash |
| 57 | + brew install python |
| 58 | + ``` |
| 59 | + |
| 60 | +3. **Install Tesseract OCR**: |
| 61 | + |
| 62 | + - Install Tesseract using Homebrew: |
| 63 | + ```bash |
| 64 | + brew install tesseract |
| 65 | + ``` |
| 66 | + |
| 67 | +4. **Install Required Libraries**: |
| 68 | + - In Terminal, run: |
| 69 | + ```bash |
| 70 | + pip install pytesseract Pillow |
| 71 | + ``` |
| 72 | + |
| 73 | +### Linux (Ubuntu/Debian) |
| 74 | + |
| 75 | +1. **Install Python** (if not already installed): |
| 76 | + |
| 77 | + - Open Terminal and run: |
| 78 | + ```bash |
| 79 | + sudo apt update |
| 80 | + sudo apt install python3 python3-pip |
| 81 | + ``` |
| 82 | + |
| 83 | +2. **Install Tesseract OCR**: |
| 84 | + |
| 85 | + - Install Tesseract using: |
| 86 | + ```bash |
| 87 | + sudo apt install tesseract-ocr |
| 88 | + ``` |
| 89 | + |
| 90 | +3. **Install Required Libraries**: |
| 91 | + - In Terminal, run: |
| 92 | + ```bash |
| 93 | + pip3 install pytesseract Pillow |
| 94 | + ``` |
| 95 | + |
| 96 | +## Usage Instructions |
| 97 | + |
| 98 | +After completing the installation, follow the usage instructions below to run the application. |
| 99 | + |
| 100 | +1. Open Command Prompt. |
| 101 | +2. Navigate to the directory where the script is located using the `cd` command: |
| 102 | + ```bash |
| 103 | + cd path\to\your\script |
| 104 | + ``` |
| 105 | +3. Run the Python script |
| 106 | + ```bash |
| 107 | + python image_text_extractor.py - mine is main.py |
| 108 | + ``` |
0 commit comments