Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include RPi cameras #34

Open
roaldarbol opened this issue Dec 5, 2022 · 3 comments · May be fixed by #36
Open

Include RPi cameras #34

roaldarbol opened this issue Dec 5, 2022 · 3 comments · May be fixed by #36
Assignees
Labels
enhancement New feature or request high priority

Comments

@roaldarbol
Copy link
Owner

When working on a RPi, the CSI camera is not discoverable by OpenCV (libcamera support is an open issue). Instead, use picamera2 when the OS is Raspberry Pi OS. Append as the last camera.

@roaldarbol roaldarbol self-assigned this Dec 7, 2022
@roaldarbol roaldarbol linked a pull request Dec 7, 2022 that will close this issue
@roaldarbol roaldarbol added enhancement New feature or request high priority labels Dec 7, 2022
@roaldarbol
Copy link
Owner Author

roaldarbol commented Dec 7, 2022

A current libcamera/picamera2 issue makes libcamera inaccessible to virtual environments, and little progress can be made here until that is resolved. The current work-around will be to use the legacy camera interface and make the CSI camera discoverable by OpenCV. However, this doesn't work with HQ Cameras (or at least with the Arducam HQ IR camera), so a better stable solution is required.

For now:

# Install OpenCV dependencies
sudo apt-get install build-essential cmake pkg-config libjpeg-dev libtiff5-dev libjasper-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libfontconfig1-dev libcairo2-dev libgdk-pixbuf2.0-dev libpango1.0-dev libgtk2.0-dev libgtk-3-dev libatlas-base-dev gfortran libhdf5-dev libhdf5-serial-dev libhdf5-103 python3-pyqt5 python3-dev -y

# Maybe works to remove "select() timeout" error, see https://forums.raspberrypi.com/viewtopic.php?t=35689
rmmod uvcvideo 
sudo modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80

sudo raspi-config # >> 3 Interface Options > I1 Enable legacy camera support
sudo modprobe bcm2835-v4l2

@roaldarbol
Copy link
Owner Author

Can confirm that the work-around indeed does work on a fresh installation.

@roaldarbol
Copy link
Owner Author

Test virtualenvs.options.system-site-packages = true in the Poetry venv and see if that gives access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant