import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.WQXGA2)
sensor.skip_frames(time = 2000)
clock = time.clock()
while(True):
clock.tick()
# A clip_limit of < 0 gives you normal adaptive histogram equalization
# which may result in huge amounts of contrast noise...
# A clip_limit of 1 does nothing. For best results go slightly higher
# than 1 like below. The higher you go the closer you get back to
# standard adaptive histogram equalization with huge contrast swings.
img = sensor.snapshot().histeq(adaptive=True, clip_limit=3)
img = sensor.snapshot().gamma_corr(gamma = 1.3, contrast = 1.0, brightness = 0.0)
print(clock.fps())sensor.snapshot()是采集,你重新采集了会覆盖上面的。
改为:
img = sensor.snapshot()
img.histeq(adaptive=True, clip_limit=3)
img.gamma_corr(gamma = 1.3, contrast = 1.0, brightness = 0.0)