Git Product home page Git Product logo

ballot-paper-counting-system's Introduction

Ballot-Paper-Counting-System

A Computer Vision Project on counting votes from ballot paper that count votes and display the result for Nepali Ballot Papers.

How we created datasets ? :

We downloaded a sample ballot paper from election.gov.np and synthesized datasets using PIL library by overlaying swastika symbol on blank ballot paper in order and by randomization. Here is how the process looks like: | Randomization| Generating Ballot Papers |

How it Works

For Valid Ballot

1. Read the image
2. Preprocess the image(Gaussian blur, edge detection, thresholding)
3. Apply contour detection( includes all contour including texts)
4. Approximate polygon with the contour and include only if it has 4 corners and satisfy size constraints
5. Sort the rectangular by top to bottom, left to right as they appear on paper
6. Process each rectangular contours and find if there is red pixel inside any of the box
7. Set that index to True if particular index contains red color
8. Check red pixel lies outside the boxes by filling contours with black color and searching for red pixel
9. Valid if there are 39 rectangular contours and no red color in multiple boxes and no red color outside these 39 rectangular boxes

See images below for stepwise illustration:

| Original Sample | After Applying filters| | Contour Detection |Contour Detection(Only Boxes)| | enter image description here |enter image description here |

Requirements:

  • numpy 1.16.3
  • matplotlib 3.0.3
  • opencv 3.4.3
  • imutils 0.5.2
  • PIL 4.3.0

ballot-paper-counting-system's People

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.