Hello everyone,
I have a problem.
I get this error when running 1_test.py in tutorial;
ValueError : buffer object must be one-dimensional and have unsigned byte format ("B").
"raspistill -cs 0" - OK
"raspistill -cs 1" - OK
Can you help me?
Thanks.
ValueError : buffer object must be one-dimensional and have unsigned byte format ("B").
- Realizator
- Site Admin
- Posts: 900
- Joined: Tue Apr 16, 2019 9:23 am
- Contact:
Re: ValueError : buffer object must be one-dimensional and have unsigned byte format ("B").
Hi Megil,
As a rule, such an errors appears if you're installing our tutorial scripts on a Raspbian with a newer Python or OpenCV version.
Solutions:
1. [recommended] Use the latest code and Raspbian image. This is Buster-based image and a code from this repo: https://github.com/realizator/stereopi-fisheye-robot
You can find downloads link in this repository description file.
(JFYI: This is updated version of older "https://github.com/realizator/stereopi-tutorial" code)
2. You can use previous code https://github.com/realizator/stereopi-tutorial and appropriate Stretch image
3. If you're advanced user, you can prepare appropriate Raspbian image by installing OpenCV as mentioned in this guide.
UPD> According to your another post on our forum, I can suggest you're using Ubuntu Mate. In this case it is better to follow step 3.
As a rule, such an errors appears if you're installing our tutorial scripts on a Raspbian with a newer Python or OpenCV version.
Solutions:
1. [recommended] Use the latest code and Raspbian image. This is Buster-based image and a code from this repo: https://github.com/realizator/stereopi-fisheye-robot
You can find downloads link in this repository description file.
(JFYI: This is updated version of older "https://github.com/realizator/stereopi-tutorial" code)
2. You can use previous code https://github.com/realizator/stereopi-tutorial and appropriate Stretch image
3. If you're advanced user, you can prepare appropriate Raspbian image by installing OpenCV as mentioned in this guide.
UPD> According to your another post on our forum, I can suggest you're using Ubuntu Mate. In this case it is better to follow step 3.
Eugene a.k.a. Realizator
Re: ValueError : buffer object must be one-dimensional and have unsigned byte format ("B").
I'm using Ubuntu-Mate.
The codes I use are the latest in your github repository.
The codes I use are the latest in your github repository.
- Realizator
- Site Admin
- Posts: 900
- Joined: Tue Apr 16, 2019 9:23 am
- Contact:
Re: ValueError : buffer object must be one-dimensional and have unsigned byte format ("B").
Okay.
1. Which repository you're using now?
2. For our python codes you need to use python3. In our image we've tuned system, so running "python 1_test.py" actually runs python3, that is "python3 1_test.py". Have you tried to run "python3" instead of "python"?
Eugene a.k.a. Realizator
Re: ValueError : buffer object must be one-dimensional and have unsigned byte format ("B").
I tried it with python3 but it didn't work.
I think I have a bug related to numpy, I used PiRGBArray instead of numpy. I solved the problem.
Thanks.
I think I have a bug related to numpy, I used PiRGBArray instead of numpy. I solved the problem.
Thanks.
- Realizator
- Site Admin
- Posts: 900
- Joined: Tue Apr 16, 2019 9:23 am
- Contact:
Re: ValueError : buffer object must be one-dimensional and have unsigned byte format ("B").
It's great that you've solved your issue!
Eugene a.k.a. Realizator