Posts

Showing posts with the label bill

Automatic Tool for Cropping Bills from Scans

Image
What Is It? At work, we’re developing a project aimed at small and medium-sized businesses that goes beyond simple accounting. It includes many innovative features, but today I want to focus on one in particular: the automatic processing of bills and invoices. Users can take advantage of this feature via a mobile client (Android, iOS) or a web application. The Challenge We encountered an issue where users were scanning multiple bills together in a single image, rather than following the "one image - one document" rule. This made it difficult to process the documents correctly. To address this, I developed a script that automatically detects and crops these multi-bill images into separate, individual images. The Algorithm To separate and crop the bills from a scanned image, I used a series of simple image preprocessing methods: Resize : The image is resized to a standard dimension for consistency. Morphological Operation (IMOPEN) : This step helps in removing noise and refinin...