Because it was not so obvious, I share the way I just found.
Note that no other programs should control the video bus, thus you might need to stop the autostarting stereopi software suite [for example by stopping everything started in rc.local with "systemctl stop rc-local.service"]
The magic spell is:
EDIT: please remove the -dec option for better results (rational later)
Code: Select all
raspistill -n -t 1 -3d sbs -dec -vf -hf -w 5184 -h 1944 -o image.jpg
-n disable preview [I do not have screen plugged, so I do not know what it is]
-t 1 delays shot by 1ms [without this precision, the default is 5s. Less or equal to zero does not seem to work]
-3d sbs side-by-side output desired
-dec labeled "Half width/height of stereo image", it is necessary to not have the image overly cropped [at least before I added explicit width] EDIT: with image size specified, using this option cause the image to have wrong proportions
-vf -hf flip image vertically and horizontally [My cameras have the white ribbon up]
-w 5184 -h 1944 specify size to get full size images side by side [seems that -dec might be optional in this specific case EDIT: Yes, you better not want to use -dec with size]
-o image.jpg specify image output name
With this command, I get a side-by-side parallel stereo pair.
Man can use it directly on cardboard or other stereoscopic viewer, but it would be better to postprocess, in particular by doing alignment and stereo window placement, for more enjoyable viewing experience.
To avoid changing the command at every shot, man can replace "image.jpg" by "$(date +%Y%m%d_%H%M%S_%N.jpg)" and write it to a script. This ugly riddle creates a file name based on system date (including nanosec) so that a new file is created at each time [except if you go back in time, and thus the probability to overwrite is quite low anyway].
If man wants to use this method (actually writing a specialized program might be a good idea), man can use imagemagick to separate the two views man just got.
20190521_154521_447899386.jpg is the side-by-side image, im0.jpg and im1.jpg are the two synced images separated so that they can be sent to other software to create well processed awesome stereophoto.
Code: Select all
convert -crop 50%x100% 20190521_154521_447899386.jpg im%d.jpg