I need to do a project to scan QR codes and trigger a relay. I am using used the default image Ubuntu 14.04 but noticed OpenCV is not installed by default. I search around and tried but with no luck to get OpenCV 3.20 installed. Does anyone know the correct steps to installed or have a sample working python script to scan for QR codes. You help is much appreciated!
@Justyn Bell seemed to manage the installation, including a tip for the video capturing: http://www.udoo.org/forum/threads/u...encvs-videocapture-class-2-0.6130/#post-23716 What were the errors you encountered during installation? As an alternative you perhaps could use zbar, see for example https://www.hackster.io/faweiz/qr-code-on-raspberry-pi-5f6764 But I don't know if it works with the Udoo Cam, you have to try it.
i ran this and was able to import into python but somehow can't detect the video source. Anyone can help? sudo apt-get install libopencv-dev python-opencv Script: import numpy as np import cv2 cap = cv2.VideoCapture(0) while(True): # Capture frame-by-frame ret, frame = cap.read() # Our operations on the frame come here gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Display the resulting frame cv2.imshow('frame',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break # When everything done, release the capture cap.release() cv2.destroyAllWindows() Output: HIGHGUI ERROR: libv4l unable to ioctl S_FMT HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/color.cpp, line 3737 Traceback (most recent call last): File "test.py", line 11, in <module> gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.error: /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/color.cpp:3737: error: (-215) scn == 3 || scn == 4 in function cvtColor
Did you google on the error? I found for example http://stackoverflow.com/questions/...ertion-failed-scn-3-scn-4-in-cv-cvtcolor-file. From the conversation in the comments to the question, we saw that VideoCapture gives frame in grayscale. So the call to cvtColor caused the crash.
Even this does not work. import numpy as np import cv2 cap = cv2.VideoCapture(0) Error: HIGHGUI ERROR: libv4l unable to ioctl S_FMT HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT And with UDOObuntu 2.0. Can't use it as a loopback device http://www.udoo.org/docs/Hardware_&_Accessories/UDOO_Camera_Module.html Looks like the camera is quite redundant if can't use the loopback. Any help ?
Did you attempt to install OpenCV using pip? If not, you can give it a try by typing "pip install opencv-python" in your terminal. This will likely install the most up-to-date version of OpenCV on your computer.
Hey there! I'm new to this forum and saw your post about OpenCV installation errors. I feel your pain - I've been there before! Have you tried using Smart Engines SDK instead? It's an alternative that's super easy to install and use. Just Google it and follow the instructions.For QR code scanning in Python, I recommend checking out this script I found on GitHub. It's easy to understand and modify to fit your needs. Make sure to install the necessary dependencies before running it.If you still want to stick with OpenCV, I suggest checking out this tutorial on YouTube. It's super helpful and has step-by-step instructions that should help you get it installed correctly.