Skip to content

Latest commit

 

History

History
54 lines (32 loc) · 1.67 KB

README.md

File metadata and controls

54 lines (32 loc) · 1.67 KB

Image2Text

The Image2Text class is a graphical user interface (GUI) that allows users to extract text from images using Tesseract OCR.

Untitled

Functionalities !

The main functionalities of the class include:

  • Browsing for an image file and extracting text from it
  • Getting an image from the clipboard and extracting text from it
  • Copying the extracted text to the clipboard
  • Resizing the font of the text_label widget based on the size of the window

Methods

The following methods are defined in the Image2Text class:

init()

Initializes the GUI and sets up the buttons, text label, and progress label.

ocr()

Extracts text from an image using Tesseract OCR.

browse_file()

Opens a file dialog box to browse for an image file and starts a new thread to process the image.

get_clipboard_image()

Gets an image from the clipboard, saves it to a file, and starts a new thread to process the image.

process_image()

Processes the image and extracts text using Tesseract OCR, updates the text label and progress label.

copy_to_clipboard()

Copies the extracted text to the clipboard.

resize_font()

Resizes the font of the text_label widget based on the size of the window.

Fields

The class has the following fields:

  • root : the main tkinter window
  • text_label : the scrolledtext widget that displays the extracted text
  • progress_label : the label that displays the progress of the OCR process.