Issue 1710 in zxing: Recognition of QR codes much more difficult / worse in new versions

226 views
Skip to first unread message

zx...@googlecode.com

unread,
Jun 14, 2013, 5:34:20 AM6/14/13
to zx...@googlegroups.com
Status: New
Owner: ----

New issue 1710 by sky.ri...@gmail.com: Recognition of QR codes much more
difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

What version of the product are you using? On what operating system?
Barcode Scanner 4.3.2, Android 2.3.3, Samsung Galaxy S2

I don't know when it changed, but the box in which one has to fit the QR
code is so small that recognition of medium- to large-sized codes (e.g. >
25) is no longer possible or depends on whether one has a lucky day or not.
It also doesn't seem to work faster, even though the area scanned is much
smaller.

Please fix this. I can recommend to have a look at Obsqr
https://bitbucket.org/trikita/obsqr which can use the full camera
resolution and recognizes these codes (even v39!, barcode scanner wouldn't
recognize any above v33 even in older versions) without any trial & error.
Unfortunately, it doesn't have all of barcode scanner's functionality, like
importing ical events, which I would need it for.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

zx...@googlecode.com

unread,
Jun 14, 2013, 8:51:45 AM6/14/13
to zx...@googlegroups.com

Comment #1 on issue 1710 by srowen: Recognition of QR codes much more
difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Yes, can you send an image? People keep mentioning this but nobody has
exhibited an image of the UI with 'too small' reticle. I think it may be a
device problem, or some weird combo of screen size and resolution.

The max size was actually increased, but target size reduced a little to
match the intended size (because this makes you put it outside minimum
focus range). It should still be quite usable, and works on all devices I
have.

zx...@googlecode.com

unread,
Jun 14, 2013, 1:32:21 PM6/14/13
to zx...@googlegroups.com

Comment #2 on issue 1710 by sky.ri...@gmail.com: Recognition of QR codes
much more difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

That's a Samsung Galaxy S2, image is attached.

IMHO it would be best if the whole screen was used as target area. I didn't
find anything wrong with the approach obsqr took; focusing works good and
it's fast too, but that may depend on the device of course.

Attachments:
barcode-scanner.jpg 244 KB

zx...@googlecode.com

unread,
Jun 14, 2013, 5:16:25 PM6/14/13
to zx...@googlegroups.com

Comment #3 on issue 1710 by srowen: Recognition of QR codes much more
difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Yeah, that's normal and as intended. If you fill the screen with the QR
code it is generally too close to focus. Maybe not on the S2 but on other
devices. I can't imagine why it's harder to scan. Are you putting the code
inside the rectangle completely?

zx...@googlecode.com

unread,
Jun 15, 2013, 1:19:37 AM6/15/13
to zx...@googlegroups.com

Comment #4 on issue 1710 by sky.ri...@gmail.com: Recognition of QR codes
much more difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Then how about adding an option to use full screen for scanning? I can't
believe the S2 is the only device where this makes a difference - as you
said people keep mentioning this.

It's harder to scan because you have to fit the QR code into a tiny window
of an already tiny smartphone screen and because the resolution is smaller
than when using the full resolution of the camera. Less resolution, less
information to grasp, less quality. Also, it's not as easy as simply
pointing the phone at the code.

Attached you'll find a sample v40 QR code, the maximum QR code size
possible to date. I guess most older phones will have a hard time
recognizing this. Barcode scanner on S2 certainly can't handle it, while
obsqr still does. You just can't fit it in that tiny box with enough
resolution to scan it. From a usability point of view, it's easier to tell
the difference of comfortability if you try it yourself.


Attachments:
qrcode.png 12.1 KB

zx...@googlecode.com

unread,
Jun 15, 2013, 6:37:09 AM6/15/13
to zx...@googlegroups.com

Comment #5 on issue 1710 by srowen: Recognition of QR codes much more
difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Does it focus when the QR code is so close to fill the screen? This is the
key question. I have a handful of questions on this and the only person who
mentioned the device said it was also an S2. Who knows. (See 1st review
here
https://play.google.com/store/apps/details?id=com.google.zxing.client.android
)

Resolution generally isn't an issue though it may look like it. When
screens are getting to be 1280x960 or more, 25% of it is 640x480. That's 2x
the pixels on the whole screen of the first Android device, for example.

This kind of QR code is probably never going to scan well, and I don't want
to optimize for anything past, maybe, version 15.

I don't think filling the screen is helpful in general. Try a product code
and I think you'll see it's way too close to focus. I don't want to make an
option for it if it's really just a funky behavior for v30+ codes on the
S2. (You can make a custom build, or use another app).

I might expand the reticle back to 5/8 of screen dimensions, but I'm still
trying to figure out if this is something just affecting a few people with
an S2 or what. The change improves scanning for other devices.

zx...@googlecode.com

unread,
Jun 15, 2013, 8:07:30 AM6/15/13
to zx...@googlegroups.com

Comment #6 on issue 1710 by sky.ri...@gmail.com: Recognition of QR codes
much more difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

> Does it focus when the QR code is so close to fill the screen?
> This is the key question.

Yes, no problems with that. I paid attention to how close I hold it to the
screen. With barcode scanner it's like 3x far more away than with obsqr.
Both focus sharply at that distance.
Not sure which you mean, google seems to show them in random order or so.
The other often mentioned app "barcoo" is no improvement for the S2 either.

> This kind of QR code is probably never going to scan well, and
> I don't want to optimize for anything past, maybe, version 15.

Try obsqr and find out it can be done. I did not believe so before and
thought it was a hardware limitation, but now I stand corrected.

> I don't think filling the screen is helpful in general. Try a
> product code and I think you'll see it's way too close to
> focus.

Maybe we're talking about different things then. My intention is not to
criticize the small target area, though it is limiting in my case, but I
thought you're limiting the scan area too, not only the screen size. Though
limiting the screen size doesn't seem to help much with focusing BTW,
because now I have to constrain the image within a micro target size from
farther away which is much more difficult IMO (holding the phone steady,
and aligning properly so that the code fits but still uses the maximum scan
area).

> I don't want to make an option for it if it's really just a funky
> behavior for v30+ codes on the S2. (You can make a custom build,
> or use another app).

While until now I was very satisfied with the way barcode scanner worked
(but also in lack of any better alternatives), perhaps my time's probably
better invested porting the intent code to obsqr, which currently works
better on my S2. The small target size seems to make it ideal for barcodes
only, not for QR codes.

zx...@googlecode.com

unread,
Jun 15, 2013, 9:11:31 AM6/15/13
to zx...@googlegroups.com
Updates:
Status: Fixed
Owner: srowen

Comment #7 on issue 1710 by srowen: Recognition of QR codes much more
difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

I will put it back a bit to 5/8 as a middle-of-the-road setting. If it's
not focusing one can pull back a little but it gives more resolution to a
device that can scan at close range.

Screen size can't be changed but the reticle can. Only the region in the
reticle is scanned. The ideal is to be just farther than the minimum focal
distance. You'll find other devices don't focus as close as it sounds like
the S2 does.

You should switch to another app if it works better for your use case. I
also posted a new debug build of the current version with slightly bigger
reticle. With some trouble I can scan this.

https://code.google.com/p/zxing/downloads/detail?name=BarcodeScanner-debug.apk

zx...@googlecode.com

unread,
Jun 15, 2013, 4:15:49 PM6/15/13
to zx...@googlegroups.com

Comment #8 on issue 1710 by sky.ri...@gmail.com: Recognition of QR codes
much more difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Thanks, that's an acceptable compromise. Additionally, I now know where I
can change it if I want to. I guess these things are not easy to set up
right with all devices. The debug build works similar to the old version.
The S2 still won't be able to scan those big codes, but for the majority it
works. BTW: I'm using it for the Lightning QR-Code Add-on for Thunderbird,
which allows me to transfer the events from my desktop calendar to my
smartphone. I prefer this to any solution where I have to set up an extra
server etc. It works fine when you don't have too many events. Barcode
scanner is recommended on that add-on homepage.

zx...@googlecode.com

unread,
Jun 17, 2013, 5:59:34 AM6/17/13
to zx...@googlegroups.com

Comment #9 on issue 1710 by sky.ri...@gmail.com: Recognition of QR codes
much more difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Thanks for the debug build. I've modified the SVN version to use the full
screen as target area. Unfortunately, this doesn't improve scanning those
big QR codes. I believe this is because obsqr distorts/stretches the image
a bit (or doesn't and that helps), at least it looks that way. In barcode
scanner, screen proportions look right, in obsqr the image looks stretched
horizontally. Apart form that it works fine.

BTW: In both SVN and 2.2 source package I had to modify core/pom.xml to
refer to 2.2-SNAPSHOT instead of 2.3-SNAPSHOT, or it wouldn't build. Just
to note that some people might run into problems building the 2.2 version
too...

zx...@googlecode.com

unread,
Jun 17, 2013, 7:07:52 AM6/17/13
to zx...@googlegroups.com

Comment #10 on issue 1710 by srowen: Recognition of QR codes much more
difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Any stretching you see is an artifact of the preview size vs screen size.
It's just cosmetic, and the app gets the 'raw' image. However there might
be something here. What you see suggests that the two apps are choosing
different preview sizes.

There is a max preview size it will choose. Within allowed sizes it picks
one that best matches screen aspect ratio (so it 'looks' right). There may
be a larger preview resolution, that works better for you, that doesn't
match the aspect ratio so it's not being chosen. I would try removing the
max size, and maybe even removing the logic to match aspect ratio. Just
choose the biggest one, see how that flies.

The 2.2 release ought to refer to 2.2 artifacts only. SVN ought to refer to
2.3-SNAPSHOT only. What referred to 2.2-SNAPSHOT? There are no more
2.2-SNAPSHOTs so I'm not sure what to make of this.

zx...@googlecode.com

unread,
Jun 17, 2013, 7:35:24 AM6/17/13
to zx...@googlegroups.com

Comment #11 on issue 1710 by sky.ri...@gmail.com: Recognition of QR codes
much more difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

Ok, I'll look into it, but this will need more time than a simple change.
Thanks for the suggestion.

In the 2.2 download
(http://code.google.com/p/zxing/downloads/detail?name=ZXing-2.2.zip&can=2&q=),
zxing-2.2/core/pom.xml has an entry <version>2.3-SNAPSHOT</version>. In SVN
download, that entry is the same. Both versions did not build using the
build instructions from "Getting started". After I changed the entry in
zxing-2.2 pom.xml to "2.2-SNAPSHOT", build worked fine. After I changed the
entry in zxing-SVN pom.xml to "2.2-SNAPSHOT", build worked fine. SVN
pom.xml version does not build with "2.3-SNAPSHOT" => "missing artifact
during something:copy, download from server manually". Something's wrong
here.

zx...@googlecode.com

unread,
Jun 17, 2013, 7:42:00 AM6/17/13
to zx...@googlegroups.com

Comment #12 on issue 1710 by srowen: Recognition of QR codes much more
difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

The change is pretty easy. In findBestPreviewSizeValue, after the supported
sizes are retrieved and sorted, just use the first one. Delete the rest of
the method.

Darn, that's a mistake in the release then. Yes it should point to 2.2, not
any SNAPSHOT build. It will be fixed next time.

In SVN it is supposed to point to a SNAPSHOT. I would use SVN if you can as
it will be later code.

Don't use 2.2-SNAPSHOT anywhere.

zx...@googlecode.com

unread,
Jun 28, 2013, 7:00:37 AM6/28/13
to zx...@googlegroups.com

Comment #13 on issue 1710 by sky.ri...@gmail.com: Recognition of QR codes
much more difficult / worse in new versions
http://code.google.com/p/zxing/issues/detail?id=1710

I gave it a try, even set previewSize manually (to 800x480), but
recognition did not get any better. I'm not sure anymore about the image
being distorted though; both previews look the same now. I've looked into
obsqr logs, and it seems it uses 800x480 as preview size too, so maybe
recognition simply works better with obsqr and my phone, for whatever
reason. I've also tried to increase resolution to the camera maximum
(3264x2448) with parameters.setPictureSize, but that leads to a crash.

SVN compiles fine now without any modifications needed. So that SNAPSHOT
error is fixed.

Thanks for the help, apart from big QR code issues barcode scanner works
fine.
Reply all
Reply to author
Forward
0 new messages