You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Previously, OMRChecker used to read all images in grayscale. But since we're supporting colored inputs and outputs in the v2 release, it is time to improve the CropPage pre-processor to work on lighter colored backgrounds (see photos below). Currently, for images with light colored backgrounds e.g. light yellow backgrounds - after normalisation(cv2.normalize), the page boundary doesn't seem to get detected at all.
Describe the solution you'd like
We can introduce a flag in CropPage.tuningOptions{} to conditionally use cv2.Canny on the colored image instead of the grayscale image. This should help us find edges in the cases where background is not white but light colored (near-white in grayscale).
Describe alternatives you've considered
N/A
Additional context
Sample image where the grayscale calculation fails:
Debug outputs:
Note: please share your queries and approaches on discord for quicker discussions:
My approach to solution:
Adjust Color Thresholding: We will implement adaptive or dynamic thresholding techniques tailored for lighter backgrounds. Instead of global thresholds, we will use adaptive thresholding (e.g., cv2.adaptiveThreshold), which calculates thresholds based on local neighborhoods. This would help distinguish light colors from the background effectively.
Background Subtraction: We will consider adding a preprocessing step to subtract or neutralize the background color. By estimating the average background color (e.g., light yellow), we could remove or normalize the background color before further processing.
Edge Detection Tuning: Lastly we can use canny edge detection with parameters that are adjusted dynamically based on the brightness or saturation levels of the image. This could help detect boundaries more effectively on lighter backgrounds.
@Udayraj123 If you like this approach then plz assign me this issue
Hey @Prasadayus, for this task you will need to create a new sample image similar to the one shown in the issue description. Any OMR paper image on a light background like the yellow one would become overly bright and loose its edges, you can share a few samples like that and maybe we can pre-process it such that it fails for the current CropPage.
Is your feature request related to a problem? Please describe.
Previously, OMRChecker used to read all images in grayscale. But since we're supporting colored inputs and outputs in the v2 release, it is time to improve the CropPage pre-processor to work on lighter colored backgrounds (see photos below). Currently, for images with light colored backgrounds e.g. light yellow backgrounds - after normalisation(cv2.normalize), the page boundary doesn't seem to get detected at all.
Describe the solution you'd like
We can introduce a flag in
CropPage.tuningOptions{}
to conditionally use cv2.Canny on the colored image instead of the grayscale image. This should help us find edges in the cases where background is not white but light colored (near-white in grayscale).Describe alternatives you've considered
N/A
Additional context
Sample image where the grayscale calculation fails:
Debug outputs:
Note: please share your queries and approaches on discord for quicker discussions:
The text was updated successfully, but these errors were encountered: