Example: 02-Image-Processing/01-Image-Filters/vflip_hmirror_transpose.py
import sensor
import time
import image
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time=2000)
clock = time.clock()
ticks = time.ticks_ms()
counter = 0
while True:
clock.tick()
vflip = image.VFLIP if (counter // 2) % 2 else 0
hmirror = image.HMIRROR if (counter // 4) % 2 else 0
transpose = image.TRANSPOSE if (counter // 8) % 2 else 0
img = sensor.snapshot().scale(hint=(vflip | hmirror | transpose))
if time.ticks_diff(time.ticks_ms(), ticks) > 1000:
ticks = time.ticks_ms()
counter += 1
print(clock.fps())