import sensor #引入感光元件的模块
sensor.reset() # 感光元件复位 Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # 设置图像为彩色 Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA) # 设置图像分辨率 Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000) # 跳过一些帧,等待感光元件变稳定 Wait for settings take effect.
while(True):
img = sensor.snapshot() #获取一张图像,返回一个image对象