I have been running some of the experiments from https://github.com/luxonis/depthai-experiments including gen2-deeplab_depth and gen2-calc-spatials-on-host and they were running fine. Previously, the camera output was displayed in a new window that was created after running main.py, but this window isn't opening anymore for some reason. There is no error when I run the script, but I'm able to see the window with the camera feed. I've tried restarting my laptop. I'm not sure what's caused this as the only thing I changed since running the script initially was installing the requirements into a virtual environment and upgrading my pip version. I can't remember what version of pip I had before, but now I have 22.3.1.
Camera Preview No Longer Showing
Hi MatthewGale ,
There is no error when I run the script, but I'm able to see the window with the camera feed.
Could you elaborate on the issue?
Thanks, Erik
- Edited
Hi erik ,
Sure, after cloning the depth-experiments I installed the requirements for the 'gen2-deeplabv3_depth' example, and ran the main.py script. This worked fine, and I was able to see the camera output, and the segmentation output via a seperate popup window that was created after running the script. I then tried to run the 'gen2-calc-spatials-on-host' example, but before doing that I realised the requirements.txt required a different version of the depthai module so I created a virtual environment to install the dependencies into. This made me notice my pip version was outdated so I updated that aswell using 'python3 -m pip install --upgrade pip'. After checking my history, I've noticed that I also ran 'python3 -m pip install --upgrade depthai' for some reason.
Since doing that I can no longer run the 'gen2-deeplabv3_depth' example, and the 'gen2-calc-spatials-on-host' doesn't work either. By not working, I mean that I can hear the camera click when I run the script which implies it can reach the camera, but no popup window with the camera feed is appearing, despite the terminal output being as expected:
'Use WASD keys to move ROI.
Use 'r' and 'f' to change ROI size.'
for 'gen2-calc-spatials-on-host'.
The strange thing is that I haven't modified the example code and my own basic code extracting the RGB and depth data from the camera is running fine.
Hi MatthewGale ,
Are you using latest depthai version? Is the code actually getting to the cv2.imshow()
calls (perhaps add a print('check')
after that). What's the version of opencv-python
library?
Thanks, Erik
Hi erik,
Sorry I've realised my mistake. I forgot my code was running on a docker container so had a different version opencv and the depthai libraries. Even though i did install the requirements on my local machine. I have depthai 2.19.1.0 and opencv-contrib-python 4.6.0.66 on my docker container, and opencv-contrib-python 4.5.5.62, opencv-python 4.7.0.68, depthai-sdk 1.9.1.1, depthai 2.16.0.0 on my local machine.
Thanks for the help
Hi MatthewGale ,
That's a bit different issue - I am not very familiar with how docker/opencv work under the hood, perhaps it would be best to ask google for that, eg. stackoverflow answer here.
Thanks, Erik