NeutrinosPlatform / cordova-plugin-document-scanner

cordova plugin for document scan
https://www.neutrinos.co/
MIT License
85 stars 60 forks source link

Edge detection seems a bit weak. #34

Open humblecoder opened 5 years ago

humblecoder commented 5 years ago

When in auto mode, the edge detection of pages seems to desperately try to find "letter" sized paper regardless of the actual page size. Also, it seems to not detect pages well in general. Perhaps I'm simply missing a configuration option. 🤔

ChrisTomAlx commented 5 years ago

Hey again @humblecoder

Yes, you are talking about the iOS version of the plugin I assume. I noticed this too, edge detection is perfect only when the contrast between the document to be scanned and the surrounding area is really high. That is an inherent defect in the library we used. It would seem we would have to either find a new open source one with better edge detection or write an entirely new library.

Cheers, Chris Neutrinos

crapthings commented 5 years ago

does android support edge detection?

ChrisTomAlx commented 5 years ago

@crapthings It does, but it isn't as great as the WeScan ios one. You need a decent amount of contrast between the document to be scanned and the background. For eg a white paper on a black background will perfectly be captured. But white on a cream background has lower accuracy of edge detection.

Cheers, Chris Neutrinos

crapthings commented 5 years ago

there's a decent android scanner

https://github.com/ctodobom/OpenNoteScanner

will this work better than the old one?

ChrisTomAlx commented 5 years ago

It is an entire app. This might be useful, it could work with some changes to the code base. Although I do not enjoy the fact that the opencv app has to be installed separately. I will have to find a way around that as well. Thanks for sharing this info. Will look into upgrading the android plugin as well, but not in the immediate future.

Also WeScan has a discussion going on about an android version of their scanner. Was hoping to get that in here because they seem to be creating some crazy good software. But no work has been done on it yet.

Cheers, Chris Neutrinos

ChrisTomAlx commented 5 years ago

Also to the original poster @humblecoder the 3.x.x version of this plugin uses a new library with great edge detection (iOS). Although I must warn you that, it is in its infancy and it uses swift 4 so please bear with me if you run into problems. Will be here to help!

Cheers, Chris Neutrinos

humblecoder commented 5 years ago

@ChrisTomAlx awesome! I'll be checking it out!

MentalGear commented 5 years ago

Does this mean this library uses WeScan for iOS now ? PS: Thanks for your amazing work this far !

ChrisTomAlx commented 5 years ago

Hey @MentalGear

Does this mean this library uses WeScan for iOS now ?

Yup. Plugin version 3.x.x uses the latest WeScan cocoapod along with swift version 4.0 as of today.

PS: Thanks for your amazing work this far !

It is an honor to be part of the open source community. Hope you have fun with the plugin!

Cheers, Chris Neutrinos

MentalGear commented 5 years ago

Hey Christy,

Thanks fir the quick reply! Great to have wescan functionality.

As a head’s up: Just checked the readme file. Could it be that it is a bit outdated, as it still describes the irl as ios library.

On 11 Apr 2019, at 07:45, Christy Thomas Alex notifications@github.com wrote:

Hey @MentalGear

Does this mean this library uses WeScan for iOS now ?

Yup. Plugin version 3.x.x uses the latest WeScan cocoapod along with swift version 4.0 as of today.

PS: Thanks for your amazing work this far !

It is an honor to be part of the open source community. Hope you have fun with the plugin!

Cheers, Chris Neutrinos

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ChrisTomAlx commented 5 years ago

Currently the document has been updated only on the github branch ver/3.x.x. Although the 3.x.x version of the plugin is stable, since cordova doesn't work as well as it should with swift, I was waiting to test this on cordova 9.0.0 before pushing this as the stable release of the plugin.

You can refer the ver/3.x.x documentation on github for now. Will be updating the docs soon. Thanks for bringing this up though :)

Edit : You can download from npm using cordova plugin add cordova-plugin-document-scanner@3.x.x

Cheers, Chris Neutrinos