All Projects → mayuce → Androiddocumentscanner

mayuce / Androiddocumentscanner

Licence: mit
This library helps to scan a document like CamScanner.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androiddocumentscanner

Ai Job Notes
AI算法岗求职攻略(涵盖准备攻略、刷题指南、内推和AI公司清单等资料)
Stars: ✭ 3,191 (+1108.71%)
Mutual labels:  opencv, image-processing
Omrchecker
Grade exams fast and accurately using a scanner 🖨 or your phone 🤳.
Stars: ✭ 189 (-28.41%)
Mutual labels:  opencv, image-processing
Scene Text Recognition
Scene text detection and recognition based on Extremal Region(ER)
Stars: ✭ 146 (-44.7%)
Mutual labels:  opencv, image-processing
Autoannotationtool
A label tool aim to reduce semantic segmentation label time, rectangle and polygon annotation is supported
Stars: ✭ 113 (-57.2%)
Mutual labels:  opencv, image-processing
Computer Vision Guide
📖 This guide is to help you understand the basics of the computerized image and develop computer vision projects with OpenCV. Includes Python, Java, JavaScript, C# and C++ examples.
Stars: ✭ 244 (-7.58%)
Mutual labels:  opencv, image-processing
Color Tracker
Color tracking with OpenCV
Stars: ✭ 128 (-51.52%)
Mutual labels:  opencv, image-processing
Opencv Python Tutorial
📖 OpenCV-Python image processing tutorial for beginners
Stars: ✭ 2,425 (+818.56%)
Mutual labels:  opencv, image-processing
Imagestitching
Conducts image stitching upon an input video to generate a panorama in 3D
Stars: ✭ 98 (-62.88%)
Mutual labels:  opencv, image-processing
Thug Memes
Command line Thug Meme generator written in Python
Stars: ✭ 224 (-15.15%)
Mutual labels:  opencv, image-processing
Superpixels Revisited
Library containing 7 state-of-the-art superpixel algorithms with a total of 9 implementations used for evaluation purposes in [1] utilizing an extended version of the Berkeley Segmentation Benchmark.
Stars: ✭ 222 (-15.91%)
Mutual labels:  opencv, image-processing
Ios Rubik Solver
An iOS app that detects a 3x3 Rubik's cube, recognizes the color of all cubies, solves it and provides a 3D visualisation of the solving process.
Stars: ✭ 111 (-57.95%)
Mutual labels:  opencv, image-processing
Opencv
Open Source Computer Vision Library
Stars: ✭ 58,652 (+22116.67%)
Mutual labels:  opencv, image-processing
Nvidia Gpu Tensor Core Accelerator Pytorch Opencv
A complete machine vision container that includes Jupyter notebooks with built-in code hinting, Anaconda, CUDA-X, TensorRT inference accelerator for Tensor cores, CuPy (GPU drop in replacement for Numpy), PyTorch, TF2, Tensorboard, and OpenCV for accelerated workloads on NVIDIA Tensor cores and GPUs.
Stars: ✭ 110 (-58.33%)
Mutual labels:  opencv, image-processing
Haskell Opencv
Haskell binding to OpenCV-3.x
Stars: ✭ 145 (-45.08%)
Mutual labels:  opencv, image-processing
Is Now Illegal
🚫 A NERD protest against Trump's Immigration ban
Stars: ✭ 1,392 (+427.27%)
Mutual labels:  opencv, image-processing
Invisibility cloak
This is a fun application of image processing which enables you to experience the magic of an invisibility cloak. Let's make our childhood fantasy of using an invisibility cloak come true.
Stars: ✭ 176 (-33.33%)
Mutual labels:  opencv, image-processing
Traffic Sign Detection
Traffic signs detection and classification in real time
Stars: ✭ 96 (-63.64%)
Mutual labels:  opencv, image-processing
Sign Language Recognition
✌️ 👌 ✊ 📷 Sign Language Recognition using Python
Stars: ✭ 98 (-62.88%)
Mutual labels:  opencv, image-processing
Marvel
Marvel - Face Recognition With Android & OpenCV
Stars: ✭ 199 (-24.62%)
Mutual labels:  opencv, image-processing
Buildopencvtx2
Build and install OpenCV for the NVIDIA Jetson TX2
Stars: ✭ 249 (-5.68%)
Mutual labels:  opencv, image-processing

Android Document Scanner Library

image::https://img.shields.io/badge/version-1.5.3-green.svg[] image::https://img.shields.io/badge/minSDK-19-blue.svg[] image::https://img.shields.io/badge/license-MIT-yellowgreen.svg[]

This library helps you to scan any document like CamScanner.

image::documentscannerMockup.png[]

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

[source,bourne]

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

Add lines below to your app level build.gradle

[source,bourne]

implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.github.mayuce:AndroidDocumentScanner:1.5.3'

And Sync the gradle

Usage

To start ImageCrop process

[source,java]

ScannerConstants.selectedImageBitmap=btimap startActivityForResult(Intent([email protected], ImageCropActivity::class.java),Constants.REQUEST_CROP)

Catch the cropped image

[source,java]

if (requestCode==Constants.REQUEST_CROP && resultCode== Activity.RESULT_OK ) { if (ScannerConstants.selectedImageBitmap!=null) imgBitmap.setImageBitmap(ScannerConstants.selectedImageBitmap) else Toast.makeText([email protected],"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.

[source,java]

// 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. 

(NEW) Version 1.5 Feature - Custom Scanner Activity!

With 1.5 version you have a feature to create your own Document Scanner Activity. You still can use old customization via ScannerConstants or you can create a new scanner activity for your layout.

HOW

  • Place Scanner layout to your layout

[source,bourne]

    <FrameLayout
            android:id="@+id/frameLayout"
            android:layout_width="match_parent"
            android:layout_height="0dp" --- * Set HERE *
            android:layout_weight="8" --- * Set HERE *
            android:layout_gravity="center"
            android:layout_margin="10dp">

        <FrameLayout
                android:id="@+id/holderImageCrop"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:layout_margin="10dp">

            <ImageView
                    android:id="@+id/imageView"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:adjustViewBounds="true"/>
        </FrameLayout>

        <com.labters.documentscanner.libraries.PolygonView
                android:id="@+id/polygonView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:visibility="gone"/>
    </FrameLayout>

  • Extend your activity from DocumentScannerActivity
  • Provide values

[source,java]

@Override
protected FrameLayout getHolderImageCrop() {
    return holderImageCrop;
}

@Override
protected ImageView getImageView() {
    return imageView;
}

@Override
protected PolygonView getPolygonView() {
    return polygonView;
}

@Override
protected Bitmap getBitmapImage() {
    return cropImage;
}

  • Override methods

[source,java]

@Override
protected void showProgressBar() {
    RelativeLayout rlContainer = findViewById(R.id.rlContainer);
    setViewInteract(rlContainer, false);
    progressBar.setVisibility(View.VISIBLE);
}

@Override
protected void hideProgressBar() {
    RelativeLayout rlContainer = findViewById(R.id.rlContainer);
    setViewInteract(rlContainer, true);
    progressBar.setVisibility(View.GONE);
}

@Override
protected void showError(CropperErrorType errorType) {
    switch (errorType) {
        case CROP_ERROR:
            Toast.makeText(this, ScannerConstants.cropError, Toast.LENGTH_LONG).show();
            break;
    }
}

And after setting your view call startCropping() method

If you have a trouble you can follow follow com.labters.documentscanner.ImageCropActivity for how to do that.

TO-DO

  • Remove RxJava dependency.

Thanks

[source,bourne]

MIT License

Copyright (c) 2020 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].