Skip to content

Android Document Filter is an Android Library built on top of OpenCV that provides various filters for document scanning.

License

Notifications You must be signed in to change notification settings

garg-lucifer/AndroidDocumentFilter

Repository files navigation

AndroidDocumentFilter

Android Document Filter is an Android Library that makes it simple to add commonly used filters in document image processing, such as Magic Filter, Shadow Remvoal, Black and White Filter, Lighten Color, and GreyScale Filter. It performs all resource-intensive tasks in the background thread.

Screenshots

Setup

First, add jitpack in your build.gradle at the end of repositories:

repositories {
   // ...       
   maven { url "https://jitpack.io" }
}

Then, add the library dependency:

implementation 'com.github.garg-lucifer:AndroidDocumentFilter:0.7.0'

Usage

DocumentFilter documentFilter = new DocumentFilter();

// replace getFilter_Name with the filter you want to use
documentFilter.getFilter_Name(image_bitmap, new DocumentFilter.CallBack<Bitmap>() {
                    @Override
                    public void onCompleted(Bitmap bitmap) {
                        // Do your tasks here with the returned bitmap
                    }
                });

// for example shadow removal
documentFilter.getShadowRemoval(image_bitmap, new DocumentFilter.CallBack<Bitmap>() {
                    @Override
                    public void onCompleted(Bitmap bitmap) {
                        // Do your tasks here with the returned bitmap
                    }
                });

Thanks

Thanks OpenCV for this amazing library. - https://opencv.org/

LICENCE

AndroidDocumentFilter by [Naman Garg] is licensed under a Apache License 2.0.