https://github.com/Kuama-IT/android-document-scanner
A A4-ish document scanner for Android, based on opencv
https://github.com/Kuama-IT/android-document-scanner
android-library camerax document-scanner kotlin opencv
Last synced: 3 months ago
JSON representation
A A4-ish document scanner for Android, based on opencv
- Host: GitHub
- URL: https://github.com/Kuama-IT/android-document-scanner
- Owner: Kuama-IT
- License: mit
- Created: 2020-07-21T12:46:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-18T07:40:48.000Z (over 2 years ago)
- Last Synced: 2024-11-03T20:35:43.725Z (8 months ago)
- Topics: android-library, camerax, document-scanner, kotlin, opencv
- Language: Kotlin
- Homepage: https://github.com/kuamanet/android-document-scanner
- Size: 1.14 MB
- Stars: 167
- Watchers: 7
- Forks: 35
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://jitpack.io/#kuamanet/android-document-scanner)
[](https://opensource.org/licenses/MIT)
# Android Document Scanner
Contains an activity that allows the user to scan a A4 paper with the smartphone camera.
It is based on CameraX and OpenCV### Installation
Add it in your root `build.gradle` at the end of repositories:
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
Add the dependency
```groovy
dependencies {
implementation 'com.github.kuamanet:android-document-scanner:Tag'
}
```### Usage
Inherit from `BaseScannerActivity````kotlin
class ScannerActivity : BaseScannerActivity() {
override fun onError(throwable: Throwable) {
when (throwable) {
is NullCorners -> Toast.makeText(
this,
R.string.null_corners, Toast.LENGTH_LONG
)
.show()
else -> Toast.makeText(this, throwable.message, Toast.LENGTH_LONG).show()
}
}override fun onDocumentAccepted(bitmap: Bitmap) {
}override fun onClose() {
finish()
}
}```
### Preview
Detect document
Crop document
