Probably not looking for solution, but looking for guidance on this. This is to implement "document scanner" in our Android app.
I need to do precisely this:
What I tried. We tried to use Open CV. It's huge, there is NDK. Setup and infrastructure pretty complex.
Is there anything that's lighter and designed for exactly this task? Even commercial might be fine.
Just looking for suggestions on how to approach this.. Main problem is to detect edges and transform I think..
I do not know of any libraries that will handle this for you, but I have come across few open source projects that achieve a similar result. Most are based on the OpenCV library and/or the OpenCV4Android SDK. Here are a few noteworthy projects:
Another similar library is Google's Mobile Vision API, which contains a Text Recognition API. Though this will not enable you to convert a document into a black and white image, it would enable you to convert a document into plain text.
As for converting the image for transmission over a network; Android does not natively support the TIFF file format, though there is at least one library that will handle this conversion for you. Android does natively support compressing an image as JPEG, PNG or WEBP, which you can use to send data over the network as an encoded string:
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
byte[] bytes = outputStream.toByteArray();
String encodedImage = Base64.encodeToString(bytes, Base64.DEFAULT);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With