Left and Right Cameras Reversed

StereoPi hardware discussion
Post Reply
User avatar
rlhelinski
Posts: 9
Joined: Sat May 25, 2019 9:46 pm

Left and Right Cameras Reversed

Post 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
Attachments
Screenshot_2019-06-03 StereoPi 10 0 0 84.jpg
Screenshot_2019-06-03 StereoPi 10 0 0 84.jpg (424.23 KiB) Viewed 3253 times

User avatar
Realizator
Site Admin
Posts: 534
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Left and Right Cameras Reversed

Post 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.
Eugene a.k.a. Realizator

User avatar
rlhelinski
Posts: 9
Joined: Sat May 25, 2019 9:46 pm

Re: Left and Right Cameras Reversed

Post 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!

User avatar
Realizator
Site Admin
Posts: 534
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Left and Right Cameras Reversed

Post 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.
Eugene a.k.a. Realizator

bensailor
Posts: 14
Joined: Thu Mar 05, 2020 9:46 pm

Re: Left and Right Cameras Reversed

Post by bensailor »

I have the same issue, however with a Rasbian image. Is there a solution using the Rasbian image?

stereomaton
Posts: 161
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Left and Right Cameras Reversed

Post 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.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi Standard Edition + CM3Lite module + a few cameras

bensailor
Posts: 14
Joined: Thu Mar 05, 2020 9:46 pm

Re: Left and Right Cameras Reversed

Post by bensailor »

Thanks I will try this out

User avatar
Realizator
Site Admin
Posts: 534
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Left and Right Cameras Reversed

Post 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).
Eugene a.k.a. Realizator

bensailor
Posts: 14
Joined: Thu Mar 05, 2020 9:46 pm

Re: Left and Right Cameras Reversed

Post 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?

User avatar
Realizator
Site Admin
Posts: 534
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Left and Right Cameras Reversed

Post 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.
Eugene a.k.a. Realizator

Post Reply