I am developing an android app to scan documents with my phone. I am using openCV and Canny edge detection and it works ok but if I try to scan an document on a background without enough contrast between the document and the background it fails. I have tried other apps in the Play Store and they are still able to scan the document with less contrast. So I was looking for ways to improve my edge detection and found this:
https://www.pyimagesearch.com/2019/03/04/holistically-nested-edge-detection-with-opencv-and-deep-learning/
But I can't figure out how to use HED in my Android Studio Java project. More precisely I can't find out how to create the custom layer cropping class for the neural network in Java. I was able to get the rest of the tutorial to work but I dont know how to create the custom layer cropping class.
At the moment im am registering an empty or wrong class as cropping layer and I'm getting blank images.
If any of you guys know something or can point me in the right direction I'd be very thankfull.
(edit) I did some research and apparently you have to create a class in c++ and use it in java but i can't find instructions on how to achieve this.
I have integrated the Zbar barcode scanner into my Android application. I'm very impressed with this compared to others I have tried. It's quick and very accurate. The only thing I do not like about it is that by default there is no indication that the barcode gets scanned. I would like to display either a rectangle or even just a line across the barcode after it has been scanned just so it's easier to see what exactly the app scanned. Even if I have to manually draw a rectangle based on the location of the found barcode that would be fine but can't seem to figure it out. Does anyone know how this can be done? Thanks in advance!
Was anybody able to read the PDF417 barcode with use of the ZXing library on the Android OS? They are supporting this - and according to their page it is in 'alpha' stage.
We are not looking for perfect solution - since the PDF417 is pretty complex and needs a very good camera with auto-focus, we can accept that it will be working only on few pre-selected high end devices.
We have tried also the Barcode Scanner + available on the Android Market - it has the PDF417 option in the settings, but whatever we read it always fails.
We were looking also for commercial SDK, also here on stackoverflow, but with no luck.
Any help is appreciated.
Kind Regards,
STeN
It really depends on what you expect. Simple PDF417 reads pretty instantly, like... this or this.
This will never be scanned.
Borderline is stuff that is small or moderately complex: example 1 and example 2.
I can read the first but not the second, even though the first is denser -- size helps.
Make sure to enable PDF 417 decoding; it's off by default
Quiet zone (white space around the code) is required
Focus and light help a lot
You can try PDF417.mobi SDK. It should work on low-end phones if equipped with auto-focus camera. It's a commercial library, but free for developers and non-commercial purposes.
You can try the demo here or play with code directly from GitHub.
Official web site is here http://pdf417.mobi/
Disclaimer: I'm part of the team working on PDF417.mobi
Have used , It can scan PDF417 format. Make sure you give a try with a Gadget containing Auto Focus camera. Have tried It on Samsung Galaxy Tab it works like a charm.
Zxing's solution did not work for me. I used DataSymbol Decoder (turn on 2d codes, by default they are off) on my samsung charge. In less than a second I captured my drivers license...
I got similar results as described by #sean-owen in that only the simple PDF417 were being read. It feels like the ZXing library doesn't have the same error correction for PDF417 that it does for QR Codes. However, with user assistance we were able to eliminate noise and create an artificial quiet zone by:
require the user to hold the phone in landscape mode (this maximizes the pixels captured from the camera, even in 640x480 mode)
require the user to fit the barcode inside a 50:18 clipping rectangle (this ratio seems to best fit the US Driver's License and such a clipping rectangle will empower the user to clip away most of the noise)
allow the user control focus, tilt distortions
By following the above, even some of the notoriously difficult PDF417 images can be scanned.
Google's ML KIT Barcode Scanning which is part of google's Mobile Vision library lists support for PDF-417 Barcodes.
It automatically parses QR Codes, Data Matrix, PDF-417, and Aztec values, for the following supported formats:
URL
Contact information (VCARD, etc.)
Calendar event
Email
Phone
SMS
ISBN
WiFi
Geo-location (latitude and longitude)
AAMVA driver license/ID
Review the Getting Started Page or clone GIT project to get started.
I have almost finished writing a color detector app for Android.
However I am having a problem with very close shots. Both my NexusOne and Desire are unable to properly auto-focus at such lengths. I have tried pretty much all the parameters to no avail. Is it possible to let the user focus the lens?
I tried implementing the zoom trick ( move phone back and zoom and then auto focus ) and while it works on the native camera app I am unable to get it working with my app.
All advice appreciated. :)
Basically u cannot focus item which are close by(Macro mode) using Nexus One or Desire or for that matter most phones. I am yet to find any phone which does though, but I am not discounting that there may be some phones :-)
I am working on a Face Recognition system for my internship. I am developing the project in Java right now. I am using OpenCV library, but it does not seem to work correctly in detecting faces.
I am at a point, where I capture image from the desktop and store it on the hard drive.
All I want now is to detect a face in that image (NOT IDENTIFY). I just need to detect that face and crop it.
Please help me with it. If anyone has specific code in Java to detect faces in a images, please send me that too.72236
This library already has face detection built in. You'd probably be better off using it.