I want to build auto-zoom feature for QR scanner app. I'm using android google vision library.
When user align camera to QR code, if distance from camera to QR code is so far, library cannot decode it, I want camera auto zoom-in into QR code to it can decode. I think camera need to know objects similar with QR. Are there any way to do it?
Following this sample
https://github.com/googlesamples/android-vision
I tried to work with Google Vision, but it just hasn't worked out for me. My use case was simply to read a QR code.
I ended up using Zxing library, and it was really painless if I may add.
I should only mention that, afaik, if you want to read QR code that is perhaps too small, zooming might not help.
[ How can I add zoom in/out gesture in Android vision CameraSource ]
This question might have what you are looking for. They recommend making a call to startSmoothZoom(int) that zooms the physical camera for (int) seconds. You will probably have to modify the CameraSource.cs script in android-vision.
Note: This was depcrecated in API level 21. If this affects you, use the Camera2 api. This is discussed here:
[ android camera2 handle zoom ]. Camera2 is recommended for new applications.
Related
I am developing an app to do some image processing operations on a captured image. I used camera2basic sample as a base to my project but it sometimes takes long time to capture and sometimes crashes which annoying me.
Is there a simple authentic code simpler than camera2basic to use camera2 API with opencv or can I use intent to use the Android camera.
There are a number of projects which aim to put a robust and simpler wrapper aoerund the Android Camera2 API, and they generally support the earlier camera API also.
The two most poplar at the moment seem to be:
https://github.com/Fotoapparat/Fotoapparat
https://github.com/wonderkiln/CameraKit-Android
They are not perfect - take a look at the issues lists and decide yourself.
I have used Fotoapparat and while I did see at least one issue, I found it simpler and more robust than the basic Camera2Basic example code.
If you just want an image to work with, you can use the standard Android image capture intent to get the default camera app to take a picture for you.
See "Taking Photos Simply" in the Android developer docs.
I don't know how to get the video frame , so I can't save the image.
Give me some tips. Thanks a lot.
As canvas and rest of the facilities are unavailable in Android we can dodge this situation by taking screenshots and introducing animation in our app's UI. screenshot image can be stored at configured location and resused it later for exchanging it to other party
Edit: One can take reference from AppRTC to capture surfaceview()
https://codereview.webrtc.org/1257043004/
GLSurfaceView () should not work as webrtc library has the hold of camera and screen. One has to build extended class to get Videorenderer and get the snap of frame , Once done one can display the frame using customized api displayFrame() mentioned by cferran in opentok android examples.
You can also use OpenTok library but that is chargeable when compared to webRTC.
If you are interested in using a third party library here is an example on how to implement this use case: https://github.com/opentok/opentok-android-sdk-samples/tree/master/Live-Photo-Capture
If you prefer to use directly WebRTC, here you can find generic information about how to build WebRTC on Android: https://webrtc.org/native-code/android/
I want to Create an application which can read the Ba Codes. I want to do this through my on application not using third party applications like 'ZXing'. Please any coding help or tatorial...
I have already done an Android application by scanning directly a barcode with my app. I have used Zxing barcode sources to take functionnalities that I want and it's easy to make your own application which scans barcode.
More particularly, what you have to do is to design a screen which can take photos, then you just need to use the Camera object and when you have an image captured, put it in Bitmap format in parameter of one ZXing method. Then you will have the result and you can display it like you want.
If you have more specific questions about this, don't hesitate to ask. I can retrieve my code to help you.
If you go here: http://code.google.com/p/zxing/wiki/ScanningViaIntent
and follow the explanation, in order to add the class and code described in the site.
Once you've implemented it the scanner added ..
I suggest that you check out the free Scandit barcode scanner SDK for Android. It comes with a step-by-step guide, example code and instructional video how to get started and it also works with low-end Android devices that have no autofocus camera and/or limited resolution.
If you are interested in converting the UPC numbers scanned to product names, there is also a product API.
[Disclaimer: I am a developer at Scandit]
I need to create an android application which pretty much works like a qr code decoder.
I want to use the android phone camera and read only the qr code from the camera preview, and send it to a decoder library probably zxing which gives me the result. I don't want to use the zxing intent which uses another application barcode scanner.
I am able to take a picture using phone camera, but I don't know how to read only the qr code part from the preview. I need help in this regard and also how to send the data to decoding library.
That's a pretty tall order to ask for here on SO. My advice would be to study the xzing source at http://code.google.com/p/zxing/ and/or see if you can legitimately incorporate it via the Apache 2.0 license into your project.
ok, this turns to be pretty much simple and requires some effort too.
Download the ZXing source code.
There is a CaputureActivity class , which basically initiates the scan and also displays the result.
You have to work on this class to integrate ZXing scanner in to your application, which pretty much looks like it is part of your app.
There is lot more support in the ZXing reader than just scanning QR-codes and more features, which you might want to eliminate , if you would like to have only QR-code scanner.
HTH.
Hi I am developing an application for the android htc hero. I am looking into ways of using the inbuilt camer to read 2D barcodes and extract the string returned from the barcode. I have only recently begun working with the android sdk but I do have a programming background from working on projects with java. I am curious to know what the best way to read the 2D barcode would be. I have some sample applications that read the barcode but they are all .apk files and have no source or library that i can work with. to give you a better idea of what i am trying to accomplish this site allows the generation of 2d barcodes made up of the data you desire here
Any replies would be greatly appreciated.
Android programs can interact with eachother using intents. Intents are a little like remote procedure calls: you ask the other program for a certain action (e.g. scan a barcode) and the other program will perform this task for you. The result is returned when the task is complete.
If the user has installed the ZXing Barcode Scanner, you can just use an intent to scan a barcode. The Barcode Scanner will then start, let the user scan the code and return the result to you.
More information about this scanner can be found on the Google Code page of this project: http://code.google.com/p/zxing/wiki/ScanningViaIntent
I'd look at this open source Android project: http://code.google.com/p/zxing/
For fellow Google search travelers, there is a 2012 post on the android developers blog on how to use intents with the example of barcode scanning :
http://android-developers.blogspot.com/2012/02/share-with-intents.html
As far as I know for decoding barcodes (apart from the algorithm) you need to know the (relative) widths of white and black bars. For that, you would have to rotate the barcode to a horizontal position and then detect the widths.
(Ok, the ZXIng stuff advised by others outperforms this manual hacking)