-
Where did you get the camera module(s)?
The PIHut -
Model number of the product(s)?
Arducam Hawkeye and Owlsight -
What hardware/platform were you working on?
Raspberry PI 5 (4gb) - (with POE hat) 6.18.34+rpt-rpi-2712 (both PIs)
We have a mixture of cameras, including the two above (Hawkeye and Owlsight) in our configuration.
I start the cameras in 1/2 resolution (4624x3472) to focus, then switch to full res to capture the final image. As expected, there is a delay when capturing, but this is significantly different between the two cameras.
On the hawkeye, it takes just over 1 second, but on the Owlsights, it takes around 3 seconds, so almost 2 seconds difference.
Iāve written a very simple python script (see bottom of post) to start the camera, capture an image, save it, then switch to full res and capture another image.
These are the timings (below) as you can see, the difference in time between āBefore Switch/Captureā and āAfter Switch/Captureā is 1.1 second or 2.8 seconds
Hawkeye (arducam_64)
13:15:18.5 Instantiating, model arducam_64mp
13:15:18.5 Starting
13:15:18.6 Waiting 4s
13:15:22.6 Start First Capture
13:15:22.6 After first capture
13:15:22.7 Saved First
13:15:22.7 Before Switch/Capture
13:15:23.8 After Switch/Capture (this is 1.1 second duration)
13:15:24.2 Saved Second
And the Owlsight (ov64a40)
13:15:29.2 Instantiating, model ov64a40
13:15:29.3 Starting
13:15:29.3 Waiting 4s
13:15:33.3 Start First Capture
13:15:33.4 After first capture
13:15:33.4 Saved First
13:15:33.4 Before Switch/Capture
13:15:36.2 After Switch/Capture (this is 2.8 seconds duration)
13:15:36.5 Saved Second
If it helps, these are the debug logs for the Owlsight at the point that it takes 2 seconds (could this be the culprit?)
[0:16:49.115468548] [3406] DEBUG RPI pipeline_base.cpp:755 queueRequestDevice: New request sequence: 0
[0:16:49.115707738] [3406] DEBUG RPISTREAM rpi_stream.cpp:262 Queuing buffer 4 for CFE Image
[0:16:49.115716238] [3406] DEBUG V4L2 v4l2_videodevice.cpp:1783 /dev/video4[14:cap]: Queueing buffer 0
[0:16:51.004032080] [3406] DEBUG Timer timer.cpp:93 Starting timer 0x7fff7c0183b8: deadline 0:16:53.474026728
[0:16:51.005048710] [3406] DEBUG RPISTREAM rpi_stream.cpp:262 Queuing buffer 3 for ISP Output1
I realise that being different cameras, they will behave slightly differently, but itās quite a big difference taking this much longer. In the logs, it mentions timer/deadline.
I want the photos to be taken at the same time, and Iām reluctant to put a delay on the Hawkeye to match the slower Owlsight, so was hoping there might be a better solution?
Also, this is the code Iām using to test.
from picamera2 import Picamera2
import time, os
from datetime import datetime,timezone
def main():
#os.environ["LIBCAMERA_LOG_LEVELS"] = "0" # uncomment to get logs
model = Picamera2.global_camera_info()[0]['Model']
resolutions = {'full': (9248,6944) if model=='ov64a40' else (9152,6944), 'half': (4624,3472), 'quarter': (2312, 1736)}
print(timeNow(), "Instantiating, model", model)
picam2 = Picamera2()
config = picam2.create_still_configuration(main={'format': 'RGB888', 'size': resolutions['half']})
picam2.configure(config)
print(timeNow(), "Starting")
picam2.start()
print(timeNow(), "Waiting 4s")
time.sleep(4)
print(timeNow(), "Start First Capture")
req = picam2.capture_request()
print(timeNow(), "After first capture")
req.save('main', 'zz_1.jpg')
req.release()
print(timeNow(), "Saved First")
newConfig = picam2.create_still_configuration(main={'format': 'RGB888', 'size': resolutions['full']})
print(timeNow(), "Before Switch/Capture")
req3 = picam2.switch_mode_and_capture_request(newConfig)
print(timeNow(),"After Switch/Capture")
req3.save('main', 'zz_3.jpg')
print(timeNow(), "Saved Second")
req3.release()
def timeNow():
return datetime.now(timezone.utc).strftime('%H:%M:%S.%f')[:-5]
main()