Coder Social home page Coder Social logo

dealing_with_docs's Introduction

๐Ÿงฝโœ‚๏ธ Dealing with Docs with OpenCV ๐Ÿ–ผ๏ธ๐Ÿ›ก๏ธ

This repo contains a tool to perform different transformations of a pdf volume of several pages:

  • ๐Ÿงน Filtering Volume

    This tool can be used to filter a pdf volume with several pages to obtain a reduced version of the original pdf file. The user can choose to keep certain pages or discard them based on the following features:

    • Empty pages (always discarded)
    • Pages with shields
  • โœ‚๏ธ ๐Ÿ“ƒ๐Ÿ“ƒ๐Ÿ“ƒ Volume Fragmentation

    This tool can be used to split a pdf volume with several pages to obtain subdocuments corresponding to single files originally integrated in the big pdf volume. The difference between subdocuments is detected based on background changes, size changes and shield detection. Empty pages will be always discarded.

Flow

Requirements

  • A suitable conda environment named dealing_with_docs can be created and activated with:
conda env create -f environment_deal_docs.yml
conda activate dealing_with_docs

Poppler must be installed and placed a ./libs/ folder:

poppler_path = './libs/poppler-0.68.0/bin'

โš ๏ธ Note that other versions of poppler have not been tested. ๐Ÿ‘‰More about Poppler and how to install it

Context

This tool was conceived to process scanned documents. More in particular, the shield detection comes from the fact that the documents were official administration volumes.

The idea is to reduce the size of these huge volumes containing subdocuments (action clean) or splitting into different pdf files contained in the complete volume pdf for further processing (action split).

How to

There are two modes to execute this tool in terms of what is our starting point. The pdf volume must be in a folder inside ./input_volume/ with name <volume_name>.

  • PDF: First time executing the volume and pdf to image must be done (in order to obtain single images per volume page)
dealing_with_docs>python dealing_with_docs.py <volume_name> PDF <action>
  • IMG: When pdf to image has already be done and this step can be skipped
dealing_with_docs>python dealing_with_docs.py <volume_name> IMG <action>

Also, the two tools contained in this scripts are activated with the argument:

  • action = clean_keep : Filtered pages will be kept
  • action = clean_discard : Filtered pages will be discarded
  • action = split : Volume will be fragmented

dealing_with_docs's People

Contributors

razwand 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.