Git Product home page Git Product logo

document-scanner's Introduction


Document Scanner

This app turns your mobile into a portable scanner, which can be used for scanning handwritten notes and printed documents.

It automatically detect the edge of the paper over a contrasting surface. When using the printed special page template it automatically detects the QR Code printed on the bottom right corner and scans the page immediately. After the page is detected, it compensates any perspective from the image adjusting it to a 90 degree top view and saves it on a folder on the device.

It also incorporates OCR functionality which the user can use to detect text from documents and save them as editable text files in the external storage of the device.

It is possible to launch the application from any other application that asks for a picture.


Features

  • Scan handwritten or printed documents
  • Detects page frame and corrects perspective
  • Fast and smooth Image Processing on the fly
  • Scans are saved to your device as images
  • Detect text using the OCR functionality of the app
  • Save the detected texts as editable text files to your device.
  • Easily share scanned docs with others via social media, email attachment or sending the doc link.

Screenshots

Libraries

  1. OpenCV Android v3.1.0 for capturing and manipulation of images. Due to this version of OpenCV integerated in the app, it needs to run on Android 5.0 (lollipop) or newer. You can integrate a lower version of OpenCV like v2.4.3 if you want to run the app on devices below Android 5.0.

    This stackoverflow link demonstrates the static initialization of OpenCV in Android Studio. The OpenCV native libraries are the main reason for the 38mb sized APK. To avoid this, you can make use of OpenCV Manager application which should to be installed on the android device so as to make OpenCV work.

Google Services:

  1. Google Zxing for barcode detection and image processing.

  2. Google Mobile Vision Text API to see and understand text using OCR.

  3. Google Analytics to measure user interaction with the app.

    If you want to use Google Analytics in your app, you'll require a configuration file. You must have a Google Analytics account and a registered property to get the configuration file.

    Then copy the google-services.json file you just downloaded into the app/ or mobile/ directory of your Android Studio project. Open the Android Studio Terminal pane: For Windows : $ move path-to-download/google-services.json app/ For Mac/Linux : $ mv path-to-download/google-services.json app/

  4. Android-Universal-Image-Loader for loading, caching and displaying images in the gallery grid layout.

  5. FABToolbar for implementing a Floating Action Button transforming into toolbar.

  6. Drag-Select-RecyclerView for Google Photos style multiselection for RecyclerViews.

External code and References

This project wouldn't have been possible without the following great resources:

not to forget:


document-scanner's People

Contributors

aniruddha-tapas avatar paitoanderson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

document-scanner's Issues

Share Button Not Working

There is a share button in the app. If I open any saved doc or ocr text file from the list the share button supposed to share the scanned doc or ocr. But when I click on the share button the app stops. I tested with android 10.

Native method not found: org.opencv.core.Mat.n_Mat:(DDI)J

in this project i am having this issue, kindly help me to solve the problem
11-07 13:04:06.364 23164-23164/com.masha.Document.Scanner.HD.Image E/dalvikvm: heapsize Dalvik_dalvik_system_VMRuntime_nativeMinimumHeapSize 0
11-07 13:04:06.364 23164-23164/com.masha.Document.Scanner.HD.Image E/dalvikvm: heapsize Dalvik_dalvik_system_VMRuntime_nativeMinimumHeapSize 11442880
11-07 13:04:06.424 23164-23164/com.masha.Document.Scanner.HD.Image E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV
11-07 13:04:06.694 23164-23164/com.masha.Document.Scanner.HD.Image E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
11-07 13:04:19.246 23164-23164/com.masha.Document.Scanner.HD.Image E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.masha.Document.Scanner.HD.Image, PID: 23164
java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.core.Mat.n_Mat:(DDI)J
at org.opencv.core.Mat.n_Mat(Native Method)
at org.opencv.core.Mat.(Mat.java:50)
at com.masha.Document.Scanner.HD.Image.DocumentScannerActivity.onPreviewFrame(DocumentScannerActivity.java:940)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:971)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:979)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
at dalvik.system.NativeStart.main(Native Method)
11-07 13:04:19.357 23164-23174/com.masha.Document.Scanner.HD.Image E/System: Uncaught exception thrown by finalizer
11-07 13:04:19.357 23164-23174/com.masha.Document.Scanner.HD.Image E/System: java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.core.Mat.n_delete:(J)V
at org.opencv.core.Mat.n_delete(Native Method)
at org.opencv.core.Mat.finalize(Mat.java:911)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:190)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:172)
at java.lang.Thread.run(Thread.java:862)

Only One tine document is scanned

Actually i want number of document to be scanned.Library is allowing us to take one picture at time and finishes again we have to start.I want this app for multiple documents and functionality of grouping the items together means After scanned documents must be grouped according to the date or use.

Isn't detecting the document's boundaries.

Installed the app on two different devices running different android versions (5.1 and 6). Tried to scan the document after clicking the scanDocumentButton but does not detect the document's boundaries even on totally contrasting backgrounds. OCR on 5.1 seems to be working but wasn't working on redmi (API 23)

Feature request: Send scanned data to postgreSQL

First of all, It is not an issue actually.

Thanks to @Aniruddha-Tapas for building such a useful app.

I am using this app to detect text using OCR. I was wondering if we could send the scanned data to PostgreSQL database. I am very new to android development. No idea on how to achieve the mentioned objective.

Please help you have done that or have the code for it.
Thanks in advance.

myConfigs is unknown for signingConfig

There is no code block found for myConfig

this error appears

Error:(19, 0) Could not get unknown property 'myConfigs' for SigningConfig container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer.
Open File

[FAQ] OCR engine used

Hi @Aniruddha-Tapas,

I would like to know which OCR engine have you used ?

I have tried to scan checks using tesseract OCR engine.

If it is tesseract then I can use your code to scan checeks as well.

Thanks for nice project.

Merge edge detection function and OCR function.

What are the possibilities of merge above two functions? I have found for edge detection in OpenCV you have used SurfaceHolder.Callback and for OCR CameraSource. Is it possible to implement edge detection in CameraSource?

Gradle Sync Failed

Gradle sync failed: Unsupported method: SyncIssue.getMultiLineMessage().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.

Document edge detect and Autocrop image

Namaste Aniruddha,

I would like to create simple android app where I would like to detect document and it boundary and auto crop image.

I saw you are doing it in your app, as below (automatically detect the edge of the paper over a contrasting surface).

Please let me know, how to achieve it and is there a guide or pointer to follow so that I can create the simple app.

screenshot1

Android Version below 5.0

Will the Library work on devices below 5.0... Can i make it run on 5.0 below android devices. Please Help Me

Unsupported modules detected

Compilation is not supported for following modules: ConText-Scanner, app. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.

On cloning this repo, I'm getting this error. Can you please help me to get it solved. Am I missing some important step(s)?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.