

You can download code and create your own barcode with setting cost of the product as per your requirement. This application can also be used to read QR code with miner changes in the code. If barcode is small in size or distance between webcam and barcode is more then system fails to scan barcode.It can also be used to develop similar application like in library, a book can be assigned to student using barcode scanning system. This application can be used in shopping malls and small stores to automate billing process.Webcam is more durable and even if some problem occurs, it is easy to fix compared to barcode reader machines.It is very easy to handle and also don’t require human effort as webcam can be fixed at certain place and customers only need to keep items to be purchased facing barcodes towards webcam.This application can be considered as cost effective, as cost of webcam is quite very low compared to cost of bar code reader machine.The demo video of the complete process is shown here.ĭemo of the execution of barcode reader script using webcam Advantages

Once we press button ‘e’ to exit from the barcode reading process, the application adds the cost of every purchased item and display the final cost of shopping. For each scanned item, application records purchase date, purchased item ID and item cost. For example, data of barcode for the item calculator is set as C4 where ‘C’ is considered the item ID ( Calculator) and ‘4’ as the item cost in $. The data (cost of the product) encrypted in the barcode is a combination of product name and its cost.
PYTHON QR CODE READER WEBCAM INSTALL
Therefore, before executing program make sure that you have installed pyzbar which can be installed using pip as pip install pyzbarįor rest of the process, please download complete code from GitHub repository and follow steps as mentioned in readme. All these steps are taken care of by decode object of pyzbar. After the morphological operation, a contour is drawn around the barcode. Then an adaptive threshold is used to obtained processed image. Bilateral filter or Gaussian filter can be used for this purpose. The script initializes live video stream and extracts each frame from the video. Here, i have developed a python application to read barcode that i have created and decode data from that using webcam. So, in this way you can also create your own bar codes of products for your shopping store. Generated barcode using python scripts is shown in Figure 2.įigure 4: Barcode stick on products under consideration You can change standard as per for choice. >import barcode >EAN = barcode.get_barcode_class('ean13') >ean = EAN(u'5901234123457') >fullname = ean.save('ean13_barcode')Ībove code will save barcode in European Article Number (EAN) standard. png with minor changes in the following code which is taken from here. Once you install pyBarcode, run following four lines of code to create barcode image. To install pyBarcode use pip as pip install pyBarcode

It can provide EAN-8, EAN-13, EAN-14, UPC-A, JAN, ISBN-10, ISBN-13, ISSN, Code 39, Code 128, PZN types of standard barcode. Now a days, there are many standard libraries available in python to create barcode. Developed system is found to be cost effective, durable, easy to use, fully automated the billing process i.e don’t require human effort to scan barcode. In this article, a barcode scanner using python has been developed which can read barcode of the product using webcam, decode the cost of item which is encrypted in barcode and calculate the price of the product, finally at the end of shopping you will get number of items you have purchased, date of purchasing, name of items purchased and the corresponding cost.

Therefore, it became necessary to develop such a system which can automate the process of scanning the products and comes at low cost with low maintenance requirement. changes and durability is also an issue with this barcode scanner machine. There are quite many other Python packages for generating all sorts of one or two dimensional barcodes, some are in pure Python packages and some are Python wrappers, you may take a look at the summary table from this blog if any specific barcode type you need is not supported by these two packages.Another problem with this is, it comes at a high cost. In this article, we have reviewed through two simple but useful packages – qrcode for generating QR code, and pyzbar for reading the content from a QR code. If you need to do a lot of image pre-processing or even read barcode from video or webcam, you may install OpenCV and use the detectAndDecodeMultimethod to read the QR code. In your real-world project, if you need to read one barcode among the multiple barcodes from a document, you may try to use the symbolsto restrict the barcode types, or use regular expression to validate the detected barcode data in order to find the correct one you need.
