{"id":23406958,"url":"https://github.com/preetraj2002/tablify","last_synced_at":"2026-04-30T15:31:31.305Z","repository":{"id":266728729,"uuid":"899159858","full_name":"Preetraj2002/Tablify","owner":"Preetraj2002","description":"Converts a snapshot of a table (an image) into tabular data using OCR. It using image processing and enhancement techniques to help with the OCR.","archived":false,"fork":false,"pushed_at":"2024-12-05T19:38:15.000Z","size":893,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T00:07:20.021Z","etag":null,"topics":["ocr","opencv","otsu-thresholding","pytesseract","pytesseract-ocr","python","tabular-data"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Preetraj2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T18:22:22.000Z","updated_at":"2024-12-05T19:38:18.000Z","dependencies_parsed_at":"2024-12-05T22:08:21.776Z","dependency_job_id":null,"html_url":"https://github.com/Preetraj2002/Tablify","commit_stats":null,"previous_names":["preetraj2002/tablify"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preetraj2002%2FTablify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preetraj2002%2FTablify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preetraj2002%2FTablify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preetraj2002%2FTablify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Preetraj2002","download_url":"https://codeload.github.com/Preetraj2002/Tablify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947859,"owners_count":21023066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ocr","opencv","otsu-thresholding","pytesseract","pytesseract-ocr","python","tabular-data"],"created_at":"2024-12-22T14:16:27.050Z","updated_at":"2026-04-30T15:31:31.276Z","avatar_url":"https://github.com/Preetraj2002.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Tablify** - Convert Images to Tabular Data using OCR\n\n**Tablify** is a Python-based tool that converts tabular data from images into CSV files using Optical Character Recognition (OCR). It processes images, extracts the text using `pytesseract`, and organizes it into rows and columns for easy data extraction and analysis.\n\n## **Features:**\n- Converts images of tables into structured CSV files.\n- Uses `pytesseract` to perform OCR on images.\n- Processes images to detect individual text blocks, sort them by coordinates, and group them into rows.\n\n## **Installation:**\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/Preetraj2002/Tablify.git\n   cd Tablify\n   ```\n\n2. **Install required dependencies:**\n\n   Make sure you have Python 3.x installed. Then, install the required libraries:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Install Tesseract OCR:**\n\n   - **Windows:** Download the Tesseract installer from [here](https://github.com/UB-Mannheim/tesseract/wiki) and add the path to your system environment variables.\n   - **Linux:** Install Tesseract using:\n\n     ```bash\n     sudo apt install tesseract-ocr\n     ```\n\n   - **macOS:** Use Homebrew to install Tesseract:\n\n     ```bash\n     brew install tesseract\n     ```\n\n## **How to Use:**\n\n1. **Prepare an Image:**\n   Ensure the image contains tabular data that you want to extract. The tool works best with clear, well-contrasted images.\n\n2. **Run the Script:**\n   After setting up, simply run the script on your image:\n\n   ```bash\n   python tablify.py path/to/your/image.jpg\n   ```\n\n   This will generate a `output.csv` file in the same directory.\n\n3. **Check the Output:**\n   Open `output.csv` to see the extracted table data in tabular format.\n\n## **Process Inside Tablify:**\n1. **Image Preprocessing:**\n   The image is converted to grayscale, and a binary thresholding is applied to make the text clearer for OCR.\n\n   Original:\n   ![Original](images/image_csv.jpeg)\n\n   Grayscale:\n   ![Gray](images/gray_image.png)\n\n   After OTSU thresholding:\n   ![Thresholded_image](images/thresholded_image.png)\n\n   Dilation:\n   ![Dilation](images/dilation.png)\n   \n2. **Contour Detection:**\n   Using OpenCV, contours of the text blocks are identified to group text into rows and columns.\n\n   Marked Countours:\n   ![Countours](images/countours.png)\n\n   Marked Centroids of the countours:\n   ![centroids](images/centroids_with_labels.png)\n   \n3. **Text Extraction:**\n   Each text block is processed with `pytesseract` to extract the text, which is then organized into a structured CSV format.\n\n4. **CSV Generation:**\n   The processed text is organized into rows based on vertical alignment and saved as a CSV file.\n\n\n## **License:**\n\nThis project is licensed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreetraj2002%2Ftablify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreetraj2002%2Ftablify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreetraj2002%2Ftablify/lists"}