-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement][Core] New approaches for Page/Template Alignment #196
Comments
Hi @Udayraj123, I’m interested in contributing to this issue and exploring solutions for improving Page/Template alignment. Based on my understanding, document scanning apps like CamScanner tackle similar alignment problems using a combination of Edge Detection, Perspective Transformation, and Image Warping techniques. Here’s my proposed approach: Detect Key Points & Borders: Use Canny Edge Detection + Contour Detection to find the sheet’s boundaries. Hough Line Transform can help ensure straight edges. Looking forward to contributing! 🚀 |
Hi @akashrajk54, glad to see someone showing an interest in having a go at this challenging problem. You can start with applying Feature matching to get a basic alignment solution, for interpolating data you can explore different popular methods. I have been following and attempting some document de-warping techniques to solve this, especially methods that make use of the layout of the page elements which is fixed per OMR Template. I have some starter code in the dev branch for this. |
Hi @Udayraj123, thanks for the response! I’ll start by implementing Feature Matching for basic alignment and explore different interpolation methods. I’ll also check the dev branch to understand the existing approach. Could you please share the Discord server link so I can join the discussion there? |
@akashrajk54 do join here: https://discord.com/channels/590134763784896514/1223641111722197042/1223641117459873832, I've updated the link in issue description as well. Feel free to ask questions especially about the template alignment code |
The template alignment problem is one of the central problems which currently remains unsolved for a general OMR sheet. This issue tracks various issues that we have noticed over a period of time in various samples.
Shifts during scanning
Despite fixing page curvature, we may still face the template alignment problem. Sometimes a scanner may malfunction at minute levels, we have seen uneven stretching of the page when using a basic scanner. The boxes need to be close to the bubbles otherwise the output is not reliable for any OMR checking software.

Example:
Curvature during bulk scanning
Sometimes the scan itself seems to be curved. we can see that the instructions text is not in a straight horizontal line.

Example:
The scans need to be straightened before applying template detection.
PDF-printed vs Photocopied misalignment
We have also seen shifts upto 10 pixels between scans of pdf-printed vs photocopied sheets. Link to an explainer: Google Drive
Describe the solution you'd like
Rough notes (ref):
Describe alternatives you've considered
There are many other approaches that can be tried:
Additional context
NA
Link to Discord Thread: New Approaches for Page/Template Alignment
The text was updated successfully, but these errors were encountered: