uutzinger / camera

Python interface to Jetson Nano, Raspberry Pi, USB, internal and blackfly camera
MIT License
32 stars 8 forks source link

No module named 'PySpin' & can't open camera by index #2

Open theofila opened 2 years ago

theofila commented 2 years ago

Hey, I have two different type of issues. the first issue is, when I try to run python3 blackfly_display.py I get the following error: Traceback (most recent call last): File "blackfly_display.py", line 61, in <module> from camera.capture.blackflycapture import blackflyCapture File "/home/theofila/.local/lib/python3.6/site-packages/camera/capture/blackflycapture.py", line 23, in <module> import PySpin ModuleNotFoundError: No module named 'PySpin'

I am using ubuntu18.04 I don't know how to fix it.. I have SpinnView installed and I can open the camera with the Software I downloaded from the FLIR website..

My second Issue is that when I try to run: python3 capture_display.py I get : [ WARN:0@0.059] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video0): can't open camera by index [ WARN:0@0.059] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video1): can't open camera by index [ WARN:0@0.059] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video2): can't open camera by index [ WARN:0@0.059] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video3): can't open camera by index [ WARN:0@0.059] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video4): can't open camera by index [ WARN:0@0.135] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video0): can't open camera by index INFO:CV2Capture:Getting Images ^CTraceback (most recent call last): File "capture_display.py", line 134, in <module> (frame_time, frame) = camera.capture.get(block=True, timeout=None) File "/usr/lib/python3.6/queue.py", line 164, in get self.not_empty.wait() File "/usr/lib/python3.6/threading.py", line 295, in wait waiter.acquire() KeyboardInterrupt terminate called without an active exception Aborted (core dumped)

What can be the problem here? Ok it's clear, my camera is not recognized as a /dev/vid* but why?

uutzinger commented 2 years ago

Likely you did not install the python bindings for the blackfly camera which you would need to download from the same place as where the spinview software is located. Unfortunately latest version of python that is supported is 3.8. python binding are not available for newer python version. You can install this on any computer with built-in camera or USB camera and try to view the camera with capture display.py. blackfly camera can not be viewed with regular capturedisplay and needs the blackfly* python programs. When you have blackfly camera open in spinview you can not open it with an other program as it is in use.