OpenCV AruCo detection fails: "Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory."
Raspberry Pi Stack Exchange Forums » Opencv
by Carter Betts
1M ago
I've been trying to run a simple AruCo detection code on my Raspberry Pi 4B, and consistently get the error "Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory". I am brand new to raspberry Pi's, and also not very experienced in python and thus have never seen this error. Looking online provided no answers. Any help would be appreciated. The code is below. Thanks in advance. import cv2 as cv from cv2 import aruco import numpy as np # dictionary to specify type of the marker marker_dict = aruco.getPredefinedDictionary(aruco.DICT_5X5_250) # detect th ..read more
Visit website
Pi4 python OpenCV timeout
Raspberry Pi Stack Exchange Forums » Opencv
by Dwayne David Wallace
1M ago
I have been having some issues with getting a video stream from my cameras on my Pi4B. I am running this on Python. I have been getting the error; VIDEOIO(V4L2:/dev/video0): select() timeout with the code; import socket import cv2 import numpy as np print("OpenCV version:", cv2.__version__) #print("CUDA support:", cv2.cuda.getCudaEnabledDeviceCount() > 0) BUFF_SIZE = 65535 CHUNK_SIZE = 16384 WIDTH = 640 HEIGHT = 480 port = 5555 port2 = 5556 # Set the end marker delimiter = b'FRAME_END_MARKER' try: # Creat the UDP socket UDP_socket = socket.socket(socket.AF_INET, socket.SOCK_D ..read more
Visit website
RPi 5 Code Does Not Work Without Root
Raspberry Pi Stack Exchange Forums » Opencv
by MEnsar55
2M ago
I have a code. Because it is very long (2500 lines) I can not throw it here but here are the libraries: import sys import datetime import locale import serial import time import os import cv2 import keyboard import threading import google.generativeai as genai from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import Qt, QTimer, QTime, QUrl from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtWebEngineWidgets import * from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLineEdit, QPushButton, QGridLayout, QToolButton, QToolBar from PyQt5.QtGui import QFont, QPa ..read more
Visit website
I cannot install OpenCV on RaspberryPy
Raspberry Pi Stack Exchange Forums » Opencv
by Ovidiu Moise
4M ago
I cannot install OpenCV on RaspberryPi 4 Model B with Bookworm OS. I tried at least 4 different ways including pip and cmake. Each time I reach the step to install OpenCV, it ends in failure: cannot build wheel for Numpy. I inslalled puthon 3.12.1 and Numpy 1.26.3. Can anybody help me ..read more
Visit website
On bookworm cant use picamera2 with opencv-python
Raspberry Pi Stack Exchange Forums » Opencv
by Oferb
5M ago
installed opencv--python on bookworm os when using picamera2 i get this error: QObject::moveToThread: Current thread (0x7f6802fd50) is not the object's thread (0x7f6822efb0). Cannot move to target thread (0x7f6802fd50) here is the code: import cv2 from picamera2 import Picamera2, Preview import time picam2 = Picamera2() picam2.start_preview(Preview.QTGL) picam2.start() time.sleep(4) as soon as i comment out the line "import cv2" it works opencv-python ver 4.6.0+dfsg-12 picamera2 ver 0.3.16 python3 raspberry pi 4b ..read more
Visit website
How do I directly process live raw camera data on the GPU without it passing though the CPU?
Raspberry Pi Stack Exchange Forums » Opencv
by Curtis
5M ago
My understanding of the how a Raspberry Pi camera attached to the CSI port of the Pi works is that the raw data from it ends up directly in the GPU where it is slightly processed and compressed before being either sent to the CPU or displayed with the exception of the Pi 5 where some of that is handled on the RP1 chip first. The big benefit of this, as I understand it, is that we can theoretically access the raw data for computer vision purposes without it ever needing to pass through the CPU bottleneck, however I can't seem to find any explanation about how I would set up such a pipeline to d ..read more
Visit website
OpenCV Pandas and Numpy
Raspberry Pi Stack Exchange Forums » Opencv
by Bill Harvey
5M ago
I have been trying out some OpenCv snippets as part of a larger robotics project such as Face Detection and Face Recognition. These have all been working on my MacBook. I am now trying to test out these programs on my Raspberry Pi running Bullseye on a PINN Lite setup. I have been searching, finding and following various guides on how to install OpenCV correctly, but keep running into problems during installation. When I finally get an install working I then get problems importing cv2, either with numpy or pandas. I am now following this guide: enter link description here I am now trying to in ..read more
Visit website
OpenCV - PiCamera or cv2.VideoCapture(0)
Raspberry Pi Stack Exchange Forums » Opencv
by Bill Harvey
6M ago
Quick question, I am starting to work on some Computer Vision programs using my Raspberry Pi 3. I thought when using the PiCamera you needed to use the specific PiCamera commands however I have simply used cv2.VideoCapture(0) and it opens and accesses the Pi Camera anyway. What I am finding though is a massive difference between running the same programs (face detection) on my Mac compared to my Pi 3. On the Pi3 there is loads of lag. So - should I be using the PiCamera commands to capture video, or cv2.VideoCapture(0) and how do I increase the performance? Thanks ..read more
Visit website
Changing Python Code to save video on PC, over socket, instead of Raspberry Pi
Raspberry Pi Stack Exchange Forums » Opencv
by Newbie
6M ago
I am trying to create a project where I use opencv to detect my cat and then send the mp4 to my pc and saves it there. I can set up the socket but am struggling with the python code to send the video to my pc/server and save it there rather than the raspberry pi/client. The camera I am using is the pi camera module 2 connected to a raspberry 4. My code is as below:   import cv2 import time import datetime camera = cv2.VideoCapture(0) feline_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalcatface.xml") feline_extended_cascade = cv2.CascadeClassif ..read more
Visit website
Arducam Refusing to Connect but other Camera works with OpenCV
Raspberry Pi Stack Exchange Forums » Opencv
by fireblazer10
7M ago
I have a problem with my Arducam OV5647 M32076M20. It simply will not work unlike the other generic rpi camera I have on the same code. I am unsure if there are any other dependencies that I need for this. Things to note: vcgencmd get_camera returns supported=1 detected=1, libcamera interfaces=0 I am using OpenCV and tkinter and its basically just a simple program that shows what the camera sees when its turned on. It works on other camera except the one I've shown I have a script that detects camera with cv2 and it returns positive with video0 usually for i in range(10): vid = cv ..read more
Visit website

Follow Raspberry Pi Stack Exchange Forums » Opencv on FeedSpot

Continue with Google
Continue with Apple
OR