Skip to content

AdhamAliAbdelAal/Grades-autofiller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages