Page search and page conversion on an Android page. Convert to Black and White

You are probably not looking for a solution, but looking for guidance on this. This means that the “document scanner” is used in our Android application.

I need to do just that:

  • Take an image with a camera (no problem)
  • Detecting page edges / corners (???)
  • Allow user to move / adjust angles (no problem)
  • Convert an image to make it a rectangle (???)
  • Converting an image to B / W TIFF or another suitable format for transmission over a mobile network (compact, bit per pixel) (???)

What have I tried. We tried to use Open CV. This is huge, there is NDK. The setup and infrastructure are quite complex.

Is there anything easier and designed specifically for this task? Even advertising can be wonderful.

Just look for suggestions on how to approach this. The main problem is edge detection and transformation, I think.

+5
source share
1 answer

I don't know any libraries that will handle this for you, but I came across several open source projects that achieve a similar result. Most of them are based on the OpenCV library and / or the OpenCV4Android SDK . Here are a few noteworthy projects:

Another similar library is the Google Mobile Vision API , which contains the Text Recognition API . Although this will not allow you to convert the document into a black and white image, it will allow you to convert the document into plain text.

Regarding image conversion for transmission over a network; Android does not natively support the TIFF file format, although there is one library that will handle this conversion for you. Android supports image compression like JPEG, PNG or WEBP , which you can use to transmit 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); 
+3
source

All Articles