Questions tagged [opencv]
Open Source Computer Vision Library, real time computer vision
390 questions
0
votes
1
answer
20
views
OpenCV: pixel-accurate rendering
I'm having this code on my Raspberry Pi5:
import cv2
import numpy as np
box_size = (640, 480)
spacing = 1
num_rectangles = 4
window_width = 640
window_height = 1200
frame = np.ones((window_height, ...
0
votes
1
answer
48
views
Can't install OpenCV on my Raspberry Pi
I am an absolute noob at this since I started recently. I am installing OpenCV for Tensorflow for a project. How To Run TensorFlow Lite on Raspberry Pi for Object Detection is the video i am using. I ...
0
votes
0
answers
20
views
Sending Drone Object Location via XBee with Raspberry Pi and GPS
I’m working on a project where I have a drone that have a Raspberry Pi equipped with a camera, GPS and XBee modules. right now I’m making the drone get the location of an object when it recognize one ...
0
votes
0
answers
62
views
OpenCV AruCo detection fails: "Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory."
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 ...
0
votes
0
answers
157
views
Pi4 python OpenCV timeout
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 ...
0
votes
0
answers
32
views
RPi 5 Code Does Not Work Without Root
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 ...
0
votes
1
answer
119
views
I cannot install OpenCV on RaspberryPy
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 ...
-1
votes
2
answers
1k
views
on bookworm cant use picamera2 with opencv-python
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 ...
1
vote
0
answers
82
views
How do I directly process live raw camera data on the GPU without it passing though the CPU?
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 ...
0
votes
0
answers
232
views
OpenCV Pandas and Numpy
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 ...
0
votes
2
answers
267
views
Error Trying to Install Precompiled OpenCV 4.8 on Raspberry Pi 4 64Bit
I was recently shown a method to install a precompiled version of OpenCV from the following link: Install Precompiled OpenCV 4.8 on Raspberry Pi
When I run the command sudo apt install -y ./opencv_64....
1
vote
1
answer
456
views
PiCamera2 images with boxes and labels overlay with vis_util
I'm trying to get integrate tensorflow and picamera2 to do some basic object detection.
The logic works out fine (I think), but I'm struggling to draw the boxes/labels deduced on top of the image.
...
0
votes
0
answers
337
views
Very low fps when using Opencv
Relatively recently I started writing a project in which faces are detected through raspicam in python using opencv, but the result disappoints me, I get literally 5 fps, but if you remove face ...
0
votes
1
answer
146
views
Open CV threading to get frames
I am working on a project for which I need run 3 threads in python. 1 for getting frames and the other 2 for proccessing them. I don't know how to pass variables between threads (I want to pass frames ...
0
votes
1
answer
292
views
OpenCV issue - cv2image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
I am curently trying to run the code below, which feeds a live stream to a tkinter gui:
from tkinter import *
from PIL import ImageTk, Image
import cv2
root = Tk()
# Create a frame
app = Frame(root, ...
-1
votes
2
answers
1k
views
ImportError: cannot import name 'ControlType' from 'libcamera' (unknown location)
I'm relatively new to Raspberry Pi and I am having trouble running a python code on raspberry pi. The code I'm trying to run is as shown below:
import cv2
from picamera.array import PiRGBArray
from ...
0
votes
0
answers
144
views
compile and install opencv on raspberry pi 3 model B
i'm facing a problem while i'm installing opencv version 3.1.0 and python 3 ...
I followed the steps from here : https://pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-...
0
votes
0
answers
63
views
Raspberry Pi downaload of CV2 gone wrong
I have installed the CV2 library on my raspberry pi 4, but when I proceeded to import it I got this error:
ImportError: libjasper.so.1: cannot open shared object file: No such file or directory
I ...
-1
votes
1
answer
375
views
How to detect the position and rotation of objects in Python?
I'm building a robot that needs to detect the position and rotation of multiple trained objects from a single image. For this I'm using my Raspberry Pi 3B with Raspberry OS 64-Bit.
I tried Localizer ...
1
vote
2
answers
3k
views
Can't install Opencv on raspberry pi 4
I'm using the raspberry pi 4 (pip version: pip 22.3.1, python version: 3.9.2) on visual studio code and whenever I enter the command pip install opencv-python in the terminal, after 40 mins I get the ...
2
votes
1
answer
787
views
Raspberry Pi 4 Python not finding installed libraries
I trying to connect an OpenCV OAK-D to an R Pi 4B.
I've downloaded & installed all the requirements & installed the depthai library using pip
To check its there,
pip3 list | grep depthai
...
0
votes
0
answers
98
views
raspberry pi 4b, python, opencv, When trying to process video frames the instructions do not run sequentially
I have a problem when executing the programme below, So basically what's happening is when I execute the programme I expect it to open the camera (logitec usb camera) capture a frame, process it, ...
1
vote
0
answers
588
views
Raspberry Pi and OpenCV. The cv2.error while capture the image through camera lens
https://stackoverflow.com/questions/43572387/error-215-size-width0-size-height0-occurred-when-attempting-to-display-a
I have the similar issue with this discussion, after I read it still don't have ...
1
vote
1
answer
2k
views
Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly
I'm trying to install opencv on a raspberryPI 4 (RaspberryPI OS Bullseye x64, Python 9), that is part of installing all the dependencies for this tutorial but it always fails with the error below.
I ...
0
votes
2
answers
486
views
python cv2 module not found when triggered by crontab
My python script imports cv2, and it works fine when I start the script manually.
If I set the script to launch on boot (either via crontab, or via a .desktop file (in the user/.config/autostart/...
1
vote
0
answers
336
views
rpc failed, curl 56 GnuTLSrecv error (-54)
Hi guys my goal is to create an opencv directory and clone opencv and opencv_contrib on a raspberry pi this is why I entered the following command:
pi@raspberrypi:~/opencv $ git clone https://github....
0
votes
0
answers
177
views
OpenCV is getting slow in Raspberry pi 4, 8gb
Here is have made a project attendance system, for which I have trained a model and used the .h5 file to make the real time Prediction using opencv.
so if the person face is detected then his name and ...
0
votes
0
answers
632
views
Can I use the PI Camera Stream in Python on a PC and use OPENCV?
So I got a Raspberry Pi with the Pi camera and I would like to use the camera with OpenCV in Python. The problem is, I know I can do this easily on the Pi itself but I highly doubt the Pi will be able ...
0
votes
1
answer
144
views
Can a raspberry pi get the video feed of another through a NFS server between the two?
For my project, I need to get the feed (preferably simultaneousely) of 2 pi cameras (one on each pi 4).
As of now, both are communicating through ssh over wifi. It's very slow, not reliable and very ...
1
vote
1
answer
2k
views
reading two webcams in opencv
If I run this code on a PC with two webcams attached it runs fast (or fast enough) without any issues:
import cv2
cap0 = cv2.VideoCapture(0)
cap1 = cv2.VideoCapture(1)
while True:
ret0, img0 = ...
1
vote
0
answers
1k
views
Problem using OpenCV and Raspberry PI camera V2
I had been using the following code for the past two months with no problem whatsoever, however, just yesterday I have been getting errors using the code which I will detail as follows. The code in ...
-1
votes
1
answer
107
views
Rainbow screen on boot when camera plugged in
I bought my Rpi 4B, 4 months ago with an official Pi camera v2.1.
Everything was working fine but now, I can't seem to receive frames with openCvpython library.
import cv2
cap = cv2.VideoCapture(0)
...
0
votes
1
answer
288
views
Segmentation fault running Python/C++ OpenCV executables (package DVR-Scan)
I use DVR-Scan 1.0.1 [1] for video surveillance (scan video files got from an IP camera) under a Raspbian GNU/Linux 8.0 (jessie) system on a Raspberry Pi 3 model B. DVR-Scan depends on Python and ...
0
votes
1
answer
294
views
receiving RTP stream on RPi
Need to receive RTP stream with lowest possible latency and CPU load. I need to always read the latest frame, that is, as if I had a buffer equal to 1. What is the best way? I need it to be possible ...
0
votes
0
answers
412
views
Random disconnection of an USB Camera with Raspberry Pi 4
I've got a Raspberry Pi 4 with an USB2.0 camera connected through a slip ring. When I boot, there's no problem at all, but sometimes the Raspberry is unable to detect the camera while streaming (I'm ...
0
votes
1
answer
175
views
Viewing the captured content of the webcam live
How can I view the captured content of my webcam on Linux/Raspberry?
I dont want to share it, only view the content live on my monitor.
On windows Logitech has an official program where I can preview ...
0
votes
2
answers
2k
views
WARN:0 global /tmp/pip-wheel-2c57.../opencv/.../cap_v4l.cpp (890) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
When switching from the legacy camera stack under Raspberry Pi OS with debian 10 to the new libcamera camera stack (in Raspberry Pi OS with debian 11 it is standard), I cannot use OpenCV any longer.
...
0
votes
0
answers
40
views
How to Capture Only Subimage from Rasperry Pi Camera?
I am new to OpenCV and Raspberry Pi. I want to increase the frame rate on the camera (preferably > 300 fps), but I don't need the full image. Instead of sending back the full azimuth and elevation ...
0
votes
1
answer
1k
views
how to increase fps of yolov3 on raspberry pi 4
I'm currently doing real time object detection with the help of pi camera using pre-defined weights of darknet and coco dataset using openCV. Currently I'm getting 0.14 fps and my video is too much ...
2
votes
0
answers
191
views
Green frames when capturing webcam
We use RPI4 for automation. One of our use-cases is to capture image frames via webcam/HDMI grabber as fast as possible and do some analytics. We use python and opencv for capturing, but it's not ...
0
votes
1
answer
1k
views
ImportError: librsvg-2.so.2: cannot open shared object file: No such file or directory
I am having issues with the rsvg2 library which is a dependency of ffmpeg and opencv.
I have installed ffmpeg using the standard sudo apt install ffmpeg and Python-opencv with pip install opencv-...
-1
votes
2
answers
218
views
compile a c++ app on ubuntu and run it on raspberry pi
I'm on an opencv project that need to be deployed on rpi 4. I do prefer to reach this project development, testing a compiling on other device (lets say a labtop).
My question which OS is compatible ...
0
votes
2
answers
2k
views
Error for installing the OpenCV on raspberry (Command "python setup.py egg_info" failed ...)
Based of this post, I have tried to install the below package at first step:
sudo apt-get update && sudo apt-get upgrade
sudo apt install cmake pkg-config build-essential git
sudo apt install ...
0
votes
1
answer
509
views
build opencv for java on rpi4
I'm trying to build OpencCV for Java on raspberry pi 4B. I am quite new in this sphere and do not understand almost everything. At first, I just wanted to unload my .jar file to the raspberry and run ...
0
votes
1
answer
10k
views
CMake Error: The source directory "/home/pi" does not appear to contain CMakeLists.txt [closed]
Can someone please tell me what I have to? I'm trying to setup my build using CMake. My code and its' error is the following. How do I make CMakeLists?
(cv) pi@raspberrypi:~/build $ cmake -D ...
-1
votes
1
answer
169
views
OpenCV not working when ran with sudo
I have an application that uses OpenCV, and now want it to also access GPIO pins, so it needs to run as sudo. So, I tried to run it using "sudo python3 myapp.py"
When I do I get the ...
1
vote
1
answer
171
views
OpenCV can't capture frames on production server (Nginx + uWSGI) on Raspberry Pi 4
I'm building a production server on Raspberry Pi 4. Web app is written in Django. I used uWSGI as an application server and Nginx as a reverse proxy. I followed many tips from Digital Ocean.
One of ...
0
votes
0
answers
42
views
Calculate the motion of a simple object in 3d
I'm a beginner in python and raspberry pi and for a school project which is due this month, we're using a raspberry pi 3 and a camera module (fixed) and the idea is when u move something in the camera ...
0
votes
1
answer
706
views
PiCamera V2 NoIR and AMG8833 thermal sensor mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
Hardware used: Raspberry pi 4b, 4 gb ram, AMG8833 thermal camera, PiCamera V2 noir, ALL brand new, i just bought them few weeks ago.
Im trying to do finish a project and i ran into a not that good ...
0
votes
0
answers
761
views
OpenCV image processing incredibly slow on Pi 3B+
I have a computer vision algorithm on my Pi 3B+ that uses the following function, myVision(), that takes in a frame and outputs the pixel coordinates of a certain colored dot (tuned according to the ...