We have integrated me.dm7.barcodescanner:zxing into our app and use the ZXingScannerView to scan QR-codes on some physical devices. Our issue is that the performance is extremely different on different phones. Some of them register the QR-code immediately while some might get it after a while and some never registers them.
I'm guessing the different specifics of the actual camera is the underlying cause.
Many phones which won't scan the QR-code will however scan the code fine if you use the native camera App. My guess is that we don't get auto-focus and such when we import the camera into the ZXingScannerView which makes the QR-code more blurry and hard to detect.
Has anyone else had this issue and what did you do to resolve it?
Related
I want to scan small QR-code(1cm x 1cm) I am trying to scan by Using this same code. It's detecting the large size qr-code perfectly but not detecting the small size qr-code. Is there have any way by which I can solve this issue?
The smartphone camera has to read each and every data module to be able to decode a QR Code And you know that quality of the camera varies widely across different smartphones. Some of them are very good and can scan even very small QR Codes. But others simply can’t so try with some other device to check you have issue in code or with device
I've been experimenting with barcodedetector and associated Vision APIs for a week or so and - unfortunately - the conclusion is that they are unreliable. I've tested them with ~10 devices: Samsung and Nexus tablets/phones with Android 4.4 to 6.01.
The common problem was that I could not decode certain QR codes - other apps based on zxing library as well as iPhone had no problems decoding them. The problematic QR codes had one of the following 'flaws': somewhat distorted timing (due to scaling), no quiet zone, or their bitmap data had a bottom/left origin (i.e. image was mirrored).
Also troubling is that the associated APIs (e.g. CameraSource) appear to be buggy. Fortunately, the barcode reader sample comes with open source version so it can be fixed if necessary. The most obvious bug is the way camera resolutions are matched to view sizes without taking into account current orientation. You can clearly see the side effects in the sample - camera preview never fills the containing activity area, especially in the landscape orientation.
Has anyone run into similar problems? Are there any workarounds for the show stoppers - i.e. decoding qr codes?
Thanks.
What I'm trying to achieve: access both front and back cameras at the same time.
What I've researched: I know android camera API doesn't give support for using multiple instances of the Camera and you have to release a camera before using the other one. I've read tens of questions about this, I know on some devices it's possible (like Samsung S4, or other new devices from them).
I've also found out that it's possible to have access to both of them in Android KitKat on SOME devices.
I also know that on api >= 21, using the camera2 API, it's possible to access both of them at the same time because it's thread safe.
What I've got so far: implementation for accessing the cameras one at the time in order to provide a picture-in-picture.
I know it's not possible to implement dual simultaneously camera on every device, I just want a way to make it available to some devices.
How can I test to see if the device is capable of accessing both of them?
I've also searched for a library that can allow me such thing, but I didn't find anything. Is there such a library?
I would like to make this feature available for as many devices as possible, and for the others, I'll leave the current state (one by one) of the feature.
Can anyone please help me, at least with some pieces of advice?
Thanks
!
The Android camera APIs generally allow multiple cameras to be used at the same time, but most devices do not have enough hardware resources to support that in practice - for example, there's often only one camera image processor shared by both cameras.
There's no query that's included in the Android APIs that'll tell you up front if you can use multiple cameras at the same time.
The only way to tell is to try to open a second camera when you already have one open. If you can open the second camera, then you can do picture-in-picture, etc. If you get an exception trying to open the second camera, then that particular device doesn't support having both cameras open.
It is possible using the Android Camera2 API, but as indicated above most devices don't have hardware support. If you have a Nexus 5X, Nexus 6, or Nexus 6P it will work and you can test with this BothCameras app. I've implemented blitting to allow video recording as well (in addition to still pictures) using the hardware h264 encoder.
You can not access both the cameras in all android mobile phones due to hardware limitations. The best alternative can be using both the camera one by one. For that you can use single camera object and can change camera face to take another photo.
I have done this in one of my application.
https://play.google.com/store/apps/details?id=com.ushaapps.bothie
I've decided to mention that in some cases just opening two cameras with Camera2 API is not enough to know about support.
There are some devices which are not throwing error during opening. The second camera is opened correctly but the first one will call onCaptureFailed callback.
So the most accurate way is starting both cameras and wait frames from each of them and check there are no capture failure errors.
I write an application for Motorola Xoom tablet with Android 3.1 for my master thesis that can scan multiple QR Codes in real time with it's camera and that displays additional information in the display over recognised QR Codes.
The recognition is done with the ZXing android app (http://code.google.com/p/zxing/), I basically just changed the code of the ZXing app so that it can recognise multiple QR Codes at the same time and can do this scan continually, without freezing after a successful scan like the original app does. So my app is basically the ZXing app with continous scanning of multiple QR Codes.
But I'm facing a problem:
The recognition rate of QR Codes with the built in camera is not
very good. The ZXing app uses the pictures that it gets from the
camera preview. But these pictures do not have a very good quality.
Is there any possibility to make the camera preview making better
quality pictures?
P.S. I also tried to make real snapshots with camera.takePicture()
to get a better quality, but it takes too long to take the picture
so the real time experience for the user is lost.
Any help is highly appreciated!
Thanks.
Well, the question would be... why is the image quality that bad? Do the image have low resolution? Is the preview out of focus? I've worked with the ZXing Android app before and I know that it has a mechanism to keep the camera auto focusing the live scene.
If the auto focus mechanism is undergoing, then you are possibly decoding some images that might be out of focus. Rationaly, it would make sense to decode only when the camera is in focus, but that would delay the decoding process, since it would have to wait for the focusing to do the image processing phase. However, I wouldn't be too much worried about this for several reasons: 1) the auto focus is very quick, so there will be very few blurry images (if there are any at all), 2) the camera keeps focus for a sufficient amount of time that would allow for a couple decodings, 3) QRCodes typically do not require perfect images to be detected and decoded - they were designed that way.
If this is a problem for you, then disable the continous auto-focus and set the parameter to anything that suits you.
If the problem comes from low resolution frames, well increase it..., but QRCodes were also designed to be identified even in small resolutions. Also, keep in mind the increasing the resolution will also increase decoding time...
The use of front light option with zxing1.6 barcode scanner does not work on my Nexus One. I need to be able to use the flashlight in my app, but you can't have two instances of the camera running. Is there a way to use the flashlight without accessing the camera? Or can I somehow access a camera that is already in use?
I am using the Google IntentIntegrator.java patch to be able to scan barcodes.
The short answer is "no"; the front LED is controlled as a flash mode, which is a property of the camera. It is mode "torch". And no two apps can't open the camera at the same time.
(A longer answer is that there used to be a hidden API for this, which is what Barcode Scanner tries to access, but it doesn't work on almost any device anymore. You can dig into the source code to see FlashlightManager.)
Since Android 2.x there is this proper API for turning on the light, and the beta of the next version of Barcode Scanner does use it. You can try it here.