gpt4 book ai didi

python - PiCamera 图片不一致

转载 作者:太空宇宙 更新时间:2023-11-04 04:53:24 24 4
gpt4 key购买 nike

我正在使用带有摄像头模块(Raspberry pi Camera)的 Raspberry pi 无人机安装在无人机上,并编程为在固定间隔后拍照。然而,图像似乎有点不一致,如下所示 .

与其他图片相比,图片 4 和图片 8 的“色彩”略多一些,饱和度也更高。但是,由于默认饱和度为 0 并且我的代码没有更改它,所以我相信这是另外一回事。我的 python 脚本如下所示

def calibrate(t):
with picamera.PiCamera() as camera:
time.sleep(t)
camera.shutter_speed = camera.exposure_speed
ss=camera.shutter_speed
camera.still_stats = 'true'
camera.exposure_mode = 'off'
g = camera.awb_gains
camera.awb_mode = 'off'
camera.awb_gains = g
camera.close()
return ss,g

def capture(ss,g,stream):
with picamera.PiCamera() as camera:
camera.resolution = (3280,2464)
camera.shutter_speed = ss
camera.still_stats
camera.exposure_mode = 'off'
camera.awb_mode = 'off'
camera.awb_gains = g
camera.still_stats = 'true'
camera.capture(stream,format='jpeg')
camera.close()

我在拍摄校准相机的任何照片之前调用校准函数。校准后,我拍照并遇到了这个问题。有谁知道如何解决这个问题?

最佳答案

来自 the docs :

Enabling the still statistics pass will override fixed white balance gains (set via awb_gains and awb_mode).

我敢打赌,当您更改 still_stats 时,awb_mode 会设置回 off 以外的值。似乎报告了完全相同的问题 here .

关于python - PiCamera 图片不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47662978/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com