googlesamples / android-vision

Deprecated: The Mobile Vision API is now a part of ML Kit: Check out this repo:
https://github.com/firebase/quickstart-android/tree/master/mlkit
Apache License 2.0
2.92k stars 1.73k forks source link

Code-128 with less than 6 characters not detected #12

Open ghost opened 9 years ago

ghost commented 9 years ago

I'm not quite sure if this is a bug or a matter of proper configuration, but I've been running the sample code from this github and tried it on some barcodes I generated.

In general it works very well, but when using Code-128, there seems to be a minimum number of "letters" the barcode needs to contain before the barcode reader detects it.

I've attached a screenshot visualizing the issue:

screenshot_2015-08-21-13-20-37 screenshot_2015-08-21-13-33-18

pm0733464 commented 9 years ago

Thanks for reporting this issue. We will take a look.

juliangsf commented 9 years ago

Thanks WACMemphis. Do you need Code-128 to detect less than 6 chars? What's the application?

ghost commented 9 years ago

@juliangsf Yes, I would need to be able to detect any valid barcode. AFAIK, there is no minimum length requirement for Code-128. The reason for this is that our users should be able to use all the barcodes they define. We specify which kind of barcodes they can use (Code-128, QR, EAN-8/13, etc.) and they can use any valid barcode of these types. Consequently, we'd need to be able to scan/detect them.

pchx-zz commented 9 years ago

Detecting shorter barcodes requires making some tradeoffs that would increase the false positive rate. We may be able to mitigate this with some careful tuning, but we still have to make sure not to degrade quality for other users and that takes time.

ghost commented 9 years ago

Ok, so I'll stick to ZXing in the meantime.

apvasanth03 commented 9 years ago
  1. Can we have any temporary fix or work around for this issue.
apvasanth03 commented 9 years ago
  1. We have started using "Google Vision API" for barcoding scanning.
  2. Can you kindly let us know when can we expect the fix or can you provide us with any temporary fix.
  3. Kindly let us know if it takes time so we can look for other library.
pchx-zz commented 9 years ago

Unfortunately, there's no workaround for the 6 character limit.

We expect a future release will lower or remove the limit, but have no target date to announce right now.

apvasanth03 commented 9 years ago

I have a doubt that in future if this issue is fixed, do I need to update Google play sdk in my application or it will be automatically updated in user device.

pchx-zz commented 8 years ago

Nothing in the SDK code compiled into your application is involved in the six-character limit, and the fixed code would be rolled out automatically.

apvasanth03 commented 8 years ago

Thanks pchx.

michaelcarrano commented 8 years ago

@pchx is there an update on this issue?

I was looking into integrating the Vision API today for an app but noticed that it wasn't detecting barcodes with 5 digits and a Google search lead me to this issue. I am going to have to hold off until this issue is resolved before I can use the Vision API.

starback commented 8 years ago

@michaelcarrano same here. I wanted to use the Vision API as well, but without <6 digit barcode support I won't be able to.

pchx-zz commented 8 years ago

No target date to announce yet, but we're working on it.

The new minimum length will be 2 characters; single digit codes will not be recognized (I'd be curious to hear if anyone needs this).

sebastian-raubach commented 8 years ago

Ideally, I'd even need single digit barcodes for my projects (numbers 1 to 9).

But 2 is an enormous improvement already. Great work!

pchx-zz commented 7 years ago

The latest version of our Barcode API (part of Google Play Services 10.0) reduces the minimum length for most 1D barcodes to two characters.

Thanks for your patience!

sebastian-raubach commented 7 years ago

@pchx Congratulations, that's a great improvement!

However, I don't understand why this issue has been closed as the OP is asking for any barcode which would mean a minimum length of 1 character. I myself will still not be able to use this great library because of this, as I need it to be able to detect even single character barcodes.

pchx-zz commented 7 years ago

Right, good point.

Would it work for your use case if you padded numbers to two digits (i.e. 01-09)?

sebastian-raubach commented 7 years ago

@pchx Unfortunately, no. The application I'm developing allows the user to use any valid barcode, i.e. anything they like as long as it's valid and one digit barcodes are valid.

davisray2909 commented 7 years ago

@pchx "No target date to announce yet, but we're working on it.

The new minimum length will be 2 characters; single digit codes will not be recognized (I'd be curious to hear if anyone needs this)."

I'm afraid, I will be the first one that need to read single digit to be recognized. My case is, to read image from tax paper, and make an automation based on tax paper image input. And on my country, the label is Left Justified, and the number is Right Justified (on the same row). The problem is occurred, when some tax is 0 in value. I can make an assumption, when the ocr result is null on that image rectangle section, I set the tax value as 0. But too bad, value 1 until 9 is also return null. Makes me cannot make an assumption based on char is failed to detect.

Can you suggest me something to get this problem done? Some work around? Or some tweak on the library?

Many thanks before.

screenshot_20170929-140257 1