you can extract the text from image to text file
Extration of text from image
you can extract the text from image to text file.
- Python 3.x installed
- Git installed
-
Clone the repository to your local machine:
git clone https://github.com/xshbi/txt_extrator.git
-
Navigate to the project directory:
cd txt_extrator
-
Create a virtual environment. Run the following command based on your operating system:
-
For Windows:
python -m venv venv
-
For macOS/Linux:
python3 -m venv venv
-
-
Activate the virtual environment:
-
For Windows:
.\venv\Scripts\activate
-
For macOS/Linux:
source venv/bin/activate
Your command prompt should now show the virtual environment name, indicating that it's active.
-
-
Install Tesseract:
-
For Windows, download and install the executable from https://github.com/tesseract-ocr/tesseract.
-
For macOS, you can use Homebrew:
brew install tesseract
-
For Ubuntu/Debian:
sudo apt-get install tesseract-ocr
-
-
Install Python packages:
pip install -r requirements.txt
This will install the necessary Python packages, including
pytesseract
andopencv
.
Ensure that your virtual environment is activated. If not, activate it using the appropriate command mentioned in the "Setting up a Virtual Environment" section.
Run your project:
python app.py