mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
18 lines
324 B
Python
18 lines
324 B
Python
import sensor, time, led
|
|
sensor.reset()
|
|
sensor.set_contrast(2)
|
|
sensor.set_framesize(sensor.QQVGA)
|
|
sensor.set_pixformat(sensor.RGB565)
|
|
|
|
clock = time.clock()
|
|
# Take snapshot
|
|
image = sensor.snapshot()
|
|
|
|
# Compress Image
|
|
clock.tick()
|
|
img = image.compress(30)
|
|
print(clock.avg())
|
|
|
|
f = open("/test.jpeg", "w")
|
|
f.write(img)
|
|
f.close() |