OMRChecker icon indicating copy to clipboard operation
OMRChecker copied to clipboard

[Feature][Core] Auto Rotating the OMR sheet

Open Udayraj123 opened this issue 2 years ago • 9 comments

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 .

Udayraj123 avatar Sep 29 '22 17:09 Udayraj123

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

aksha123-git avatar Oct 04 '22 04:10 aksha123-git

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 avatar Oct 04 '22 04:10 Udayraj123

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

Udayraj123 avatar Oct 20 '22 04:10 Udayraj123

Please assign this issue to me

Gauravmauryaios avatar Dec 20 '22 12:12 Gauravmauryaios

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

Udayraj123 avatar Dec 21 '22 18:12 Udayraj123

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)
        """

Udayraj123 avatar Jan 08 '23 18:01 Udayraj123

@Udayraj123 sure

Gauravmauryaios avatar Jan 09 '23 14:01 Gauravmauryaios

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 avatar May 01 '24 12:05 Udayraj123

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.

Udayraj123 avatar May 12 '24 10:05 Udayraj123