Coder Social home page Coder Social logo

imagerenamer's Introduction

imagerenamer

this is a project on progress

this is for diybookscanner community

This Python script uses the Tesseract OCR engine to perform OCR on multiple cropped image files. The script utilizes the pytesseract library to interact with the Tesseract OCR engine, and the tkinter library to create a GUI window for selecting image files. Prerequisites

Python 3.x
Tesseract OCR engine installed on your system
Python libraries: pytesseract, tkinter, Pillow (PIL)

How to use

Install the Tesseract OCR engine on your system. The script assumes that Tesseract is installed in C:\Program Files\Tesseract-OCR\tesseract.exe, but you can modify the tesseract_cmd variable in the script to match the installation path on your system.

Install the required Python libraries. You can use pip to install them:

python

pip install pytesseract tkinter Pillow

Clone or download the script to your local machine.

Open a command prompt or terminal window and navigate to the directory where the script is saved.

Run the script:

python

python ocr_script.py

A GUI window will appear allowing you to select one or more image files to process.

After selecting the images, the script will perform OCR on each image multiple times (as specified by the num_iterations variable) and store the most likely result. The results are saved to a text file called ocr_results.txt in the same directory as the script.

The script will print the total runtime to the console.

Notes

The script is set up to process .jpg, .png, and .bmp image files. You can modify the filetypes in the filetypes variable as needed.

The OCR engine is configured to recognize only digits (0-9) in the images. You can modify the config parameter in the image_to_data function to change the OCR settings.

The OCR results are saved to a text file with each line formatted as follows: filename:ocr_result.

The script is designed to handle errors gracefully. If the OCR engine encounters an error while processing an image, the script will simply skip that image and move on to the next one.

License

This script is released under the MIT License. Feel free to modify and use it however you like.

imagerenamer's People

Contributors

konos93 avatar

Watchers

 avatar

imagerenamer's Issues

test

graph TD;
A-->B;
A-->C;
B-->D;
C-->D;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.