Giter Club home page Giter Club logo

project1's Introduction

Before running the script, ensure you have the following installed:

  • Python (version 3.6 or higher)
  • OpenCV (cv2) library
  • EasyOCR library Usage- Save the script to a Python file (e.g., text_extraction.py).
  • Run the script from the command line with the path to the input image as an argument:

python text_extraction.py <input_image_path>

Script Breakdown

  1. Initialization- The script initializes an EasyOCR reader with English language support.
  • The gpu=True argument enables GPU acceleration if available.
  1. Function
  • headwritingTotext(img)- This function extracts text from an input image.
  • Arguments:
    • img: Path to the input image file.
  • Steps:
    • Read the input image using OpenCV (cv2).
    • Enhance the image by sharpening its edges.
    • Create a binary version of the image using thresholding.
    • Utilize EasyOCR to read text from the preprocessed image.
    • Return a list of detected text strings.
  1. Main Execution- The script checks if the correct number of command-line arguments (i.e., the input image path) is provided.
  • If not, it prints a usage message and exits.
  • Otherwise, it calls the headwritingTotext function with the input image path.
  • Finally, it prints the extracted text. Example UsageSuppose you have an image named sample_image.jpg. Run the script as follows:

python script.py sample_image.jpg

Notes- Replace <input_image_path> with the actual path to your image.

project1's People

Contributors

ashishvishnuyash avatar

Watchers

 avatar

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.