Scan QR codes and barcodes with Python

  Рет қаралды 78,219

Python enthusiast

Python enthusiast

Күн бұрын

Пікірлер: 80
@sravanjosh1218
@sravanjosh1218 3 жыл бұрын
Hey Kostadin, Thanks a lot for the video. It was really helpful. I'm that introvert who would watch videos and go silent without commenting in it. This video demands appreciation. Thanks again for the video.
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
Hey Sravan, thanks a lot for your comment, it is much appreciated :)
@Frank-xx6rs
@Frank-xx6rs 2 жыл бұрын
I just felt the need to add +1!
@Sinclair393
@Sinclair393 2 жыл бұрын
Thank you for posting this video, python just became less intimidating to me. Thanks again.
@Pythonenthusiast
@Pythonenthusiast 2 жыл бұрын
I wish you lots of success in your journey, you can do it! :)
@IsaacMoore-un9hc
@IsaacMoore-un9hc 2 жыл бұрын
To scan UPC-A barcodes would I still use utf-8 or would it be a different format of decoding? I scanned a pack of gum and it registered as EAN13 even though it is UPC-A, however when I tried to scan a drink can, it would not register. How can I fix this?
@vivektiwari4511
@vivektiwari4511 2 жыл бұрын
Can we get the details(price) and store(price) in SQLite(database)
@te_b4_69_parmesh_walunj3
@te_b4_69_parmesh_walunj3 3 жыл бұрын
Hello Kostadin, how to connect the USB barcode scanner device to the code you have shown in the video? Thanking you in advance for your help!
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
Hey there. I don't think there's one answer that would be correct for all barcode scanners. But, you can take a look at the link below: www.instructables.com/USB-Barcode-Scanner-Raspberry-Pi/ Basically, you need to have the option to add the code to your barcode scanner. However, you can think outside of the box. A scanner doesn't have to look like a regular scanner, it can be your phone.
@kgoulas21
@kgoulas21 8 ай бұрын
Hi, This is great! May I ask if this would work with a Data Matrix?
@Oussama-qp2hh
@Oussama-qp2hh 3 жыл бұрын
Thank you so much bro. I have a conflict, how add the code reader instead the camera? I hope to answer me
@ahmedbahaaulddin1606
@ahmedbahaaulddin1606 3 жыл бұрын
could this code be used within flask ??
@cocopalafox3918
@cocopalafox3918 3 жыл бұрын
Great video, thanks for posting it. How do you stop the camera and get out of the while loop after reading ONE barcode? Thanks
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
In the code, I am using time.sleep(5), which waits for 5 seconds after finding a code. If you want to completely get out of the loop, here's how you would do it: 1. Take a look at the while look, it starts with while camera == True. So, while camera == True, it will keep running. 2. In the first if-statement, instead of having time.sleep(5), you can add a line camera == False (or replace the time.sleep one with this. What this would do is, once a barcode is found, it would set camera to be False and therefore get out of the while loop. I hope this helps!
@cocopalafox3918
@cocopalafox3918 3 жыл бұрын
@@Pythonenthusiast Thank you so much for the quick reply.
@kyawzinhtet1704
@kyawzinhtet1704 3 жыл бұрын
Add a line camera == False? I think camera = False.
@sravanjosh1218
@sravanjosh1218 3 жыл бұрын
@@kyawzinhtet1704 I guess its camera == False.
@alexportugal3986
@alexportugal3986 3 жыл бұрын
@@sravanjosh1218 definetly camera = false. You want to set the variable to false so only one =. With 2 you would use to check if camera is false --> camera == false
@raghuram1291
@raghuram1291 3 жыл бұрын
Do this code work for barcode scanning machine than webcam..?
@mohanprasath4666
@mohanprasath4666 Жыл бұрын
Hello, wonderful demo !!! Can you help me resolving the below issue pls ? When I use import statement as "from pyzbar.pyzbar import decode" and run the code (without any other executable lines), am getting the error "ImportError: Unable to find zbar shared library". P.S - I did brew the ZBAR and then installed the PYZBAR as mentioned in one of the forums but still no luck... Thanks in advance !
@KartihkCg80
@KartihkCg80 3 жыл бұрын
if it possible using raspberry pi zero w and camera to build a barcode scanner using tis code? plz replay sir, if this works i like to build a portable scanning devices!
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
It is absolutely possible :)
@KartihkCg80
@KartihkCg80 3 жыл бұрын
@@Pythonenthusiast one more question sir, "pyzbar" is that a package?
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
@@KartihkCg80 Yes, it is a package/library that can be installed as any other.
@KartihkCg80
@KartihkCg80 3 жыл бұрын
@@Pythonenthusiast thank you so much sir 🖤
@joacimjohnsson
@joacimjohnsson 3 жыл бұрын
Hi, is the pyzbar only handling type EAN13 and QRCODE? I have once lable which is not seems to be working ... just wonder how many types pyzbar could handle...
@vijayreddykondapally3836
@vijayreddykondapally3836 2 жыл бұрын
how can i stop the scaaning once system able to recognize the QR .. please suggest
@Pythonenthusiast
@Pythonenthusiast 2 жыл бұрын
Try to create a loop that breaks when a QR is found.
@etigorkhe41
@etigorkhe41 2 жыл бұрын
Did this and loved it. Thankyou soo much!
@group3cpe95
@group3cpe95 2 жыл бұрын
Hello Kostadin, Thank You very much for this video, do you perhaps know how to close the video capture? When i close the ui of the camera it just kept on coming back, do you know what to do with this?
@Pythonenthusiast
@Pythonenthusiast 2 жыл бұрын
There are many ways to do that, probably the easiest one is to break when a QR code is found.
@group3cpe95
@group3cpe95 2 жыл бұрын
@@Pythonenthusiast Thank You
@chrizzchan6800
@chrizzchan6800 6 ай бұрын
part 2??? and 3??
@mustaqim6642
@mustaqim6642 4 жыл бұрын
Hello Kostadin. Your tutorial is very helpful. Can i know, how can i put the data that was printed into a variable. Then, i can just use the variable to play around with the data such as insert into a database. Thank you in advance for your help!
@Pythonenthusiast
@Pythonenthusiast 4 жыл бұрын
Hi Mustaqim, thanks for your question. If you want to create a variable (let's name that variable x), you can use x = code.data.decode('utf-8'). Then you can work with the variable. Hope this helps!
@vaibhavsrivastva1253
@vaibhavsrivastva1253 5 ай бұрын
*HELPFUL TIPS* (will update) :- 1. myVidCap = cv2.VideoCapture(0, cv2.CAP_DSHOW) # CAP_DSHOW api opens camera MUCH faster than CAP_MSMF, at least on Windows. 2. flippedHorizontal = cv2.flip(frame, 1) # Flipping the output about the Y-axis. cv2.imshow("Testing-Code-Scan", flippedHorizontal) # Change "frame" to the operation carried out on it.
@ammarmujahid903
@ammarmujahid903 Күн бұрын
can you help me by sharing code for detecting barcode
@tojoeinstein5558
@tojoeinstein5558 2 жыл бұрын
how to make it with tkinter?
@KudoMarkos
@KudoMarkos 3 жыл бұрын
Hello @ Kostadin Ristovski , i would like to know if i use cv2 in a BeeWare python app, built it in Android. It would use the cam of the phone??? Or are more things necesary??
@Mystery_Glitch
@Mystery_Glitch 3 жыл бұрын
I think it should be change to if the same code not get scan in a minute , it can rescan , it should be better if you make a bought list in supermarket
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
In the supermarkets I have noticed two types of scanners: 1. Fixed ones that are built in the table, where they scan constantly, until there is a product. Then, there is a stop for a second or two before they start scanning again. This is to ensure that the same product is not scanned multiple times at once. 2. Portable ones, where the scanning starts by pressing (and sometimes holding) a button. Once a product is scanned, the same one/two seconds stop is applicable for the same reason.
@killbillk4286
@killbillk4286 3 жыл бұрын
how do i put the webcam inside a tkinter window
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
Maybe the link below would help you out. stackoverflow.com/questions/16366857/show-webcam-sequence-tkinter
@rohitkhandal6442
@rohitkhandal6442 2 жыл бұрын
Hello kostadin, Importing pyzbar showing me an error Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax. please help!!
@Olivernipples
@Olivernipples Жыл бұрын
hey did you find the solution?
@neonyt6739
@neonyt6739 6 ай бұрын
@@Olivernipples did you find?
@chadwick9718
@chadwick9718 2 жыл бұрын
Hello this is one of the best cv tutorial i ever watched. can i add script on this code where once i click the button this python code will run?
@patrickstar1394
@patrickstar1394 3 жыл бұрын
can you paste the code because I'm getting errors when copied your code
@mjroma9298
@mjroma9298 3 жыл бұрын
What error do you get? Is it fix now?
@moneyodsg
@moneyodsg 3 жыл бұрын
how does one install cv2
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
Check the link below: pypi.org/project/opencv-python/
@moneyodsg
@moneyodsg 3 жыл бұрын
@@Pythonenthusiast thanks, found it
@puzobaklan
@puzobaklan 4 жыл бұрын
Hello Kostadin! Firstly, thank you for good tutorial! I have a question about how can I use jpeg-file with QR Code that I got, for example, by taking photo of some item in supermarket
@Pythonenthusiast
@Pythonenthusiast 4 жыл бұрын
Hi there. The tutorial starts with decoding an image and extracting the information from a QR-code. If you have a jpeg file, then it would be the same. You need to "read" the image with cv2, then decode it and you can extract the data. Hope this helps!
@puzobaklan
@puzobaklan 4 жыл бұрын
@@Pythonenthusiast but, I saw in the documentation, that there are two ways to read an image file in to the pyzbar: with PIL and with Open CV. What is your favorite way, and why?
@Pythonenthusiast
@Pythonenthusiast 4 жыл бұрын
@@puzobaklan Well, both PIL and Open CV allow you to read an image. PIL (short for pillow) is more usable for image manipulation/processing. So for example if you want to resize an image or cut it. Open CV is a computer vision library, which is suitable for complex vision-related tasks or live videos. Hope this helps!
@puzobaklan
@puzobaklan 4 жыл бұрын
@@Pythonenthusiast many thanks!
@SadButTrue206
@SadButTrue206 3 жыл бұрын
hello kostadin. I really enjoy your tutorial, can i know that can I use it for the mobile app which is implemented by Kivy, such as using camera from smartphone, then read it then the returned data can be used for sth else. by the way, is there any solution to tracking the scanned time of the QR code, thanks!
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
Hi there, thanks for the question. All of what you have mentioned is possible. I am not that familiar yet with mobile app development, but Kivy library was recommended to me, so maybe you can combine this tutorial with the Kivy library and create an app as you describe. As for the scanned time, you can take a look at datetime, there's a function datetime.now() that would return the current time. Hope this helps!
@rickyricardo75
@rickyricardo75 4 жыл бұрын
Great tutorial !! Question: Do you know if there's a way to run some code from the Atom editor into IDLE-Shell without having to open the folder where my py file is located then right-click on it and select "open with > IDLE..." it's quite tedious when testing. Thanks!
@Pythonenthusiast
@Pythonenthusiast 4 жыл бұрын
Hi Ricky, if you have a .txt file, by double-clicking it, it would open in a word-processing program, such as notepad. The reason for that is, well, you can't do anything else with the file. However, if you have a .py file, it can be edited, but also run. So, by double-clicking it, you access its main function, to run the code written inside. If you want to edit it, you have to right-click and open via IDLE for example.
@jorgeluizdossantos2376
@jorgeluizdossantos2376 2 жыл бұрын
Thanks a lot for this video. It's very helpful.
@mangotofu1360
@mangotofu1360 2 жыл бұрын
Thank you this helped!
@UTechHacks
@UTechHacks 4 жыл бұрын
Awesome content buddy.
@Pythonenthusiast
@Pythonenthusiast 4 жыл бұрын
Thanks!
@tinylittleanj2
@tinylittleanj2 2 жыл бұрын
This is fantastic. Thank you
@frroossst4267
@frroossst4267 2 жыл бұрын
Great tutorial!
@Pythonenthusiast
@Pythonenthusiast 2 жыл бұрын
I am glad you enjoyed it!
@crajeextreme8469
@crajeextreme8469 4 ай бұрын
this is some good shit
@M0ntanaT
@M0ntanaT 2 жыл бұрын
👍👌🙏🙏🙏
@mickscience3830
@mickscience3830 2 жыл бұрын
Man codes in light mode i dont trust him
@tanmeowsoon5252
@tanmeowsoon5252 3 жыл бұрын
Hi Sir can i want learn from you how can it learn step by step can text us , Thanks you,
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
Hi Tan, sorry I cannot fully understand your message.
@tanmeowsoon5252
@tanmeowsoon5252 3 жыл бұрын
@@Pythonenthusiast Hi Sir i want to learn from you is good that i can get more detail form you i am from Singapore after watch your video is a great thing , Many Thanks, Tan MS
@Pythonenthusiast
@Pythonenthusiast 3 жыл бұрын
My email is stated on my KZbin profile, so you can reach out to me with any questions that you might have.
@tanmeowsoon5252
@tanmeowsoon5252 3 жыл бұрын
@@Pythonenthusiast Hi Sir i did see your address can pass to me , Many Thanks, Tan Meow Soon
@tanmeowsoon5252
@tanmeowsoon5252 3 жыл бұрын
@@Pythonenthusiast Hi Kostadin i want to learn the way you do the python program for the barcode, by using the Pc cameras how can i go to your Tutorial step by step ? can guide me , Many Thanks, Tan Meow Soon
@voil6161
@voil6161 Жыл бұрын
I hate tutorials like this. Whats the point of making a barcode scanner with Python if youre gonna import all of the code anyway. Theres no good tutorials out there. Everybody just imports everything and calls it a day.
Python Project That Generates QR Codes!  - Super Simple TUTORIAL!
19:48
Generating QR Codes And Barcodes in Python
14:28
Rishab Kattimani
Рет қаралды 19 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 102 М.
5 Python Libraries You Should Know in 2025!
22:30
Keith Galli
Рет қаралды 68 М.
How To Read And Decode Barcode Using OpenCV And pyZbar In Python
8:43
QR Code Scanner & Generator with GUI in Python
24:31
NeuralNine
Рет қаралды 23 М.
Convert py to exe - from code to software
5:55
Python Simplified
Рет қаралды 483 М.
How to Detect QRCode and BarCode using OpenCV in Python + Project
23:45
Murtaza's Workshop - Robotics and AI
Рет қаралды 163 М.
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 211 М.
Project With Real BarCode Scanner?  Billing System Python #Recycle #Reuse
8:15
Vinay Verma - Computer Vision and Tech
Рет қаралды 39 М.
QR Code Generator in Python
7:32
NeuralNine
Рет қаралды 70 М.
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН