1

I am working on a project that has to read and output barcode data. It uses a standard logitech camera to take a picture. It uses JavaCV (Java's OpenCV package) to access the webcam and take a picture. After the picture is stored, it then uses Zxing package to read and output the barcode data.

The program works, but not well enough. It can handle a rather large barcode but cannot read anything normal size. My theory is that the resolution on the camera is not good enough. However, I would like to ask if anyone here knows how I could improve the barcode reader through code. (i.e focusing the camera through JavaCV or something)

tl:dr version: Is there anyway I can improve image quality though JavaCV for the purpose of barcode reading?

1 Answers1

0

I had a similar problem.

Using QZXing (a port of ZXing to Qt) I got 2D (DataMatrix) decoding (with sufficiently good images), but 1D barcodes, even apparently large and clear, sometime completely missed out. What a pain...

I tried to introduce a bit of GUI, forcing the user to design the ROI... This solved 2D completely, but still 1D sometime had problems.

Then I switched to ZBar, that does well with 1D. Now ZXing just handles 2D, OTOH ZBar doesn't handle DataMatrix...

I would advice against increasing the image resolution. I tried to find some ROI detection helper in OpenCV, but so far I haven't found a simple way...

CapelliC
  • 59,646
  • 5
  • 47
  • 90
  • Why advice against increasing resolution? I have been searching all over the internet for ways to increase image quality, and you can increase the resolution through OpenCV if your camera allows it. Is there something inherently wrong with doing that? – Unholyburger Nov 12 '12 at 18:21
  • Added resolution could also increase the false positives. As I said, QZXing behaves not so well with 1D. With 2D, with small Datamatrix and fairly not focused, I drag a square around and it recognize. Absolute resolution in that case is very low. It's good respect to the ROI (because I set it dragging)...Maybe ZXing works better than QXZing, I'd like to know... – CapelliC Nov 12 '12 at 18:50