Coder Social home page Coder Social logo

androiddocumentscanner's Introduction

Android Document Scanner Library

version 1.4 green
minSDK 19 blue
license MIT yellowgreen

This library helps you to scan any document like CamScanner.

documentscannerMockup

Requirements

You need to implement openCV to run this library via import module on Android Studio. Use OpenCV library on this repository. Follow the lines below:

  • File → New → Import Module

  • Select " openCVLibrary " you’ve downloaded from this repository.

  • Click finish

  • Sync gradle

  • File → Project Structure → Select app under modules (this is your app module) → Go to dependencies tab

  • Click + button → Module dependency → Select openCVLibrary → Click ok → Click ok

  • Sync gradle

Add line below to your top level build.gradle

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

Add lines below to your app level build.gradle

    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'com.github.mayuce:AndroidDocumentScanner:1.4'

And Sync the gradle

Usage

To start ImageCrop process

ScannerConstants.selectedImageBitmap=btimap
startActivityForResult(Intent(MainActivity@this, ImageCropActivity::class.java),Constants.REQUEST_CROP)

Catch the cropped image

if (requestCode==Constants.REQUEST_CROP && resultCode== Activity.RESULT_OK )
        {
            if (ScannerConstants.selectedImageBitmap!=null)
                imgBitmap.setImageBitmap(ScannerConstants.selectedImageBitmap)
            else
                Toast.makeText(MainActivity@this,"Something wen't wrong.",Toast.LENGTH_LONG).show()
        }

Additional Features

On above Android 9.0 there is magnifier to help user to see zoomed image to crop.

Customizing ImageCropActivity

You can customize something in layout via ScannerConstants.

    // ScannerConstants.java
    public static String cropText="CROP",
            backText="CLOSE",
            imageError="Can't picked image,
            please try again.",
            cropError="You have not selected a valid field. Please make corrections until the lines are blue.";
    public static String cropColor="#6666ff",backColor="#ff0000",progressColor="#331199"; // Default Colors
    public static boolean saveStorage=false; // Make it true if you need image in your storage.

TO-DO

Nothing

Thanks

MIT License

Copyright (c) 2019 Muhammet Ali YUCE

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

androiddocumentscanner's People

Contributors

mayuce avatar

Watchers

 avatar

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.