Routine explanation -04-vflip_hmirror_transpose vertical horizontal mirror image transpose image
import sensor
import time
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()
img = sensor.snapshot().replace(
vflip=(counter // 2) % 2,
hmirror=(counter // 4) % 2,
transpose=(counter // 8) % 2,
)
if time.ticks_diff(time.ticks_ms(), ticks) > 1000:
ticks = time.ticks_ms()
counter += 1
print(clock.fps())