Page 1 of 1

Left and Right Cameras Reversed

Posted: Tue Jun 04, 2019 12:42 am
by rlhelinski
Hello. The StereoPi is working well, but I think my left and right images are reversed (backwards). See attached screenshot.

I do not have my cables crossed. The cameras are basically directly over the connectors. Did I do something wrong? I do not see an option for reversing the order of the two images in the stereopi.conf file or in the admin area on the web app.

Some help would be awesome! Thanks

Re: Left and Right Cameras Reversed

Posted: Tue Jun 04, 2019 8:33 am
by Realizator
Hi Rlhelsinki,
We'll add this option in our next SLP update. Now you can use the solution I mentioned here.
1. "Camera" icon actually runs this script:
/var/www/make_photo.php
2. Find row containing raspistill -3d sbs -o
3. Add "-cs 1" right after "raspistill", so you have:
raspistill -cs 1 ...

My final capture row looks like this:
shell_exec('raspistill -n -t 500 -vf -hf -3d sbs -o ' . $path.$filename);

You may notice I'm not using "-cs 1" here, as hf and vf (horizontal and vertical flips) do right job.

Re: Left and Right Cameras Reversed

Posted: Wed Jun 05, 2019 5:11 am
by rlhelinski
Apparently, I have an old version of the StereoPi software (version 0.1.8) in the SLP image (slp-raspbian-190301.img.zip) that I downloaded. I don't have a camera icon or a file at '/var/www/make_photo.php'. However, I did find the file '/opt/StereoPi/scripts/video-source.sh' and I added '-cs 1' after './bin/raspivid' on the 2 lines near the end of the file. That fixed my reversedness. I searched the forums and wiki for this issue, but I did not try the keyword "swap".

I will try the 'stereopi-0.2.2.tar.gz' mentioned in those instructions soon. I look forward to the next version of the SLP image.

Thanks again!

Re: Left and Right Cameras Reversed

Posted: Fri Jun 14, 2019 7:11 am
by Realizator
Rhelsinki, new S.L.P. release is ready. You can either install 0.2.3 update, or download full image. All links in the Wiki are updated now.

Re: Left and Right Cameras Reversed

Posted: Thu Mar 05, 2020 9:49 pm
by bensailor
I have the same issue, however with a Rasbian image. Is there a solution using the Rasbian image?

Re: Left and Right Cameras Reversed

Posted: Fri Mar 06, 2020 8:18 am
by stereomaton
The left and right cameras depends on how you bend the ribbons, even without crossing them.
Changing the primary camera (-cs 1) or mirroring the images (-vf -hf) are two valid options you can use also on raspbian flavor as soon as you use raspistill or raspivid.

Re: Left and Right Cameras Reversed

Posted: Fri Mar 06, 2020 9:48 am
by bensailor
Thanks I will try this out

Re: Left and Right Cameras Reversed

Posted: Fri Mar 06, 2020 12:03 pm
by Realizator
Hi Bensailor,
Stereomaton is right. Try to add "-cs 1" to your raspivid or raspistill options for 3d capture. Or use "-hf" (horizontal flip), which will flip horizontally each image in the stereopair.
Important: you need to keep these swap/flip settings in all your scripts (from 1 up to 7).

Re: Left and Right Cameras Reversed

Posted: Fri Mar 06, 2020 1:55 pm
by bensailor
I managed to do the swapping, by putting cameras other way up and then Hflip and Vflip.

However if i wanted to change primary camera in the PiCamera library would this be a raspistill -cs1 switch in the bin file?

Re: Left and Right Cameras Reversed

Posted: Fri Mar 06, 2020 2:23 pm
by Realizator
In the PiCamera I prefer to use flip, but not camera selection mode. We use -cs in a bash with the raspivid or raspistill.
Also in the PiCamera you can just rename left and right images after cutting your image to the left and right. This is the most quick and controllable approach.