Barcodes and barcode scanners


Barcodes and barcode scanners


The barcode lets you keep a centralized record on a computer system that tracks products, prices, and stock levels. You can change prices as often as you like, without having to put new price tags on all your bottles and boxes.
A barcode-based stock system like this has three main parts:
  1. there's a central computer running a database (record system) that keeps a tally of all the products you're selling, who makes it, what each one costs, and how many you have in stock.
  2. there are the barcodes printed on all the products.
  3. there's one or more checkout scanners that can read the barcodes.

How barcodes represent the numbers 0-9


Each digit in a barcode is represented by exactly 7 equal-sized vertical blocks. These are colored in either black or white to represent the decimal numbers 0-9. Each block has been designed so that, even if you turn it upside down, it can't be confused with any other.


The general used barcodes represent three different types of information:
  • The first part of a barcode tells you the country where it was issued.
  • The next part reveals the manufacturer of the product.
  • The final part of the barcode identifies the product itself.

Python


Detecting the barcode is one piece of the puzzle.

The other piece is decoding the barcode into a useful string.
There are a few popular libraries for barcode detection, one of which is ZBar.

留言

熱門文章