如何使用 picamera2 以固定曝光时间捕获高分辨率图像
此脚本将从 Raspberry Pi HQ 摄像头捕获单个摄像头帧,其最大分辨率为 4056x3040px,固定曝光时间为 10.0ms(似乎是 IMX477 传感器能够实现的最小曝光时间),固定模拟增益为 1.0。生成的图像保存到 Exposure10ms.png
capture_exposure_10ms.py
#!/usr/bin/env python3
import time
import picamera2
import numpy as np
with picamera2.Picamera2() as camera:
camera_config = camera.create_still_configuration({"size":(4056, 3040)})
camera.configure(camera_config)
camera.set_controls({"ExposureTime": 10000, "AnalogueGain": 1.0})
camera.start()
camera.capture_file("Exposure10ms.png")
camera.stop()似乎在 camera.configure() 之后使用 camera.set_control() 很重要。
Check out similar posts by category:
Raspberry Pi, Video
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow