Udayraj123 / OMRChecker

Evaluate OMR sheets fast and accurately using a scanner 🖨 or your phone 🤳.
MIT License
735 stars 304 forks source link

[Feature][Core] Auto Rotating the OMR sheet #36

Open Udayraj123 opened 1 year ago

Udayraj123 commented 1 year ago

We want to be able to identify and correct rotation of input images

Some ideas

  1. Firstly, we can take expected page orientation(portrait/landscape) from user.
  2. For a start, check for height-width ratio and always rotate clockwise (ignore wrongly rotated images, will be separated later).
  3. Try both clockwise and anti-clockwise corrections and the one with the "more correct" histogram will be considered.

Acceptance criterion:

  1. The code should run for rotated versions of all sample images in the repo.
  2. Proper logging of rotations should be done to make debugging easier

Example real user validation: https://discord.com/channels/590134763784896514/590134763784896520/908620446201696316

Note: this issue is marked with the hacktoberfest label. Follow #hacktoberfest-discussions on Discord for further details .

aksha123-git commented 1 year ago

I would like to work on this issues please assign it to me

Udayraj123 commented 1 year ago

Hi @aksha123-git , no problem! please go through the code once and discuss an approach for this on discord. Once we have a clarity on how to move forward I'll assign it to you. fyi there is one more person who has approached me to work on this. So better to start a discussion soon.

Udayraj123 commented 1 year ago

@aksha123-git let me know if there are any updates or any help needed :)

Gauravmauryaios commented 1 year ago

Please assign this issue to me

Udayraj123 commented 1 year ago

@Gauravmauryaios you can discuss your approach with me on discord before getting assigned :)

Udayraj123 commented 1 year ago

Pasting approaches from the code comment here:

        """
        TODO later Autorotate:
            - Rotate 90 : check page width:height, CW/ACW?
                - do CW, then pass to 180 check.
            - Rotate 180 :
                - check markers centroid (OMR specific, paper warping may be imperfect.)
                - OCR check
            - Check column fields like roll field after morphing should be 'vertical' (based on col_orient)
        """
Gauravmauryaios commented 1 year ago

@Udayraj123 sure

Udayraj123 commented 4 months ago

Adding an approach for OMR sheets containing a "direction indicator" marker -

image

We can create a pre-processor that auto-rotates the image based on the presence of a marker in a given position (it will hit and try the rotations in the order - top, bottom, left, right ref: https://products.aspose.app/omr/create-answer-sheet

Udayraj123 commented 4 months ago

Changing difficulty from Medium to Hard considering the scope of the problem is now more generic and an abstract solution is possible from the current dev branch.