Problem in QR Code Recognition in Portrait Mode

51 views
Skip to first unread message

Mustafa Aldemir

unread,
May 29, 2015, 5:26:46 AM5/29/15
to zx...@googlegroups.com
Hi,

I followed the steps in this answer (http://stackoverflow.com/a/16252917/493080) for using zxing in portrait.

Step 1: Add following lines to rotate data before buildLuminanceSource(..) in decode(byte[] data, int width, int height)
Step 2: Modify getFramingRectInPreview().
Step 3: Disable the check for Landscape Mode in initFromCameraParameters(...)
Step 4: Add following line to rotate camera insetDesiredCameraParameters(...)
Step 5: Do not forget to set orientation of activity to portrait. I.e: manifest

It works well on some small devices. But on some devices (like Samsung Galaxy Note 3, Samsung Galaxy S4, Sony Xperia Z) the non-shaded area is more like a square (instead of rectangle).

And on these devices it can not recognize the QR codes if the QR code covers most of the non-shaded area. If you move the camera farther away (till the QR code covers only the half of the non-shaded area) it recognizes the code.

Also, the yellow result points displayed during decoding are wrong placed on all devices.

Can you give me any recommendations?

best wishes...
Reply all
Reply to author
Forward
0 new messages