MIPI_Camera icon indicating copy to clipboard operation
MIPI_Camera copied to clipboard

stereo_depth_demo: ./scenes not created/written

Open arnolde opened this issue 3 years ago • 1 comments

I am trying to follow this tutorial: https://www.arducam.com/docs/cameras-for-raspberry-pi/synchronized-stereo-camera-hat/opencv-and-depth-map-on-arducam-stereo-camera-hat-tutorial/

I have a Raspi4B/8GB with RaspiOS Bullseye 32bit and the 8MP stereo camera kit (UG-512 and UC-506).

Running 1_test.py works (apart from the picture being much too dark, although adding "camera.software_auto_exposure(enable = True)" helped - I found lots of people having this problem too, but no clear solution).

Running 2_chess_cycle.py seems to work without errors. But after completion, I cannot find any images anywhere, and 3_pairs_cut.py doesn't find any, either.

The scripts are all run from ~/MIPI_Camera/RPI/stereo_depth_demo$

The MIPI git was cloned today.

The images displayed by these scripts are upside down, by the way. I cannot run raspistill or arducamstill because I'm working on a headless Raspi via SSH. The above scripts open windows on my client machine (Ubuntu 18) via Xforwarding. I had VNC working for a while, then it stopped working when I switched from libcamera to legacy camera drivers, so I currently don't have that option until I fix that again.

pi@roverpi:~/MIPI_Camera/RPI/stereo_depth_demo $ python3 2_chess_cycle.py 
Open camera...
Found sensor imx219 at address 10
mmal: Failed to fix lens shading, use the default mode!
Current mode: 2,resolution: 1600x1200
Used camera resolution: 1600 x 1200
Scaled image resolution: 1280 x 480
Starting photo sequence
 [1 of 30] ./scenes/scene_1280x480_1.png
 [2 of 30] ./scenes/scene_1280x480_2.png
 [3 of 30] ./scenes/scene_1280x480_3.png
[...]
 [30 of 30] ./scenes/scene_1280x480_30.png
Photo sequence finished
pi@roverpi:~/MIPI_Camera/RPI/stereo_depth_demo $ python3 3_pairs_cut.py 
No file named ./scenes/scene_1280x480_1.png
No file named ./scenes/scene_1280x480_2.png
No file named ./scenes/scene_1280x480_3.png
[...]

arnolde avatar Jan 16 '22 00:01 arnolde

What worked for me is manually creating the /scenes folder under /MIPI_Camera/RPI/stereo_depth_demo. The fact that the images are upside down is annoying, but hopefully isn't too bad to fix through physical or coded methods. It seems like the community on this project isn't very active though.

kevinshao7 avatar Feb 13 '22 18:02 kevinshao7