This repository contains an application for image binarization, specifically designed for historical document images. The application utilizes advanced techniques based on Convolutional Neural Networks (CNNs) to achieve accurate and efficient binarization results. The backend of the application is implemented using Flask, while the frontend is built with Bootstrap.
- Introduction
- Installation
- Optimizations
- Used By
- Author
- References
The application offers a user-friendly interface for uploading document images and applying binarization techniques. Binarization is the process of converting a grayscale or color image into a binary image, where each pixel is represented as either black or white. This is particularly useful for enhancing the legibility and extracting text from historical documents.
Clone the repository onto your local machine:
git clone https://github.com/agniramadani/ImageBinarization.git
Create a virtual environment:
python3 -m venv name
Activate the virtual environment for MacOS or Linux::
. bin/activate
Activate the virtual environment for Windows:
source name/bin/activate
Download DPLinkNet weights and save them inside the cloned app directory, you can follow these steps:
cd /path/to/cloned/app
Unzip the file using the appropriate command:
unzip dplinknet_weights.zip
[Important Note]: Please be aware that in the code, instead of using the name "dplinknet_weights", only "weights" is utilized. It is highly recommended to either rename the file "dplinknet_weights" to "weights" or make the necessary changes within the code.
To rename the file for MacOS or Linux:
mv dplinknet_weights weights
For Windows:
ren dplinknet_weights weights
To install the required dependencies, run the following command:
make install
Once the installation is complete, you can start the app by running the following command:
make start
The image binarization algorithm employed in this application has been specifically modified to cater to the unique requirements of historical document processing, particularly within the domain of ancient history. Unlike the original DP-LinkNet algorithm, which does not have inherent support for both CUDA and CPU platforms, the modified algorithm in this application has been optimized to ensure efficient performance on both hardware configurations. This adaptation offers users the flexibility to utilize the application on their preferred hardware, regardless of whether it is CUDA-enabled or CPU-based.
The image binarization application is used by:
Here you can explore further details about the DP-LinkNet algorithm, which serves as a key reference for the development of the image binarization capabilities in this application.