The best camera for barcode reading - Page 1
Forum section: electronics / projects

author: Kemme
author_rank: Contributor
timestamp: May 05, 2019, 09:15:09 pm
content: Hello allI am trying to build a barcode reader with just raspberry pi + webcam set.What are the most important camera specifications for barcode reading? Is it resolution? I have Creative Live! Cam Sync HD and it's mediocre. Sometimes it requires a lot of aligning untill it is finally able to scan the barcode. Seems like I'll have to buy another one but I don't know what to look for.

author: TopLoser
author_rank: Unknown
timestamp: May 05, 2019, 10:04:18 pm
content: Post an image that you’ve captured that you can’t read and I’m sure you’ll get some constructive comments.Lighting, resolution, contrast, focus, decoding software... there are so many variables it’s certainly not simply a question of better resolution.

author: pwlps
author_rank: Frequent Contributor
timestamp: May 05, 2019, 10:27:30 pm
content: Quote from: Kemme on May 05, 2019, 09:15:09 pmI'm curious: what do you mean by "lot of aligning" ? I'm not expert in the field but I thought the software can always find barcodes at any orientation or skew, e.g. by analysing the Radon transform of the image.

author: DaJMasta
author_rank: Super Contributor
timestamp: May 06, 2019, 02:22:45 am
content: Have you tried different lighting conditions? A lot of image recognition algorithms perform a lot better in optimal lighting, so you may be able to get substantially better results with just a bit more light (or positioned in a way to not be reflective).

author: EEVblog
author_rank: Unknown
timestamp: May 06, 2019, 03:15:32 am
content: I'm just using one of those cheap arse pencil type USB microscopes

author: Kemme
author_rank: Contributor
timestamp: May 06, 2019, 07:40:49 am
content: I use Zbar library for scanning.Two examples. This one was not scanned:This was scanned. I just moved the camera one centimeter closer to the barcode.Lighting seems to be ok. Does it look like a camera issue? Or maybe it's just the Zbar library? What do you think?

author: todorp
author_rank: Regular Contributor
timestamp: May 06, 2019, 09:44:05 am
content: You could try Scandit library (also available for linux) though it is commercial software. It works really well under different lighting conditions and barcode distortions...

author: TopLoser
author_rank: Unknown
timestamp: May 06, 2019, 09:45:25 am
content: Yeah that first image is pushing it, lack of resolution means you’re struggling even by eye to pick out the narrow bars reliably. I just printed it out and used a couple of £2500 industrial scanners and they couldn’t decode it.Good cheap easy test is print it out and use the zbar app on your phone, if that can’t read it then improve the image quality.Turn off image compression as well, that’s introducing some nasty artefacts in the image between bars.

author: jeremy
author_rank: Super Contributor
timestamp: May 06, 2019, 12:38:01 pm
content: I use a Logitech C920 (purely for the resolution) and a nice bright lamp. From those pictures, it looks like you could use some brighter light to counteract what looks like the high noise floor of your sensor.

author: DaJMasta
author_rank: Super Contributor
timestamp: May 06, 2019, 03:50:55 pm
content: Agreed that the top image looks pretty low res for it to work - when you start having trouble making out the details by eye, it's not likely going to work so well. Maybe it's a configuration issue, then? Is it possible to increase the resolution available to the software from the same camera? Otherwise, maybe you want a camera with a narrower field of view - that would give you the closer looking picture at a similar or farther difference, which may suit the application better than a fairly wide field of view general use camera.

author: Twoflower
author_rank: Frequent Contributor
timestamp: May 06, 2019, 04:14:43 pm
content: As TopLoser said that the very expensive equipment had problems with the further away picture I saw this as a small challenge. Not printing, but on a Laptop-screen (1:1 zoom factor) and a P9 Lite with the app 'Barcode Scanner' from Cognex Corp. (not related to that). No big problems (2-4searchrounds) to read the code from the screen. It seems that some software is better to guesstimate that a light gray area is probably two thin lines. And because of this there's no need for the full resolution. But how they do that exactly I don't know.

author: rstofer
author_rank: Super Contributor
timestamp: May 06, 2019, 05:25:58 pm
content: It would seem to me that buying a commercial bar code scanner would be the easy way to get the data. Lighting isn't an issue, rarely does orientation matter and, apparently, these devices look like a keyboard. I haven't played with one but it seems pretty easy to integrate. At least one states that it works on Mac OS, Windows and Linux (Raspberry Pi?) and talks to popular productivity software.https://www.amazon.com/s?k=barcode+scanner&ref=nb_sb_noss_2