allgood / OpenNoteScanner

Android application for scanning and manipulating handwritten notes and documents.
Other
1.35k stars 283 forks source link

Enhancement: grayscale scans #254

Open rauferd opened 3 years ago

rauferd commented 3 years ago

I would love to be able to scan grayscale images with ONS. In my opinion, grayscale images are often the best compromise between file size, OCR quality/readability for computers, and optical impression/readability for humans.

Steps to reproduce:

Scan a new document. You can choose between (full) color oder black & white mode (using the "palette" icon).

Expected behaviour:

The ability to choose grayscale, as a third option.

Would you like to work on the issue?

Potentially. In your app, this would only affect very few lines (colorModeButton.setOnClickListener in OpenNoteScannerActivity.kt would have to have three options instead of the existing two, plus you would need to show a new message in addtion to string.bwMode and string.colorMode). That part is straightforward, so I could write a pull request and test it. Unfortunately, I do not understand the OpenCV part at all, i.e. which "colorMode" to send to the function sendImageProcessorMessage(). Or maybe that's not even possible and one would have to use OpenCV's cvtColor() on a full color image. I don't know when/if I will find the time to figure that out... :man_shrugging:

Alternatively, one could consider implementing some sort of "outsourced" camera control (as requested in #97). In this case, one could choose grayscale mode in the external (?) camera settings screen. From ONS' point of view, we would then receive a "color image" that happens to contain only gray colors.

kofaysi commented 3 years ago

Switch off Color mode and Image Processor mode (both in the top action bar) and the app will scan in grayscale.