Superb, simple and clearly explain videos. Will try it for sure.. start with the pi zero.. hopefully its working. Anyway, hope author can also create content, how to record this qr code into the google sheet. Will be very useful for making attendance for my students. Tq sir
@@jyvben1520 Manged to get this and also facial recognition with a tensor flow model working on a pi zero w. It runs, but a bit slowly, really depends on what your use case is for anyone else attempting it!
I have not been to our makers space for a while (Covid was only part of the reason *sad*) but the boom gate we had was triggered by a pi accessing a remote control button. This could be even better as it could log details of each member. Interesting if you could use one pi to scan then broadcast to another so that the remote can be protected so people don't push the remote button...
To manage that 5 Meters of distance I would want to use a lens I could zoom in with. Something like the Telephoto Camera Lens in combination with the HQ Camera Module. Linked both here - core-electronics.com.au/catalog/product/view/sku/CE06936 & core-electronics.com.au/catalog/product/view/sku/CE06935
Thanks for the great video. Everything worked so far. I would also like to read in a data matrix code with your program. Unfortunately it doesn't work, can you help me?
Nice mate! Glad the system is working for you. Because data matrices are encoded differently from QR codes the library we are using here won't understand them. However the | libdmtx | is purpose built to decode data matrices and is exactly what you should use. To incorporate this new library into Open-CV code have a look at this example - stackoverflow.com/questions/59989893/datamatrix-with-raspberry
Great video! Is there a way to stop getting multiple readings of the same QR code stored in the csv? The text file currently does not store the data even though it is displayed in Thonny. Is there a way to fix this?
So there are three codes in the download section. The CSV code will store and save the data to the text file. Just open the text file once you have stopped the code. To stop multiple readings of the same QR Code you will need to alter the code slightly by adding an If statement. That way when it see the same QR code it will ignore it.
Thanks for the video. I had a bit of an issue using the buster legacy image from pi imager (released 2022). The installation work but when using it in python (same way as your code), it doesn't work, it returns error : vidioc_qbuf invalid argument. Some sources said to increase gpu mem to 128 or even 144 but that didn't work. I reinstalled your image (from link) this time when doing sudo modprobe bcm2835-v4l2: it doesn't work (error : fatal, not found). can you please guide me to solve this issue, I have been struggling for weeks with the csi camera, given that my code was tested on ubuntu server and didn't work because of csi camera issue. Thanks :)
Totally interesting errors. Come make a comment at the bottom of the full write up article with some screenshots of your errors. I'll best be able to help you get your system up and running that way 😊
Hey! great video! just what I needed! all works as showed, however my camera is having a 5 -10 second delay. im using raspberry pi 3B+ (1gb) and rasp pi cam V1.3. What could be the issue, what do you think? Not enough ram?
Hey. I'm doing the same thing. You've already said the answer in short. OpenCV is HEAVY for a rpi. Pi 4 you can have more fps... but pretty much im getting 1 or 0.5 fps when using a camera + opencv on 3b.
The only issue with this type of computer vision is the computational power required to do it. Definitely using the slightly slower Raspberry Pi 3B+ is the issue here.
Absolutely and the code will be simpler. Have a look at what the OpenCV team has created - opencv.org/recognizing-one-dimensional-barcode-using-opencv/
Is it possible to read the QR code that contains Pdf file url link from our database and print it immediately (just make sure the printer is connected to the raspberry pi)
You should definitely be able to do that. I've been searching around for Python Libraries to make interfacing to a normal printer really easy but yet to find a perfect one for a Raspberry Pi system. CUPS may be what you need (along with some script writing) - www.cups.org/doc/overview.html
@@Core-Electronics Thanks, cause I've been watching a lot of videos about CUPS now. I will use a raspberry pi camera module 2 to scan the qr code using OpenCV . My only concern is what will be content of that qr code. I'm thinking if i can put a task/instructions on the qr code (that orders to print the file associated on it once scanned)
QR Codes can Definitely Link to Websites which can then have the desired subject to be printed. Then all the orders/instructions to do the printing can be running on a Python script operating in the background.
Hit up our Forum if you need any extra help! Much easier for us to help you there 😊 You'll be able to send through pictures - forum.core-electronics.com.au/
I'm newbie and have problem installing library like this: "Package libqtgui4 is not available, but is referred to by another package. This may mean that the package is missing, has been obsolete, or is only available from another source". Can you help me? please
I absolutely can. Your problem is arising because currently there is compatability issues between Open-CV and the new 'Bullseye' OS. Flash and utilise the previous 'Buster' OS and you won't have this issue. core-electronics.com.au/tutorials/flash-buster-os-pi.html
Any video feed that you can get into the Raspberry Pi can have this computer vision system evaluate it 😊 you may just have to tinker with the code. Then that information can be sent out of the Raspberry Pi in all different ways.
Sounds to me like it can't locate the camera. What kind of camera are you using with this system? Also what version of Raspberry Pi OS are you using? I highly recommend using the older 'Buster' Raspberry Pi OS for this application. Come pop me a comment at the bottom of the full article page if you keep running into issues.
Cheers mate, type and enter the following into a new terminal window. raspistill -t 0 If that doesn't open up a camera feed straight away (which you can close with CTRL-C) then double check that the camera is enabled in the Raspberry Pi Configuration Menu and that all the ribbon cables are connected securely and are right way around. If that doesn't fix it come jump onto our Core Electronics Forum as we can help you better there.
@@Core-Electronics Went through and checked it, I have it working over here. The problem could be to do with the v4l driver. That happens when you type and enter the below into your terminal. sudo modprobe bcm2835-v4l2
@@Core-Electronics camera is working, when I run the code it pops up the preview window but I'm getting that error. Also, don't know how to start new topic on core electronics forum.
I am getting Unable to locate package python3-opencv~ when trying to apply the install python3-opencv command. I am using raspberry pi zero W. Searched everywhere to fix this and nothing. Anyone have an idea?
pip3 install opencv-contrib-python==4.1.0.25 sudo modprobe bcm2835-v4l2. Now these two aren't working but i got this far at least. For the pip install im getting a "THESE PACKAGES DO NOT MATCH THE HASHES FROM REQ...." error. I have tried deleting the cache directory and specifying no cache directory to no avail. And for the sudo modprob command im getting a "modprobe: FATAL: module bcm2835-v412 not found in directory /lib/modules/5.10.17. Im guessing that one depends on the previous command?
@@Core-Electronics Thanks alot for the reply I appreciate it! Did you see my most recent message? Im getting a "THESE PACKAGES DO NOT MATCH HASES FROM.." error when trying to use pip3 install opencv-contrib-python==4.10.25. This is after using Buster OS. Any ideas or tips?
Really nice tutorial, just noticed i'm getting an error with "libqtgui4: saying not available. currently have Rpi4b os-version 11(bullseye). Any suggestions how to overcome this?
Hey mate, perhaps the library has been updated. Try running this command | sudo apt-get install libqt5gui5 libqt5webkit5 libqt5test5 | and tell me how you go
Amazing! I think its the best video tutuorial I have ever seen!
Superb, simple and clearly explain videos. Will try it for sure.. start with the pi zero.. hopefully its working. Anyway, hope author can also create content, how to record this qr code into the google sheet. Will be very useful for making attendance for my students. Tq sir
pi zero is probably not powerful enough, that is why the video used a pi 4b (4 cores at 1500 mhz)
Glad you liked it, you could import the CSV file from the second example directly into Google sheets.
@@jyvben1520 Manged to get this and also facial recognition with a tensor flow model working on a pi zero w. It runs, but a bit slowly, really depends on what your use case is for anyone else attempting it!
Hey, would I be able to connect the cables to the GPIO pins and light up the LEDs without using a breadboard? I only have cables and resistors
If you have a steady hand you can always solder this set up together, eliminating the need for the breadboard.
I have not been to our makers space for a while (Covid was only part of the reason *sad*) but the boom gate we had was triggered by a pi accessing a remote control button. This could be even better as it could log details of each member. Interesting if you could use one pi to scan then broadcast to another so that the remote can be protected so people don't push the remote button...
That would be awesome! I'd love to see that 🙂
Can you please make a face tracking pan tilt raspi camera tutorial? Love these videos!
Absolutely, next weeks episode will cover that very topic. 👍
You guys are AWESOME!
Really great video! Congrats! Can you tell me what best cost-benefit relation camera to read a qr-code of 6 x 6 inches from 5 meters of distance?
To manage that 5 Meters of distance I would want to use a lens I could zoom in with. Something like the Telephoto Camera Lens in combination with the HQ Camera Module. Linked both here - core-electronics.com.au/catalog/product/view/sku/CE06936 & core-electronics.com.au/catalog/product/view/sku/CE06935
Thanks for the great video. Everything worked so far. I would also like to read in a data matrix code with your program. Unfortunately it doesn't work, can you help me?
Nice mate! Glad the system is working for you. Because data matrices are encoded differently from QR codes the library we are using here won't understand them. However the | libdmtx | is purpose built to decode data matrices and is exactly what you should use.
To incorporate this new library into Open-CV code have a look at this example - stackoverflow.com/questions/59989893/datamatrix-with-raspberry
i tryed this reciently w the new bookworm os but it seems the camera code is all broken/dependencys failed to install ;c, gonna try with the old OS
Great video! Is there a way to stop getting multiple readings of the same QR code stored in the csv? The text file currently does not store the data even though it is displayed in Thonny. Is there a way to fix this?
So there are three codes in the download section. The CSV code will store and save the data to the text file. Just open the text file once you have stopped the code.
To stop multiple readings of the same QR Code you will need to alter the code slightly by adding an If statement. That way when it see the same QR code it will ignore it.
Thanks for the video. I had a bit of an issue using the buster legacy image from pi imager (released 2022). The installation work but when using it in python (same way as your code), it doesn't work, it returns error : vidioc_qbuf invalid argument. Some sources said to increase gpu mem to 128 or even 144 but that didn't work.
I reinstalled your image (from link) this time when doing sudo modprobe bcm2835-v4l2: it doesn't work (error : fatal, not found).
can you please guide me to solve this issue, I have been struggling for weeks with the csi camera, given that my code was tested on ubuntu server and didn't work because of csi camera issue.
Thanks :)
Totally interesting errors. Come make a comment at the bottom of the full write up article with some screenshots of your errors. I'll best be able to help you get your system up and running that way 😊
Hey! great video! just what I needed! all works as showed, however my camera is having a 5 -10 second delay. im using raspberry pi 3B+ (1gb) and rasp pi cam V1.3. What could be the issue, what do you think? Not enough ram?
Hey. I'm doing the same thing. You've already said the answer in short. OpenCV is HEAVY for a rpi. Pi 4 you can have more fps... but pretty much im getting 1 or 0.5 fps when using a camera + opencv on 3b.
The only issue with this type of computer vision is the computational power required to do it. Definitely using the slightly slower Raspberry Pi 3B+ is the issue here.
hello, can i do this without any problem in raspberry pi lower versions like 3-1?
Love the video. Can the same set up work for normal barcodes?
Absolutely and the code will be simpler. Have a look at what the OpenCV team has created - opencv.org/recognizing-one-dimensional-barcode-using-opencv/
is it possible to modify your source code so that it only recognizes qrs and barcodes in pairs (which will be very close together)?
Do you know how to read micro qrcode using python? If is possible, could you make a video to explain the steps to create a script? Thanks from Brazil!
Is it possible to read the QR code that contains Pdf file url link from our database and print it immediately (just make sure the printer is connected to the raspberry pi)
You should definitely be able to do that. I've been searching around for Python Libraries to make interfacing to a normal printer really easy but yet to find a perfect one for a Raspberry Pi system. CUPS may be what you need (along with some script writing) - www.cups.org/doc/overview.html
@@Core-Electronics Thanks, cause I've been watching a lot of videos about CUPS now. I will use a raspberry pi camera module 2 to scan the qr code using OpenCV . My only concern is what will be content of that qr code. I'm thinking if i can put a task/instructions on the qr code (that orders to print the file associated on it once scanned)
QR Codes can Definitely Link to Websites which can then have the desired subject to be printed. Then all the orders/instructions to do the printing can be running on a Python script operating in the background.
@@Core-Electronics Thanks I'll comeback here once I made progress.
Hit up our Forum if you need any extra help! Much easier for us to help you there 😊 You'll be able to send through pictures - forum.core-electronics.com.au/
I'm newbie and have problem installing library like this:
"Package libqtgui4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsolete, or is only available from another source".
Can you help me? please
I absolutely can. Your problem is arising because currently there is compatability issues between Open-CV and the new 'Bullseye' OS. Flash and utilise the previous 'Buster' OS and you won't have this issue. core-electronics.com.au/tutorials/flash-buster-os-pi.html
@@Core-Electronics thankyou so much bro. it works🙏
@@Core-Electronics if one does this, should they avoid using the get apt update and upgrade? will they just update it back to bullseye?
very nice video .. can i do this on a streaming live video ?
Any video feed that you can get into the Raspberry Pi can have this computer vision system evaluate it 😊 you may just have to tinker with the code. Then that information can be sent out of the Raspberry Pi in all different ways.
You are the best
If I didn't want a Camera , but rather to screenshare a QR code , what would I do? Get rid of the webcam but still gain the data off of, the QR code
Hello,
I am getting this error :
Overload resolution failed: > - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
Sounds to me like it can't locate the camera. What kind of camera are you using with this system? Also what version of Raspberry Pi OS are you using? I highly recommend using the older 'Buster' Raspberry Pi OS for this application. Come pop me a comment at the bottom of the full article page if you keep running into issues.
@@Core-Electronics I'm using buster. And NoIR camera.
Cheers mate, type and enter the following into a new terminal window.
raspistill -t 0
If that doesn't open up a camera feed straight away (which you can close with CTRL-C) then double check that the camera is enabled in the Raspberry Pi Configuration Menu and that all the ribbon cables are connected securely and are right way around. If that doesn't fix it come jump onto our Core Electronics Forum as we can help you better there.
@@Core-Electronics Went through and checked it, I have it working over here. The problem could be to do with the v4l driver. That happens when you type and enter the below into your terminal.
sudo modprobe bcm2835-v4l2
@@Core-Electronics camera is working, when I run the code it pops up the preview window but I'm getting that error. Also, don't know how to start new topic on core electronics forum.
amazing, thanl you! 👍👍
I am getting Unable to locate package python3-opencv~ when trying to apply the install python3-opencv command. I am using raspberry pi zero W. Searched everywhere to fix this and nothing. Anyone have an idea?
Going to trying using Buster OS. Hopefully this fixes it.
pip3 install opencv-contrib-python==4.1.0.25
sudo modprobe bcm2835-v4l2. Now these two aren't working but i got this far at least. For the pip install im getting a "THESE PACKAGES DO NOT MATCH THE HASHES FROM REQ...." error. I have tried deleting the cache directory and specifying no cache directory to no avail.
And for the sudo modprob command im getting a "modprobe: FATAL: module bcm2835-v412 not found in directory /lib/modules/5.10.17. Im guessing that one depends on the previous command?
100% that will sort you, I rebuilt this yesterday to confirm continued full operation and all was well
@@Core-Electronics Thanks alot for the reply I appreciate it! Did you see my most recent message? Im getting a "THESE PACKAGES DO NOT MATCH HASES FROM.." error when trying to use pip3 install opencv-contrib-python==4.10.25. This is after using Buster OS. Any ideas or tips?
u are awesome.
Naww cheer mate! You're rad too.
Really nice tutorial, just noticed i'm getting an error with "libqtgui4: saying not available. currently have Rpi4b os-version 11(bullseye). Any suggestions how to overcome this?
"E: Unable to locate package libqt4-test
E: package 'libqtgui4' has no installation candidate"
Hey mate, perhaps the library has been updated. Try running this command | sudo apt-get install libqt5gui5 libqt5webkit5 libqt5test5 | and tell me how you go