Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin doesn't scan correctly #59

Open
nvwebm opened this issue Sep 2, 2019 · 9 comments
Open

Plugin doesn't scan correctly #59

nvwebm opened this issue Sep 2, 2019 · 9 comments
Assignees

Comments

@nvwebm
Copy link

nvwebm commented Sep 2, 2019

Describe the bug
I tried to scan a document with a text in it, and it didn't recognize the edges of the document.
also it adds a black square to part of the exported image
To Reproduce
Steps to reproduce the behavior:

  1. Install the plugin on Android device and try to scan with it

Expected behavior
Detect edges and hide memory notification
Screenshots
If applicable, add screenshots to help explain your problem.
Video: https://ufile.io/0ne9wimy (can't upload to github)

Smartphone (please complete the following information):
Device: oneplus 5/6T

Additional context
I have largeHeap in my manifest

@ChrisTomAlx
Copy link
Collaborator

Hey @nvwebm
Thanks for raising the issue and sticking to the template.
Could you try by changing the quality value to 2 in the scan options you pass in.
Also try with a background with a little more contrast. The android scanner edge detection still requires some improvement.

Cheers and have a nice day :)
Chris
Neutrinos

@ChrisTomAlx ChrisTomAlx self-assigned this Sep 3, 2019
@nvwebm
Copy link
Author

nvwebm commented Sep 3, 2019

export interface DocumentScannerOptions {
    /**
     * Choose to scan from camera or existing image file. Only valid for Android.
     */
    sourceType?: DocumentScannerSourceType;
    /**
     * Filename to save scanned image to (minus extension, which is always ".png").
     * Only valid for iOS. Caller is responsible for cleaning up any files created
     * if this parameter is set to anything other than the default value,
     * which is "image".
     */
    fileName?: string;
}

this is the interface of options there is no quality
@ChrisTomAlx

@ChrisTomAlx
Copy link
Collaborator

Hey @nvwebm
If you wouldn't mind, may I ask where you are getting this documentation from? Is this from ionic or phonegap? Unfortunately I do not directly maintain those. I only maintain the original source available here and on npm.

If you look at the readme available on github, you will see there is a quality option.
If you can give me the link to the docs you are using, I can try and contact the doc creators and ask them to update to the latest version.

Cheers and have a nice day :)
Chris
Neutrinos

@nvwebm
Copy link
Author

nvwebm commented Sep 10, 2019

@daltonpearson
Copy link

daltonpearson commented Sep 10, 2019

@nvwebm I just ran into the same issue regarding there not being a quality property on the interface and all I had to do was add a quality property to the interface in the ionic-native wrapper.

@nvwebm
Copy link
Author

nvwebm commented Sep 10, 2019

@daltonpearson I tried this already, but it doesn't seem to reslove the issue, does it scan better with that parameter for you?

@daltonpearson
Copy link

@nvwebm I haven't really had any issues scanning, just that I couldn't specify the quality.

@daltonpearson
Copy link

@nvwebm I find that a contrasting background helps a lot though

@ChrisTomAlx
Copy link
Collaborator

ChrisTomAlx commented Sep 11, 2019

@nvwebm I was just looking at your video again, it seems like the camera is capturing a lot more than it should. I see an entire black area on the original image. Also it seems like you are pulling the crop selector from outside the area of the image from 00:13 of the video. Could you maybe try changing the aspect ratio of your camera and take a pic then send a video over? This extra capture maybe why you are having problems with edge detection and memory.

Also could try with another phone and see if there is a difference?

Cheers and have a nice day :)
Chris
Neutrinos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants