我正在尝试使用picamera库更改相机的快门速度(而不是帧频)。当我这样做时,结果证明值是0或12。在线示例表明情况不一定如此。
这或多或少非常简单-尝试设置cam.shutter_speed,无论如何,该值始终强制为0或12。
import pygame
from pygame.locals import *
import car
from picamera import PiCamera
import datetime
c = car.Car()
cam = PiCamera()
cam.vflip = True
cam.hflip = True
cam.start_preview()
speed = 0
pygame.init()
width, height = 1280, 1000
screen=pygame.display.set_mode((width, height))
motion = 0 # -1 for backward, 1 for forward
direction = 0 # -50 for left, 50 for right, in between for lesser angles
playerpos=[100,100]
while 1:
screen.fill(0)
for event in pygame.event.get():
# test events, set key states
if event.type == pygame.KEYDOWN:
elif event.key == K_UP:
speed = speed + 1
cam.shutter_speed = speed
print("Shutter speed set to " + str(cam.shutter_speed))
elif event.key == K_DOWN:
speed = max(0, speed - 1)
cam.shutter_speed = speed
print("Shutter speed set to " + str(cam.shutter_speed))
通常,我希望快门速度将保持指定的值。我知道它受fps的限制,但不应限制为0或12。