App for document scanning.
Fabian Hollaus, Florian Kleber, Markus Diem
DocScan makes use of native (C++) OpenCV and OpenCV Java API. The Java part is automatically downloaded after syncing.
For the native part you have to clone this repo:
git clone https://github.com/hollaus/opencv_libs.git opencv_native
Next you have to copy two folders from the native library to the project.
- copy
opencv_native/sdk/native/libs
toapp/src/main/jniLibs
- copy
opencv_native/sdk/native/jni/include
toapp/src/main/include
Alternatively, you can create symlinks - as written below. It is assumed that your project root folder (DocScan) and the opencv_native folder are on the same hierarchy level.
Windows:
cd app/src/main
mklink /d jniLibs ..\..\..\..\opencv_native\sdk\native\libs
mklink /d include ..\..\..\..\opencv_native\sdk\native\jni\include
Linux:
cd app/src/main
ln -s ../../../opencv_native/sdk/native/libs jniLibs
ln -s ../../../opencv_native/sdk/native/jni/include include
The app makes use of two APIs that require keys which are not published in the repository and should never be provided to the public. Instead not working dummy keys are provided in the following files:
gradle.properties
: contains the key for Dropbox integrationgoogle-services.json
: contains the key for Firebase integration (needed for OCR)
You can get the API key if you send a mail to [email protected]. Before you replace the dummy keys, assure that you do not commit the keys with the following commands:
git update-index --assume-unchanged google-services.json
git update-index --assume-unchanged gradle.properties
- Optional for testing the C++ module
- C++ lib for page segmentation and focus measure
- use CMake to create a Visual Studio Project
- source code path: DocScan/app/src/main
- binaries path e.g.: DocScan/build2015-x64
- Specify OpenCV_DIR
Google Play services need to be installed to use Firebase Jobdispatcher (https://github.com/firebase/firebase-jobdispatcher-android)
add google-services.json file.
Create asset folder: File->New->Folder->Assets Folder
Add "NAME.tflite" file in assets folder and change MODEL_NAME in PageSplit.java to NAME.