Set max resolution

OpenCV, Python and other image processing questions
pascalfust
Posts: 9
Joined: Fri Jan 31, 2020 6:28 am

Re: Set max resolution

Post by pascalfust »

Good to hear - congrats and lot of success with your project

[email protected]
Posts: 6
Joined: Wed Jul 01, 2020 1:16 pm

Re: Set max resolution

Post by [email protected] »

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)

pascalfust
Posts: 9
Joined: Fri Jan 31, 2020 6:28 am

Re: Set max resolution

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

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

Re: Set max resolution

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

pascalfust
Posts: 9
Joined: Fri Jan 31, 2020 6:28 am

Re: Set max resolution

Post 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 :-)

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

Re: Set max resolution

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

[email protected]
Posts: 6
Joined: Wed Jul 01, 2020 1:16 pm

Re: Set max resolution

Post by [email protected] »

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!

Post Reply