# Text_Extract

[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)

Text extraction form Images, OCR, Tesseract, Basic Image manipulation are all important yet very basic scripts.

If you have a folder full of images that has some text which needs to be extracted into a separate folder with the corresponding image file name or in a single file, then this is the perfect code you are looking for.

The code is relatively simple, full of comments and long variable names XD.

## Setup instructions

- Setup a `python 3.x` virtual environment.
- `Activate` the environment
- Install the dependencies using ```pip3 install -r requiremnts.txt```
- You are all set and the [script](text_extract.py) is Ready to run.
- Carefully follow the Instructions.

## Further Readings

Some newcomers for the first time struggle with Tesseract, this is a direct link to the [installer](https://github.com/UB-Mannheim/tesseract/wiki)

Setting up OCR can be found [here](https://stackoverflow.com/questions/50951955/pytesseract-tesseractnotfound-error-tesseract-is-not-installed-or-its-not-i)

## Usage

Just make sure that Tessaract is in proper directory, run the code according the comments and guidelines.

```
Smaple - 
Enter the Folder name containing Images: <Name of Folder>
Enter your desired output location: <Name of Folder>
```

## Output

Output

![Output](assets/Output.PNG)

Image containing Text

![Before Compression](assets/Sample.PNG)

After Extraction

![After Backup](assets/TextFile.PNG)


## Author(s)

Made by [Vybhav Chaturvedi](https://www.linkedin.com/in/vybhav-chaturvedi-0ba82614a/)

