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.
*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.
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?
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!
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!
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 !
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.
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...
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!
@@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
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??
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?
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!
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
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.
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!
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!
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!
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.
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
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!
@@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?
@@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!
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!!
@@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 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
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.
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.
Hey Sravan, thanks a lot for your comment, it is much appreciated :)
I just felt the need to add +1!
Thank you for posting this video, python just became less intimidating to me. Thanks again.
I wish you lots of success in your journey, you can do it! :)
*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.
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?
Did this and loved it. Thankyou soo much!
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!
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!
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 !
Thank you so much bro.
I have a conflict, how add the code reader instead the camera?
I hope to answer me
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!
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.
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...
Can we get the details(price) and store(price) in SQLite(database)
Hi,
This is great! May I ask if this would work with a Data Matrix?
Great video, thanks for posting it. How do you stop the camera and get out of the while loop after reading ONE barcode? Thanks
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!
@@Pythonenthusiast Thank you so much for the quick reply.
Add a line camera == False? I think camera = False.
@@kyawzinhtet1704 I guess its camera == False.
@@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
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??
Do this code work for barcode scanning machine than webcam..?
could this code be used within flask
??
Thanks a lot for this video. It's very helpful.
Awesome content buddy.
Thanks!
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?
There are many ways to do that, probably the easiest one is to break when a QR code is found.
@@Pythonenthusiast Thank You
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!
It is absolutely possible :)
@@Pythonenthusiast one more question sir, "pyzbar" is that a package?
@@KartihkCg80 Yes, it is a package/library that can be installed as any other.
@@Pythonenthusiast thank you so much sir 🖤
Thank you this helped!
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?
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
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.
This is fantastic.
Thank you
part 2??? and 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!
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!
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!
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.
Great tutorial!
I am glad you enjoyed it!
how can i stop the scaaning once system able to recognize the QR .. please suggest
Try to create a loop that breaks when a QR is found.
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
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!
@@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?
@@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!
@@Pythonenthusiast many thanks!
how to make it with tkinter?
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!!
hey did you find the solution?
@@Olivernipples did you find?
how do i put the webcam inside a tkinter window
Maybe the link below would help you out.
stackoverflow.com/questions/16366857/show-webcam-sequence-tkinter
can you paste the code because I'm getting errors when copied your code
What error do you get? Is it fix now?
how does one install cv2
Check the link below:
pypi.org/project/opencv-python/
@@Pythonenthusiast thanks, found it
this is some good shit
Man codes in light mode i dont trust him
👍👌🙏🙏🙏
Hi Sir can i want learn from you how can it learn step by step can text us ,
Thanks you,
Hi Tan, sorry I cannot fully understand your message.
@@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
My email is stated on my UA-cam profile, so you can reach out to me with any questions that you might have.
@@Pythonenthusiast Hi Sir i did see your address can pass to me ,
Many Thanks,
Tan Meow Soon
@@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
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.