can't run tutorial example... what did I miss?
Posted: Sat Jun 01, 2019 5:50 am
New stereopi user here - just started today so this is likely a newbie problem...
Hooked up StereoPi with 4Gb CM module. Using the pre-installed Rasbian that came with CM module, not the SLP image.
(still downloading, I have a pretty slow internet connection)
Updated, upgraded, and rpi-upgraded.
Installed omxplayer and fbi.
Installed dt-blob.bin, tested both cameras work, can record and view stereo images - both stills and video.
sudo apt-get install python-picamera python3-picamera
sudo apt install python-opencv
wget https://github.com/realizator/stereopi- ... master.zip
unzip master.zip; mv stereopi-tutorial-master stereopi-tutorial
Can't run the tutorial example under python3:
pi@stereopi:~/stereopi-tutorial $ python3 1_test.py
Traceback (most recent call last):
File "1_test.py", line 29, in <module>
import cv2
ImportError: No module named 'cv2'
And when I try to run the first example in the tutorial under 'python' this happens:
pi@stereopi:~/stereopi-tutorial $ python 1_test.py
Used camera resolution: 1280 x 480
Scaled image resolution: 640 x 240
Traceback (most recent call last):
File "1_test.py", line 67, in <module>
for frame in camera.capture_continuous(capture, format="bgra", use_video_port=True, resize=(img_width,img_height)):
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 1701, in capture_continuous
encoder.start(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 1166, in start
super(PiRawImageMixin, self).start(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 375, in start
self._open_output(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 331, in _open_output
self.outputs[key] = mo.open_stream(output)
File "/usr/lib/python2.7/dist-packages/picamera/mmalobj.py", line 354, in open_stream
stream = BufferIO(stream)
File "/usr/lib/python2.7/dist-packages/picamera/streams.py", line 71, in __init__
'buffer object must be one-dimensional and have unsigned '
ValueError: buffer object must be one-dimensional and have unsigned byte format ("B")
I also tried these commands after this happened in case I had installed picamera the wrong way.
sudo apt-get install python-pip
pip install StereoVision
pip install picamera
sudo apt-get install python3-pip
pip3 install picamera
pip3 install StereoVision
- didn't make any difference to running 1_test.py
I guess I could take a month to learn python and debug the problem, but it would be a lot simpler
if someone could spot a version conflict and show me how to install a working environment...
(Bear in mind in your replies, I'm not a python programmer and don't know my way around the python environment.)
thanks,
G
Hooked up StereoPi with 4Gb CM module. Using the pre-installed Rasbian that came with CM module, not the SLP image.
(still downloading, I have a pretty slow internet connection)
Updated, upgraded, and rpi-upgraded.
Installed omxplayer and fbi.
Installed dt-blob.bin, tested both cameras work, can record and view stereo images - both stills and video.
sudo apt-get install python-picamera python3-picamera
sudo apt install python-opencv
wget https://github.com/realizator/stereopi- ... master.zip
unzip master.zip; mv stereopi-tutorial-master stereopi-tutorial
Can't run the tutorial example under python3:
pi@stereopi:~/stereopi-tutorial $ python3 1_test.py
Traceback (most recent call last):
File "1_test.py", line 29, in <module>
import cv2
ImportError: No module named 'cv2'
And when I try to run the first example in the tutorial under 'python' this happens:
pi@stereopi:~/stereopi-tutorial $ python 1_test.py
Used camera resolution: 1280 x 480
Scaled image resolution: 640 x 240
Traceback (most recent call last):
File "1_test.py", line 67, in <module>
for frame in camera.capture_continuous(capture, format="bgra", use_video_port=True, resize=(img_width,img_height)):
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 1701, in capture_continuous
encoder.start(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 1166, in start
super(PiRawImageMixin, self).start(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 375, in start
self._open_output(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 331, in _open_output
self.outputs[key] = mo.open_stream(output)
File "/usr/lib/python2.7/dist-packages/picamera/mmalobj.py", line 354, in open_stream
stream = BufferIO(stream)
File "/usr/lib/python2.7/dist-packages/picamera/streams.py", line 71, in __init__
'buffer object must be one-dimensional and have unsigned '
ValueError: buffer object must be one-dimensional and have unsigned byte format ("B")
I also tried these commands after this happened in case I had installed picamera the wrong way.
sudo apt-get install python-pip
pip install StereoVision
pip install picamera
sudo apt-get install python3-pip
pip3 install picamera
pip3 install StereoVision
- didn't make any difference to running 1_test.py
I guess I could take a month to learn python and debug the problem, but it would be a lot simpler
if someone could spot a version conflict and show me how to install a working environment...
(Bear in mind in your replies, I'm not a python programmer and don't know my way around the python environment.)
thanks,
G