Android Question Document scanning


Staff member
Licensed User


Active Member
Licensed User
I don't need necessary the text of the document. I just need a scan from the document. If it is slanted then it should adjust and send it like a PDF.
The last step (sending) is the easiest.


Well-Known Member
Licensed User
If you want to transform the document so it will be straight then you should learn about OpenCV:
If the picture is not only XY-rotated but also taken from an angle that is not perpendicular to the document planar surface, there will also be some perspective deformation.
As Erel said, Opencv can be used to detect the contours, then the edges, and 'undo' this XY-rotation and perspective using homography.

Some programming is involved, and reliability will depend on image quality (homogeneus background, avoiding other objects in the picture,...among others)