Giter Site home page Giter Site logo

eslamashhraf / grades-auto-filler Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 575.93 MB

πŸ“™ Grades auto-filler provide an easy way to fill the grades electronically, and it should be able to correct MCQ bubble sheet exams automatically.

License: MIT License

Python 100.00%
image-processing cufe-2024 bubble-sheet detection grades image-classification image-processing-python mcq grades-sheet excel-sheet

grades-auto-filler's Introduction

πŸ“„ Grade Autofiller

logo

πŸ“ Table of Contents


πŸ“™ About

Grade Autofiller is an assistant to TAs and Professors in our department (Computer Department). It should provide an easy way to fill the grades electronically, and it should be able to correct MCQ bubble sheet exams automatically.

image


πŸš€ Get Started

  1. Clone the repository
    $ git clone https://github.com/AdhamAliAbdelAal/Grades-autofiller.git
  2. You can use and choose module from this file

    $ cd './Code/GUI.py'

🫧 Bubble Sheet

How the bubble sheet corrector works

List of steps we take to process the input sheet and get our results

1. Extract the paper from the image.

2. Convert the RGB image to gray scale image

3. Convert the image to binary image using local thresholding

4. Extract the ID box from the paper and erase it

5. Erode the image to get rid of false chosen bubbles

6. Detect the external contours an draw them on the original image

7. Calculate the bounding rectangle of the contours and get its coordinates, width and height and calculate aspect ratio

8. Calculate the contour perimeter

9. Approximate each contour to polygon

10. Calculate each contour area

11. Filter the contours so if the aspect ratio ∈ [0.8,1.2], the number of contour vertices is greater than 4, the contour area is greater than 30 (threshold to ignore small circles or contours) and the contour is a closed one then it will be considered as a bubble

12. Collect all contours areas in array and calculate the average area (the mean of areas should be very close to the bubbles area because the most frequent contours are the bubbles contours).

13. Another filter to the output contours that resulted from the first filter by check if the area of each contour is within 30% error with the average contour area then bubbles contours are only residual contours

14. Sort the contours from top to bottom

15. Calculate the number of choices and the number of question in each row by using x and y coordinates of each bubble (bubbles belong to the same question are colored with the same color).

16. Iterate over each row and sort the contours from left to right.

17. Iterate over each question and calculate the number of pixels in each bubble that equal to one.

18. Check if the student select more than one choice or no choice the answer will be X but if the student select only one choice so the answer will be the character of the choice (A, B, C, etc.).

19. Calculate the number of rows and map the result array to the real data

20. Output will be in excel sheet like this

excel sheet name "result Grades sheet"


πŸ“– Grades Sheet

How the Grades Sheet is processed

List of steps taken to process the Grades Sheet

1. Paper Extraction and Image Warping

2. Table and Cells Detection

Horizontal Lines Detect Vertical Lines Detect Intersection Lines Detect

3. ID Detection

2 Methods were used:  

  • OCR
  • Classifiers

4. Handwritten Digits Detection

5. Signs Detection

6 different signs

Sign Square Question Mark Check Mark Horizontal Lines Vertical Lines Empty
Image
Output 0 empty cell with a red background color 5 (5 - i) where i is the number of lines number of lines 0

6. Output will be in excel sheet like this

excel sheet name "result Grades sheet"

Warping & Paper Extraction

1. Applied Canny Edge Detector followed by Dilation to connect broken edges

2. Extracted Contours, then extracted the largest based on area (the paper contour)

3. Measured width and height of the contour (using the 4 corners)

4. Calculated coordinates for the new points (warped), and transformed the original points to these coordinates.

Digits Detection

Data Acquisition and Model Training for Digits Detection (Digital and Handwritten)

The main idea is to train different models then use a polling system to collectively increase the accuracy of the system β€” beyond the accuracy of each on their own.

Single Digits Detection

1. Not much Pre-Processing was needed for the single handwritten digits, just a noise reduction filter.

2. Computed HoG of each digit picture and passed to the classifiers to determine the output.

ID Detection

1. Extracted Contours [For Digits], Then Filtered out very small contours [Not Digits]

Now, we have contours containing single digits or a group of connected digits.

2. Get the Average Width of all contours

3. Divide the each contour width by the average width [integer Division]; to know how many digits are in each picture

4. If the quotient of the division is less than a certain threshold, then it contains a single digit. Otherwise, divide the contour into a number of smaller contours [each containing a single digit] according to the quotient.

5. Computed HoG of each digit picture and passed to the classifiers to determine the output.

πŸ‘‘ Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

Contributors


Adham Ali


Menatalh Hossamalden


Eslam Ashraf


Mohamed Walid

πŸ”’ License

Note: This software is licensed under MIT License, See License for more information Β©Mohamed Walid.

grades-auto-filler's People

Contributors

adhamaliabdelaal avatar eslamashhraf avatar mennatalhhossamalden avatar mohamedww avatar

Stargazers

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