examples-camera: Coral dev mini opencv error
Hi, I’m testing the examples with coral mini board!
But, I’ve got the error. I can’t execute the opencv examples.
mendel@silly-quill:~/google-coral$ cd examples-camera/
mendel@silly-quill:~/google-coral/examples-camera$ ls
all_models download_models.sh LICENSE opencv raspicam
CONTRIBUTING.md gstreamer nativeapp pygame README.md
mendel@silly-quill:~/google-coral/examples-camera$ cd opencv/
mendel@silly-quill:~/google-coral/examples-camera/opencv$ ls
detect.py install_requirements.sh README.md
mendel@silly-quill:~/google-coral/examples-camera/opencv$ bash install_requirements.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-opencv is already the newest version (3.2.0+dfsg-6).
0 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.
mendel@silly-quill:~/google-coral/examples-camera/opencv$ python3 detect.py
Loading ../all_models/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite with ../all_models/coco_labels.txt labels.
Unable to stop the stream: Invalid argument
The error message is so simple that I cant’ figure out what the problem come from. I need help.
Regards,
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20
I ran into the same issues. I struggled trying to install various versions via pip and finally got it to work by building openCV from scratch. I used the script here for that: https://github.com/milq/milq/blob/master/scripts/bash/install-opencv.sh
Note: There was a file instead of a directory at
/usr/local/share
- I’m not sure where that came from but I had to remove it and make sure there was a/usr/local/share/licenses
directory for themake install
part of the script.WARNING - the build process took me 12+ hours (maybe more since I stopped monitoring it and went to bed). There were a few points where it looked like thought it froze since no progress was reported for more than an hour, but it kept going. Run this locally or use something like screen - my ssh connection broke and I had to start over.
This installed OpenCV 4.5.1. I also had to set the camera index to
1
as @alengcm mentioned.Here is what I ran.
Request for the Coral team: please fix the build in the next Mendel release to avoid this process.
For me it wasn’t as easy and it took me many many many hours to get it finally working. And to make the pain less for future people, here is the right numpy with the right opencv-python-headless wheels for you to install. Just repeating it for the lazy reader what this is:
TO FIX
USE THESE WHEELS:
opencv-python-headless.zip numpy-1.19.5.zip