Page 2 of 2

Re: Set max resolution

Posted: Wed Jul 01, 2020 5:25 pm
by pascalfust
Good to hear - congrats and lot of success with your project

Re: Set max resolution

Posted: Thu Jul 09, 2020 4:52 pm
It seems I've hit another issue with the full resolution. I have tried collecting images for the chess board calibration. I modified the 1_tmp.py script (see code below) to take successive images like in the second script of the tutorial (collecting the chess board images). The script works for a seemingly random number of images and then stops responding (i.e. Ctrl + C doesn't work) but appears to remain powered (LEDs still on, no connection lost on SSH). Is this a known bug and is there a work around? Is there a chance I'm hitting a hardware limitation like overheating?

I think my frame rate is very low 1 frame every ~7 seconds.

Hardware configuration:
-2x V2 camera module
-RPi 8Gb 3+ Compute module
- Power through pins
- Connection and operation through Ethernet cable with SSH

Code: Select all

import picamera
from picamera import PiCamera
import time
import cv2
import numpy as np
import os

# Camera settimgs
cam_width = 5184
cam_height = 1944

# Initialize the camera
camera = PiCamera(stereo_mode='side-by-side',stereo_decimate=False)
camera.resolution=(cam_width, cam_height)
camera.hflip = True

time.sleep (2)
print("starting....")
for i in range(30):
    print( "Image No. " + str(i))
    for t in range(5):
        print(str(5-t))
        time.sleep(1)
    print('Cheese!')
    
    filename = "./calibData/chess_"+str(i)+"_"+str(cam_width)+"x"+str(cam_height)+".jpg"
    time.sleep(2)
    camera.capture (filename)

Re: Set max resolution

Posted: Thu Jul 09, 2020 6:48 pm
by pascalfust
Without checking your code, I can confirm that I experienced similar issues. As you described, I experienced regularly freezing of the compute module with a camera seemingly active (LED lit). One distince difference to your case is, that I pushed the frame rate up as much as I could. However, I acknowledge similar issues at lower frame rates as well.
I tried with high speed SD cards (which proved efficient in other embedded solutions), but couldn't fix it. I furthermore installed a heat sink and a fan without any significant improvement.
As I am looking for a reliable solution, I (unfortunately) had to switch to a Jetson Nano based approach. While consuming a bit more power, it proved more reliable, and even allowed parallel capture of highest resolution pics through two Raspberry Pi camera modules (V2) including GPS reading at frame rates of 3-5 fps.

Sorry for not providing a (better) solution for that problem...

Re: Set max resolution

Posted: Thu Jul 09, 2020 8:56 pm
by Realizator
A few days ago I did a solution for the calibration of the FullHD images (3840x1088) with a couple of new HQ cameras. I used video mode capture and did a 3x scaling down of captured images for the preview window. I used 10 fps, it works fine, but a recording of the image takes some time. The average file size was 6Mb (as I used PNG for the lossless compression, instead of JPG). JPG is encoded by GPU, but PNG is by the main ARM kernel. I also increased GPU memory to 384 Mb in config.txt

Jlurban, I will try to test your code for a full-resolution solution on my setup (tomorrow or the day after tomorrow).

Pascalfaust, the best tool is the tool that fits your needs! Jetson Nano is a powerful thing, and it is bigger in all aspects (size, power consumption, and computational power). To say the truth, I did not expect that StereoPi will be used for capturing of stereoscopic image series at the sensor's full resolutions. So your and Jlurban's posts here really surprised me! :-)

Re: Set max resolution

Posted: Thu Jul 09, 2020 9:07 pm
by pascalfust
Hi Eugene,
to be honest, I am "misusing" the StereoPi in a certain way, as I primarily want to capture still pictures with two cameras at frames rate of min 1fps. As such, I am not running after stereoscopic analyses but "simple" continuous, full resolution capture (without preview) of pics with two cameras.
As such, I wouldn't dare to state that the StereoPi is showing design flaws, just probably not adapted to my specific requirements.

Interesting to hear about the application of the new Raspberry HQ cameras. Keep me updated about your results, as I've got also two waiting here, currently :-)

Re: Set max resolution

Posted: Thu Jul 09, 2020 9:26 pm
by Realizator
Pascalfaust, I put some photos of my current idea in this tweet. Will test the new revision of this HQ housing in a few days :-)

Re: Set max resolution

Posted: Mon Jul 13, 2020 1:45 am
I think for now I will just lower the resolution.

If there is a way to get full resolution I'd definitely be interested, but I realize that I am probably misusing the stereopi too. If there is way for this to work with the stereopi that would be awesome. I'll look into the Jetson Nano for later, but right now I think I can get by without the full resolution for a bit.

Either way, still very happy with the stereopi! It is a lot of fun to work with and I'm excited to try out some new projects with it including the HQ cameras. The pictures on twitter looks awesome Eugene!

Re: Set max resolution

Posted: Wed Dec 15, 2021 10:57 pm
by reds71
Hi,

I tried the stereoPi v2 with two V2 cameras, using sensor_mode '2' (3280x2464) 2fps with 512Mb of GPU mem, the camera.py fixes and I get :
"picamera.exc.PiCameraMMALError: Failed to enable component: Out of resources". BTW, raspistill works fine...

Did I hit a hard limit? Is https://github.com/waveform80/picamera/issues/608 being still open meaning that the RPi Fundation definitely abandoned the PiCamera libray support?

BR,

Stéphane

Re: Set max resolution

Posted: Thu Dec 16, 2021 12:09 pm
by Realizator
Hello Stéphane,
To start with, PiCamera v1 was not developed for a few years, and RPF fixes the major bugs. PiCamera 2 is coming according to Gordon's comment here. So the only way to go for us is to find the issue and fix it ourselves.

Since raspistill works fine, the issue you are faced with is the Python memory issue. I remember the row number to fix is changing from release to release, but I hope you've selected the correct one. As a workaround, I'd try to use multiplication nit by 2 (*2 in the mentioned code) but by a bigger value.

I'm also curious why you need to work with such huge images using Python. It is really slow on the real-time operations with this resolution.