I am unable to scan a QR Code having dark background(dark pink) with lighter QRcode(light pink) on it. I have integrated the zxing barcode scanner in my application to scan codes.. It works perfect for lighter background and dark QRcodes.
I tried this using the default zxing barcode scanner application. But it could not scan such kind of codes.
Following is the QRCode I am trying to scan,
Please suggest some solution.
Thankyou.
Contrast of QR Code you included should be enough for most cameras. Problem here is that the ZXing library does not support inverted QR Codes. It only supports dark codes on light background.
To add this support, you need to invert the image yourself. You can use some code similar to this one:
http://www.androidsnippets.com/how-to-invert-bitmap-color
Of course, you will need to integrate the ZXing by including the library to accomplish this, not just by Intent (I don't know how you're doing it now) so you can modify some code.
You can add the code to invert the bitmap in the method decode(byte[], int, int) of class DecodeHandler.
Related
I am trying to build an android application to construct a QR code that can be scanned by default camera's of mobile.
For example, facebook build this type of QR codes that can be scanned by default camera's of mobile. So, I started searching what are the standard formats/types of QR codes that mobile default camera's can recognise but didn't find any specific information on it. I have already tried some open source library's based on the zxing library and the qr codes generated by these library's do recognised by the default camera's, but didn't find any informations about the formats/types of QR codes they are generating.
So my question is what are the standard types/formats of QR codes that mobile default camera's recognise? Thanks in advance.
Each manufacturer has their own version of the camera app which may or may not read QR codes.
Individual apps which use the camera may implement their own QR reader.
Going over the Facebook QR code:
While I'm not sure if the Facebook one can be read by ZXing [ed: it works], Facebook can modify their version of ZXing code (or add image processing steps) to make it readable. My guess is that the error correction is high enough that the Facebook Messenger symbol in the middle is just "noise" and the corners are either close enough in design to the position markers for normal QR reader code to understand (or transformed to be so).
For example: If you have control over the reader you can modify your QR code so that it becomes difficult to read without some processing. One example would be make all of the black squares light blue such than a regular QR reader library can't read it. You would then when scanning just change blue to black and then try to process. Another would be to change to background color to not be white reducing the contrast between barcode pixel and background field. Other ideas are possible as QR codes are almost 30 years old (but may not be documented as they are intentionally obscured).
I have an Android Application where I use ZXing Library to scan barcodes and get the data written in them. In addition, I would like to save the photo of the scanned barcode image that ZXing scanned. If one looks closely, you can see that the ZXing Library "freezes/pauses" the camera input when it manages to read the barcode.
I've seen this question from 2 years ago where someone attempted to play with the ZXing library. I tried to extend CaptureActivity instead of Activity, however, I am getting the error:
Cannot inherit from final
'com.google.zxing.client.android.CaptureActivity'
and now I'm unsure on how to go about this.
Is it possible to get the Image that the Barcode Scanning Application of ZXing reads? Did ZXing eventually incorporate this feature and patch it? I can't seem to find any guides online on how to get the image that was "captured". It will make my Android Application run more seamless.
While leading for years, you might want to consider using Google's API, then you can save the camera snapshot yourself.
https://developers.google.com/vision/barcodes-overview
I need to write an android aplication to create/generate a barcode using a string with the value to show.
The android app had to show a pic with the barcode to be scaned with other phone.
I read a lot from internet and everybody recomend to use Zxing for that, but i can't find some tutorial about how to use Zxing to create barcodes on android.
I have experince using Zxing with Android-Integration to read QR Code.
I have to use the same to create barcode?
Can i use Android-Integration?
Thank you very much
Sorry for my poor english
Scanning via Intent should be all you need: https://github.com/zxing/zxing/wiki/Scanning-Via-Intent
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)