Thank you for the suggestions! I will for sure take it into consideration.
The scanner itself is from another open source project, the only one which was a viable option. I'll have to look into OpenNoteScanner's scanner if I were to improve mine. Seems people are happy with the edge detection it offers.
Thank you :)