Scan qr code, but take a picture if cannot recognize qr code - android

I am using ZXing barcode scanner, but some devices are unable to quickly read QR codes. A fix I am seeing is to take a picture of the code, and read the scan the code from the image.
I tried putting SurfaceView and ZXingScannerView on top of each other, and setting the surface view visibility to invisible. But they conflict with each other.
Any idea on how to do this?
Thanks!

Related

How to know if a Android device can read QR Codes?

Currently I have a small Activity that allows me to read QR codes and returns the string that contains the code.
I do this with CameraSource and SurfaceView from the package com.google.android.gms.vision y com.view respectively.
But I wonder if there is some way through code to know if the device that runs the application has the ability to read QR codes.
Because if the device cannot read QR codes, I would like to display a TextView instead of the SurfaceView saying that the device can't do this.
Thank you, so much.
Check if the device has a camera. There's nothing special about reading QR codes; the device takes a picture, the image analysis logic does the rest.

Scan for Object with Android Camera

I need to scan a special object within my android application.
I thought about using OpenCV but it is scanning all objects inside the view of the camera. I only need the camera to regognize a rectangular piece of paper.
How can i do that?
My first thought was: How do barcode scanners work? They are able to regognize the barcode area and automatically take a picture when the barcode is inside a predefined area of the screen and when its sharp. I guess it must be possible to transfer that to my problem (tell me if im wrong).
So step by step:
Open custom camera application
Scan objects inside the view of the camera
Recognize the rectangular piece of paper
If paper is inside a predefined area and sharp -> take a picture
I would combine this with audio. If the camera recognized the paper make some noice like a peep or something and the more the object is fitting the predefined area the faster the peep sound is played. That would make taking pictures for blind people possible.
Hope someone got ideas on that.
OpenCV is an image processing framework/library. It does not "scan all objects inside the view of the camera". By itself it does nothing and yet it gives the use of a number of useful functions, many of which could be used for your specified application.
If the image is not cluttered and nothing is on the paper, I would look into using edge detection (i.e. Canny or similar) or even colour blobs (even though colour is never a good idea, if your application is always for white uncovered paper, it should work robustly).
OpenCV does add some overhead, but it would allow you to quickly use functions for a simple solution.

Android: replace camera preview with image

I'm doing black box automation testing (with appium & ruby) for app which use camera in few cases:
- taking photo
- scan QR code
- scan PDF code
I'm looking for a way to set image in to image preview to scan it.
This should(ideally) word for both emulators and real devices.
I was willing to do the same for my app (which scann QR code), and the solution I used was to add an EditText (which appears only in test mode) to put the string, which corresponds to the QR code, and then handling the string as the result of the scan.
The problem with that solution is that you can't test the camera or the functions/methods you made to decode, but it's the only problem so if you are using a library (like ZXing) it's not a big deal, because I assume you want only the string that corresponds with the QR code.

How to change the Camera Screen in QR Code Scanner in Android?

I am developing a QR Code Scanner in Android. My code for scanning QR Code works fine. However, I'd like to change the Camera Screen in my app.
Instead of my camera is in fullscreen mode, I'd like to make it like this:
Can someone knows how to do it?
You can do it by adding tab host in frame layout and then set qr code camera into frame layout, by this way you can do it successfully.
You can refer following link to solve your issue.
Custom camera screen with QR code scanner
You might want to add a layer on top of the camera. To do this, please read the following question and answers: Custom camera android

How to get current frames as image from camera?

Hello im trying to make my own special custom code scanner. My app's render a special custom barcode and I need to make a very simple scanner that will take whats currently being seen with the camera and quickly process it to decode the barcode. So how can I grab the frames from the camera and use them as images without pressing the "take" button.
check the open source project. It give bar-code without click take photo button.
Link
Thanks

Categories

Resources